Document number 205065Version Rev. NIssue date 2019-02-04Sirius OBC and TCM User Manualwww.aacmicrotec.com Page 155 of 174Table 9.12 Calculated flash CRC reportImage copy number ChecksumUINT8 UINT329.4. Software APIThis API depicts the functions available on the level below the PUS API and share manysimilarities with these. In many cases, the PUS API simply handle the PUS packaging andvalidation 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 againwhile an upload is in progress will cause the existing upload to be aborted. A valid imagemust be at least 272 bytes and at most 16777216 bytes including header, but setting theargument to 0 is also allowed in order to abort an upload without starting a new one.Argument name Type Direction Decriptiontotal uint32_t in Total size of the uploaded imageReturn value Description0 Success-EINVAL Invalid image size-EBUSY Unable to open System Flash for writing9.4.2. int32_t swu_segment_add(…)This function is used for putting together data segments into a full image. Use the functionswu check to get current upload status.Argument name Type Direction Decriptionseg_num uint16_t in Number of this data segmentlength uint16_t in Length of this data segmentdata uint8_t * in Data of the added segmentReturn value Description0 Success-EALREADY This segment has already been added-EINVAL Segment number or segment length is invalid, ordata is a NULL pointer