Skip to main content

Img Info Lib API

danger

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.

Data Structures

struct  ROMHDRstruct  TOCentrystruct  FILESentrystruct  COPYentrystruct  VERSIONINFOstruct  BSPVER

Macros

#define IMG_VER_MAJ   1
 Library Version.
#define IMG_VER_MIN   4
#define IMG_VER_BUILD   0
#define VI_MAGIC1   0x01234567
#define VI_MAGIC2   0x89abcdef

Typedefs

typedef struct ROMHDR ROMHDR
typedef struct TOCentry TOCentry
typedef struct TOCentryLPTOCentry
typedef struct FILESentry FILESentry
typedef struct FILESentryLPFILESentry
typedef struct COPYentry COPYentry

Functions

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)

Macro Definition Documentation

#define IMG_VER_BUILD   0
 
#define IMG_VER_MAJ   1
Library Version.
#define IMG_VER_MIN   4
 
#define VI_MAGIC1   0x01234567
 
#define VI_MAGIC2   0x89abcdef
 

Typedef Documentation

typedef struct COPYentry COPYentry
 
typedef struct FILESentry FILESentry
 
typedef struct FILESentry * LPFILESentry
 
typedef struct TOCentry * LPTOCentry
 
typedef struct ROMHDR ROMHDR
 
typedef struct TOCentry TOCentry
 

Function Documentation

BOOL FindIMAGE(BOOL bImage,
  DWORD * pStart,
  DWORD * pLen 
 )  
Find the image in the Flash
Parameters:
[in]bImageTRUE: Skip First Sector
[out]pStartPointer to start of image
[out]pLenPointer to length of image
Return values:
TRUESuccess
FALSEError
BOOL FindVersionInfo(BSPVERpBspVer) 
Finds the BSP Version starting from 0x00 for 256Kb
Parameters:
[out]pBspVerPointer to BSP Version Structure
Return values:
TRUESuccess
FALSEError
BOOL FindVersionInfoEx(BSPVERpBspVer,
  DWORD startAddr,
  DWORD length 
 )  
Finds the BSP Version, use the supplied start address and length
Parameters:
[in]startAddrStart Address
[in]lengthSearch length
[out]pBspVerPointer to BSP Version Structure
Return values:
TRUESuccess
FALSEError
char* FindVersionString(char * pStr) 
Finds the given string
Parameters:
[in]pStrPointer to zero-terminated string to find
Return values:
>0Pointer to last character of the string
NULL(0)String not found
void GetCurrentImageInfo(BSPVERpBspVer,
  TCHAR * dateStr 
 )  
Get the Current Imae Info
Parameters:
[in]pBspVerPointer to BSP Version
[in]dateStrDate String
BOOL GetFlashBootloaderInfo(BSPVERpBspVer,
  TCHAR * dateStr 
 )  
Get the Bootloader info from the flash, search the whole of the flash
Parameters:
[in]pBspVerPointer to BSP Version
[in]dateStrDate String
Return values:
TRUESuccess
FALSEError
BOOL GetFlashBootloaderInfoEx(BSPVERpBspVer,
  TCHAR * dateStr,
  DWORD start,
  DWORD length 
 )  
Get the Bootloader info from the flash
Parameters:
[in]pBspVerPointer to BSP Version
[in]dateStrDate String
[in]startStart Address
[in]lengthLength
Return values:
TRUESuccess
FALSEError
DWORD GetIMAGESize(DWORD address) 
Get the Image Size
Parameters:
[in]addressStarting Address
Return values:
ImageSize in bytes
Remarks: We also search at 32KB offset for romhdr (eboot offset
in eboot_formatted.bin)
BOOL GetTOC(DWORD address,
  ROMHDRpTOC,
  DWORD * pTOCOffset 
 )  
Get the Table of Contents Pointer
Parameters:
[in]addressStarting address
[out]pTOCPointer to TOC
[out]pTOCOffsetPointer to TOC Offset
Return values:
TRUESuccess
FALSEError
void IMGGetLibVersion(DWORD * pVerMaj,
  DWORD * pVerMin,
  DWORD * pBuild 
 )  
Outputs library version
Parameters:
[out]verMajMajor version number. Set this parameter to NULL if not required
[out]verMinMinor version number. Set this parameter to NULL if not required
[out]buildBuild number. Set this parameter to NULL if not required
BOOL ImgInfoLibDeInit(void  ) 
Frees the Image Information library
Return values:
TRUESuccess
FALSEError
BOOL ImgInfoLibInit(void  ) 
Initialise the Image Information Library.
Return values:
TRUESuccess
FALSEError


Send Feedback!