PAL update - platform. This file contains the firmware update APIs that need to be implemented in the platform layer. More...
#include "pal.h"
Go to the source code of this file.
Functions | |
palStatus_t | pal_plat_imageInitAPI (palImageSignalEvent_t CBfunction) |
Set the callback function that is called before the end of each API, except for imageGetDirectMemAccess . More... | |
palStatus_t | pal_plat_imageDeInit (void) |
Clear all the resources used by the pal_update APIs. More... | |
palStatus_t | pal_plat_imageGetMaxNumberOfImages (uint8_t *imageNumber) |
Set the imageNumber to the number of available images. You can do this through the hard coded define inside the linker script. More... | |
palStatus_t | pal_plat_imageReserveSpace (palImageId_t imageId, size_t imageSize) |
Claim space in the relevant storage region for imageId with the size of the image. More... | |
palStatus_t | pal_plat_imageSetHeader (palImageId_t imageId, palImageHeaderDeails_t *details) |
Set up the details for the image header. More... | |
palStatus_t | pal_plat_imageWrite (palImageId_t imageId, size_t offset, palConstBuffer_t *chunk) |
Write data from a chunk buffer to an image. More... | |
palStatus_t | pal_plat_imageSetVersion (palImageId_t imageId, const palConstBuffer_t *version) |
Update the image version of imageId . More... | |
palStatus_t | pal_plat_imageFlush (palImageId_t imageId) |
Flush the entire image data after writing ends for imageId . More... | |
palStatus_t | pal_plat_imageGetDirectMemAccess (palImageId_t imageId, void **imagePtr, size_t *imageSizeInBytes) |
Verify whether the imageId is readable. More... | |
palStatus_t | pal_plat_imageReadToBuffer (palImageId_t imageId, size_t offset, palBuffer_t *chunk) |
Read the max of chunk maxBufferLength bytes from the imageId with relative offset and store it in chunk buffer. More... | |
palStatus_t | pal_plat_imageActivate (palImageId_t imageId) |
Set the imageId to be the active image after device reset. More... | |
palStatus_t | pal_plat_imageGetActiveHash (palBuffer_t *hash) |
Retrieve the hash value of the active image to the hash buffer with the max size hash maxBufferLength and set the hash bufferLength to the hash size. More... | |
palStatus_t | pal_plat_imageGetActiveVersion (palBuffer_t *version) |
Retrieve the version of the active image to the version buffer with the size set to version bufferLength . More... | |
palStatus_t | pal_plat_imageWriteHashToMemory (const palConstBuffer_t *const hashValue) |
PAL update - platform. This file contains the firmware update APIs that need to be implemented in the platform layer.
palStatus_t pal_plat_imageActivate | ( | palImageId_t | imageId | ) |
Set the imageId
to be the active image after device reset.
[in] | imageId | The image ID. |
palStatus_t pal_plat_imageDeInit | ( | void | ) |
Clear all the resources used by the pal_update
APIs.
palStatus_t pal_plat_imageFlush | ( | palImageId_t | imageId | ) |
Flush the entire image data after writing ends for imageId
.
[in] | imageId | The image ID. |
palStatus_t pal_plat_imageGetActiveHash | ( | palBuffer_t * | hash | ) |
Retrieve the hash value of the active image to the hash buffer with the max size hash maxBufferLength
and set the hash bufferLength
to the hash size.
[out] | hash | The hash and actual size of hash read. |
palStatus_t pal_plat_imageGetActiveVersion | ( | palBuffer_t * | version | ) |
Retrieve the version of the active image to the version buffer with the size set to version bufferLength
.
[out] | version | The version and actual size of version read. |
palStatus_t pal_plat_imageGetDirectMemAccess | ( | palImageId_t | imageId, |
void ** | imagePtr, | ||
size_t * | imageSizeInBytes | ||
) |
Verify whether the imageId
is readable.
The function also sets imagePtr
to point to the beginning of the image in the memory and imageSizeInBytes
to the image size.
[in] | imageId | The image ID. |
[out] | imagePtr | A pointer to the start of the image. |
[out] | imageSizeInBytes | The size of the image. |
imagePtr
to NULL. palStatus_t pal_plat_imageGetMaxNumberOfImages | ( | uint8_t * | imageNumber | ) |
Set the imageNumber
to the number of available images. You can do this through the hard coded define inside the linker script.
[out] | imageNumber | The total number of images the system supports. |
palStatus_t pal_plat_imageInitAPI | ( | palImageSignalEvent_t | CBfunction | ) |
Set the callback function that is called before the end of each API, except for imageGetDirectMemAccess
.
[in] | CBfunction | A pointer to the callback function. |
palStatus_t pal_plat_imageReadToBuffer | ( | palImageId_t | imageId, |
size_t | offset, | ||
palBuffer_t * | chunk | ||
) |
Read the max of chunk maxBufferLength
bytes from the imageId
with relative offset and store it in chunk buffer.
Set the chunk bufferLength
value to the actual number of bytes read.
imageGetDirectMemAccess
function. [in] | imageId | The image ID. |
[in] | offset | The offset to start reading from. |
[out] | chunk | The data and actual bytes read. |
palStatus_t pal_plat_imageReserveSpace | ( | palImageId_t | imageId, |
size_t | imageSize | ||
) |
Claim space in the relevant storage region for imageId
with the size of the image.
[in] | imageId | The image ID. |
[in] | imageSize | The size of the image. |
palStatus_t pal_plat_imageSetHeader | ( | palImageId_t | imageId, |
palImageHeaderDeails_t * | details | ||
) |
Set up the details for the image header.
The data is written when the image write is called for the first time.
[in] | imageId | The image ID. |
[in] | details | The data needed to build the image header. |
palStatus_t pal_plat_imageSetVersion | ( | palImageId_t | imageId, |
const palConstBuffer_t * | version | ||
) |
Update the image version of imageId
.
[in] | imageId | The image ID. |
[in] | version | The new image version and its length. |
palStatus_t pal_plat_imageWrite | ( | palImageId_t | imageId, |
size_t | offset, | ||
palConstBuffer_t * | chunk | ||
) |
Write data from a chunk buffer to an image.
[in] | imageId | The image ID. |
[in] | offset | The relative offset to write the data into. |
[in] | chunk | A pointer to the struct containing the data and the data length to write. |
palStatus_t pal_plat_imageWriteHashToMemory | ( | const palConstBuffer_t *const | hashValue | ) |
Write the dataId
stored in dataBuffer
to the memory accessible to the bootloader. Currently, only HASH is available.
[in] | hashValue | The data and size of the HASH. |