Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
157
of
174
-EINVAL
Checksum argument doesn’t match image
checksum
-EIO
Error when accessing flash
-ENOSPC
Out of non-bad blocks in one or more of the boot
image areas in flash
-ENOENT
No upload in progress
9.4.5.
int32_t swu_flash_check(…)
This function will calculate the checksum of an image in flash for specific verification
purposes. The maximum image number is 6 and number 1 - 3 maps to the safe image
copies and number 4 - 6 maps to the updated image copies. If the argument is out of
bounds of the number of images, an error return code will be returned instead.
Argument name
Type
Direction
Decription
image_number
uint8_t
in
Image number in flash to calculate the checksum of
checksum
uint32_t *
out
The calculated checksum.
Return value
Description
0
Success
-EINVAL
Image number is too small or large, or checksum
is a NULL pointer
-EIO
Read error in image
-EBUSY
Unable to open flash device file
9.5. Usage description
A user of the software upload module can either let the module handle all PUS commanding
through the PUS API (see section 9.3) or handle all PUS packetizing and reporting internally
and only hook into the functional interface described in section 9.4. A code example is
provided in the directory ..\src\example
9.6. Limitations
The maximum size of an image for upload is 16 Mbytes.