Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
155
of
174
Table 9.12 Calculated flash CRC report
Image copy number
Checksum
UINT8
UINT32
9.4. Software API
This API depicts the functions available on the level below the PUS API and share many
similarities with these. In many cases, the PUS API simply handle the PUS packaging and
validation and maps almost directly into the software API functions.
9.4.1.
int32_t swu_init(…)
This function initializes all internal parameters for a new image upload. Calling init again
while an upload is in progress will cause the existing upload to be aborted. A valid image
must be at least 272 bytes and at most 16777216 bytes including header, but setting the
argument to 0 is also allowed in order to abort an upload without starting a new one.
Argument name
Type
Direction
Decription
total
uint32_t
in
Total size of the uploaded image
Return value
Description
0
Success
-EINVAL
Invalid image size
-EBUSY
Unable to open System Flash for writing
9.4.2.
int32_t swu_segment_add(…)
This function is used for putting together data segments into a full image. Use the function
swu check to get current upload status.
Argument name
Type
Direction
Decription
seg_num
uint16_t
in
Number of this data segment
length
uint16_t
in
Length of this data segment
data
uint8_t *
in
Data of the added segment
Return value
Description
0
Success
-EALREADY
This segment has already been added
-EINVAL
Segment number or segment length is invalid, or
data is a NULL pointer