Article updated
at 28 Oct 2017
Attention: this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.
Library to interact with Image Information.
struct
ROMHDRstruct
TOCentrystruct
FILESentrystruct
COPYentrystruct
VERSIONINFOstruct
BSPVER
|
BOOL |
ImgInfoLibInit (void) |
BOOL |
ImgInfoLibDeInit (void) |
BOOL |
FindVersionInfo (BSPVER *pBspVer) |
BOOL |
FindVersionInfoEx (BSPVER *pBspVer, DWORD startAddr, DWORD length) |
char * |
FindVersionString (char *pStr) |
BOOL |
GetTOC (DWORD address, ROMHDR *pTOC, DWORD *pTOCOffset) |
DWORD |
GetIMAGESize (DWORD address) |
BOOL |
FindIMAGE (BOOL bImage, DWORD *pStart, DWORD *pLen) |
BOOL |
GetFlashBootloaderInfo (BSPVER *pBspVer, TCHAR *dateStr) |
BOOL |
GetFlashBootloaderInfoEx (BSPVER *pBspVer, TCHAR *dateStr, DWORD start, DWORD length) |
void |
GetCurrentImageInfo (BSPVER *pBspVer, TCHAR *dateStr) |
void |
IMGGetLibVersion (DWORD *pVerMaj, DWORD *pVerMin, DWORD *pBuild) |
#define VI_MAGIC1 0x01234567 |
#define VI_MAGIC2 0x89abcdef |
BOOL FindIMAGE |
( |
BOOL |
bImage, |
|
|
DWORD * |
pStart, |
|
|
DWORD * |
pLen |
|
) |
|
|
Find the image in the Flash
- Parameters:
-
[in] |
bImage |
TRUE: Skip First Sector |
[out] |
pStart |
Pointer to start of image |
[out] |
pLen |
Pointer to length of image |
- Return values:
-
BOOL FindVersionInfo |
( |
BSPVER * |
pBspVer |
) |
|
Finds the BSP Version starting from 0x00 for 256Kb
- Parameters:
-
[out] |
pBspVer |
Pointer to BSP Version Structure |
- Return values:
-
BOOL FindVersionInfoEx |
( |
BSPVER * |
pBspVer, |
|
|
DWORD |
startAddr, |
|
|
DWORD |
length |
|
) |
|
|
Finds the BSP Version, use the supplied start address and length
- Parameters:
-
[in] |
startAddr |
Start Address |
[in] |
length |
Search length |
[out] |
pBspVer |
Pointer to BSP Version Structure |
- Return values:
-
char* FindVersionString |
( |
char * |
pStr |
) |
|
Finds the given string
- Parameters:
-
[in] |
pStr |
Pointer to zero-terminated string to find |
- Return values:
-
>0 |
Pointer to last character of the string |
NULL(0) |
String not found |
void GetCurrentImageInfo |
( |
BSPVER * |
pBspVer, |
|
|
TCHAR * |
dateStr |
|
) |
|
|
Get the Current Imae Info
- Parameters:
-
[in] |
pBspVer |
Pointer to BSP Version |
[in] |
dateStr |
Date String |
BOOL GetFlashBootloaderInfo |
( |
BSPVER * |
pBspVer, |
|
|
TCHAR * |
dateStr |
|
) |
|
|
Get the Bootloader info from the flash, search the whole of the flash
- Parameters:
-
[in] |
pBspVer |
Pointer to BSP Version |
[in] |
dateStr |
Date String |
- Return values:
-
BOOL GetFlashBootloaderInfoEx |
( |
BSPVER * |
pBspVer, |
|
|
TCHAR * |
dateStr, |
|
|
DWORD |
start, |
|
|
DWORD |
length |
|
) |
|
|
Get the Bootloader info from the flash
- Parameters:
-
[in] |
pBspVer |
Pointer to BSP Version |
[in] |
dateStr |
Date String |
[in] |
start |
Start Address |
[in] |
length |
Length |
- Return values:
-
DWORD GetIMAGESize |
( |
DWORD |
address |
) |
|
Get the Image Size
- Parameters:
-
[in] |
address |
Starting Address |
- Return values:
-
Remarks: We also search at 32KB offset for romhdr (eboot offset
in eboot_formatted.bin)
BOOL GetTOC |
( |
DWORD |
address, |
|
|
ROMHDR * |
pTOC, |
|
|
DWORD * |
pTOCOffset |
|
) |
|
|
Get the Table of Contents Pointer
- Parameters:
-
[in] |
address |
Starting address |
[out] |
pTOC |
Pointer to TOC |
[out] |
pTOCOffset |
Pointer to TOC Offset |
- Return values:
-
void IMGGetLibVersion |
( |
DWORD * |
pVerMaj, |
|
|
DWORD * |
pVerMin, |
|
|
DWORD * |
pBuild |
|
) |
|
|
Outputs library version
- Parameters:
-
[out] |
verMaj |
Major version number. Set this parameter to NULL if not required |
[out] |
verMin |
Minor version number. Set this parameter to NULL if not required |
[out] |
build |
Build number. Set this parameter to NULL if not required |
BOOL ImgInfoLibDeInit |
( |
void |
|
) |
|
Frees the Image Information library
- Return values:
-
BOOL ImgInfoLibInit |
( |
void |
|
) |
|
Initialise the Image Information Library.
- Return values:
-