ISP DLL User Guide презентация

Topic _ISP_Config _ISP_RetrieveDeviceID _ISP_UnlockDebugPort _ISP_EMMCDownload _ISP_EMMCUpload _ISP_SPIUpload _ISP_SPINANDUpload _ISP_TurnOnAC _ISP_TurnOfAC _ISP_SaveLog Sample Code

Слайд 1ISP DLL User Guide
4.9.2


Слайд 2Topic
_ISP_Config
_ISP_RetrieveDeviceID
_ISP_UnlockDebugPort
_ISP_EMMCDownload
_ISP_EMMCUpload
_ISP_SPIUpload
_ISP_SPINANDUpload
_ISP_TurnOnAC
_ISP_TurnOfAC
_ISP_SaveLog
Sample Code


Слайд 3_ISP_Config
int _ISP_Config(char *configName, char *value)

Return
0 success
1 unknown name

Input
name config name, supported config and default

value are listed below
“ISP Slave Address” 0x92
“Serial Debug Slave Address” 0xB2
value value to be set, represented by string

Description
change DLL settings


Слайд 4_ISP_RetrieveDeviceID
int _ISP_RetrieveDeviceID(char *buffer, int length)

Return
0 success
-1 buffer length must be >= 16

Input
buffer buffer to

store retrieved id string
length buffer length, must >=16

Description
read device id for secured device
something wrong if id is 0x000000000000 or 0xFFFFFFFFFFFF


Слайд 5int _ISP_UnlockDebugPort(char *pswd, char *chipType)

Return
0 success
-1 unlock failed
-2 unknown password format

Input
pswd password
chipType chip type string, supported

value: "2nd generation"

Description
unlock debug port communication by a password

_ISP_UnlockDebugPort


Слайд 6_ISP_EMMCDownload
int _ISP_EMMCDownload(char *loader, char *imageFile)

Return
0 success
-1 unable to enter ISP mode
-2 connect fail, or

unable to detect device type
2 Program file not ready yet
4 User break
50 Program Error

Input
loader loader to write image
imageFile image to be written

Description
write an image file to emmc


Слайд 7_ISP_EMMCUpload
int _ISP_EMMCUpload(char *loader, char *dumpedFile)

Return
0 success
-1 unable to enter ISP mode
-2 connect fail, or

unable to detect device type
1 no loader file
2 strange dumped file path
3 unable to open dumped file

Input
loader loader to load image
dumpedFile file to be dumped to

Description
read from emmc and write to a file

Слайд 8_ISP_SPIUpload
int _ISP_SPIUpload(char *dumpedFile, const DWORD startAddr, const DWORD endAddr)
Return
0 success
-1 unable to enter

ISP mode
-2 connect fail, or unable to detect device type
1 start address larger than end address
2 end address larger then device size
3 unable to create dumped file
10 flash is busy (SPI)
Input
dumpedFile file to be dumped to
startAddr start address to be dumped
endAddr end address to be dumped
Description
read from spi flash and write to a file

Слайд 9_ISP_SPINANDUpload
int _ISP_SPINANDUpload(char *dumpedFile, const DWORD startAddr, const DWORD endAddr)
Return
0 success
-1 unable to enter

ISP mode
-2 connect fail, or unable to detect device type
1 start address larger than end address
2 end address larger then device size
3 unable to create dumped file
20 base address too large (SPINAND only)
21 over max block (SPINAND only)
Input
dumpedFile file to be dumped to
startAddr start address to be dumped
endAddr end address to be dumped
Description
read from spi flash and write to a file

Слайд 10_ISP_TurnOnAC
int _ISP_TurnOnAC(void)

Return
0 success
1 fail

Input
No input

Description
turn on AC
a mstar debug board must be used

to control an ac relay

Слайд 11_ISP_TurnOffAC
int _ISP_TurnOffAC(void)

Return
0 success
1 fail

Input
No input

Description
turn off AC
a mstar debug board must be used

to control an ac relay

Слайд 12_ISP_SaveLog
int _ISP_SaveLog(char * logFilePath)

Return
0 success
1 unable to open log file

Input
logFilePath file to save log



Description
save log of DLL APIs to a file for debug usage
due to memory consideration, only log of last few APIs will be record


Слайд 13Sample Code - DLL Loading
typedef int (*RETRIEVE_API)(char * , int);
typedef int

(*UNLOCK_API)(char * , char *);
typedef int (*DOWNLOAD_API)(char * , char *);
typedef int (*LOG_SAVE_API)(char *);

RETRIEVE_API ISP_RetrieveDeviceID;
UNLOCK_API ISP_UnlockDebugPort;
DOWNLOAD_API ISP_EMMCDownload;
LOG_SAVE_API ISP_SaveLog;

HINSTANCE hInst = LoadLibrary(sEccDllFile);
if(!hInst) return;

ISP_RetrieveDeviceID = (RETRIEVE_API)GetProcAddress(hInst, "_ISP_RetrieveDeviceID");
ISP_UnlockDebugPort = (UNLOCK_API)GetProcAddress(hInst, "_ISP_UnlockDebugPort");
ISP_EMMCDownload = (DOWNLOAD_API)GetProcAddress(hInst, "_ ISP_EMMCDownload ");
ISP_SaveLog = (LOG_SAVE_API)GetProcAddress(hInst, "_ ISP_SaveLog ");


Слайд 14Sample Code – Secure EMMC Download
int iReturn;
char idBuffer[16];
char password[128];
char * sLoaderFile

= “D:\Product\Loader\loader_user.bin”;
char * sDownloadFile = “D:\Product\Image\image.bin”;

iReturn = ISP_RetrieveDeviceID(idBuffer, 16);

//
// Customer to do: use device id to get unlock password
//

iReturn = ISP_UnlockDebugPort(password, “2nd generation”);
iReturn = ISP_EMMCDownload(sLoaderFile, sDownloadFile);
if(iReturn)
{
printf("download error!! error no = %d\n", iReturn);
}
iReturn = ISP_SaveLog(“isp_dll_log.txt”);


Обратная связь

Если не удалось найти и скачать презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое ThePresentation.ru?

Это сайт презентаций, докладов, проектов, шаблонов в формате PowerPoint. Мы помогаем школьникам, студентам, учителям, преподавателям хранить и обмениваться учебными материалами с другими пользователями.


Для правообладателей

Яндекс.Метрика