Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
156
of
174
-EIO
Read/write error in intermediate storage area of
flash (critical)
-ENOSPC
Out of non-flash blocks in intermediate storage
area of slash (critical)
-ENOENT
No upload in progress
9.4.3. int32_t swu_check
(…)
This function can be used to check the status of a current image upload. If all segments
have been added, it will calculate the checksum of the entire image. If not all segments have
beenadded, it will instead return an error code and an array of the ten first missing segments
(maximum).
Argument name
Type
Direction
Decription
checksum
uint32_t *
out
Data checksum if the image is complete. 0 otherwise
mlist
uint16_t *
out
An array of the first 10 missing segments. If the image is
complete, no data will be entered into this variable. If only
the checksum is of interest this may be a NULL pointer.
mlength
uint16_t *
out
The amount of elements in the missing segment array. If
only the checksum is of interest this may be a NULL
pointer.
Return value
Description
0
Success
-ENODATA
Not enough data - some data segments missing
-ENOENT
No upload in progress
-EINVAL
NULL pointer in arguments
9.4.4.
int32_t swu_update(…)
This function will perform the actual write of the image to flash. If one or more of the boot
image areas in flash is out of space due to too many bad blocks an error will be returned,
but the copies with enough space will still be written.
Argument name
Type
Direction
Decription
checksum
uint32_t
in
Externally calculated checksum (checked against an
internal calculation before update)
Return value
Description
0
Success