32 #define UPD_CHUNK_SIZE 512
33 #define UPD_CHUNK_MAX ( FLASH_SPACING / UPD_CHUNK_SIZE )
35 #define E_UPD_SOMECHUNKS ( E_UPD + 0x01 )
36 #define E_UPD_SOMECHUNKS_DESCR "Some chunks lost"
38 #define E_UPD_MANYCHUNKS ( E_UPD + 0x02 )
39 #define E_UPD_MANYCHUNKS_DESCR "Too many chunks lost"
41 #define E_UPD_CHECKSUM ( E_UPD + 0x03 )
42 #define E_UPD_CHECKSUM_DESCR "Image checksum invalid"
44 #define E_UPD_PROTECTED ( E_UPD + 0x04 )
45 #define E_UPD_PROTECTED_DESCR "Protection present"
68 bool updStart(
int imageIdx, uint32_t chunkCount);
79 bool updWrite(uint32_t chunkNo, uint8_t * chunk);
92 bool updEnd(uint32_t * chunkLostList, uint32_t * chunksCount);
111 bool updVerify(uint32_t imgNo, uint32_t chunkNo, uint8_t * chunk,
bool * result);
134 #define UPD_IMGTYPE_NONE ((int8_t)-1)
135 #define UPD_IMGTYPE_UNKNOWN 0
136 #define UPD_IMGTYPE_GOLDEN 1
137 #define UPD_IMGTYPE_RUNTIME 2
138 #define UPD_IMGTYPE_BASE 3
139 #define UPD_IMGTYPE_CALIB 4
bool updVerify(uint32_t imgNo, uint32_t chunkNo, uint8_t *chunk, bool *result)
Verify a chunk.
bool updWrite(uint32_t chunkNo, uint8_t *chunk)
Write a update chunk.
Defines the configuration of the LM32 SOC for the CLBv2.
bool updUnlock()
Unlocks the golden image for writing.
bool updImgInfo(uint32_t imgNo, UpdImgInfo *imgInfo)
Retrieve image information for the specified location.
bool updIsUpdating(int *index)
Returns whether or not the storage is in update mode.
int8_t imgType
Image type.
bool updInit()
Initializes the update module.
bool updEnd(uint32_t *chunkLostList, uint32_t *chunksCount)
Ends the update.
bool updLock()
Locks the golden image for writing.
bool updStart(int imageIdx, uint32_t chunkCount)
Starts an image update.
void updCancel()
Aborts the update.
uint32_t swRev
Software revision.
uint32_t fwRev
Firmware revision.
This module is responsible for distributing error codes.
const int updMaxImages
Maximum no of images.