SWRA466E February 2015 – August 2024 CC1310 , CC1310 , CC1311P3 , CC1311P3 , CC1311R3 , CC1311R3 , CC1312PSIP , CC1312PSIP , CC1312R7 , CC1312R7 , CC1314R10 , CC1314R10 , CC1352P , CC1352P , CC1352P7 , CC1352P7 , CC1352R , CC1352R , CC1354P10 , CC1354P10 , CC1354R10 , CC1354R10 , CC2538 , CC2538 , CC2620 , CC2620 , CC2630 , CC2630 , CC2640 , CC2640 , CC2640R2F , CC2640R2F , CC2640R2F-Q1 , CC2640R2F-Q1 , CC2642R , CC2642R , CC2642R-Q1 , CC2642R-Q1 , CC2650 , CC2650 , CC2650MODA , CC2650MODA , CC2651P3 , CC2651P3 , CC2651R3 , CC2651R3 , CC2651R3SIPA , CC2651R3SIPA , CC2652P , CC2652P , CC2652P7 , CC2652P7 , CC2652PSIP , CC2652PSIP , CC2652R , CC2652R , CC2652R7 , CC2652R7 , CC2652RB , CC2652RB , CC2652RSIP , CC2652RSIP , CC2674R10 , CC2674R10
To write data to the flash memory, use the SBL
function writeFlashRange. writeFlashRange sends
the CMD_DOWNLOAD command to the bootloader together with the start
address and the download size in bytes. The bootloader is now prepared to receive
the specified amount of data and write the data to flash, starting at the specified
address.
To transfer the data, use the
CMD_SEND_DATA command. A maximum of 252 bytes of data can be
transferred per the CMD_SEND_DATA command. If the data to be
downloaded is larger than 252 bytes, the CMD_SEND_DATA command must
be repeated. The SBL writeFlashRange function handles splitting
data transfer into multiple CMD_SEND_DATA commands.
The status of the bootloader is read after both
the CMD_DOWNLOAD command and after each
CMD_SEND_DATA command by using the
CMD_GET_STATUS command. This is to make sure that the start
address and firmware size are valid, and that the data was successfully programmed
into the flash. If the status indicates an error, the internal address pointer of
the bootloader is not incremented, allowing the data to be re-transferred.
For the CC13x4 or CC26x4 device family, the CCFG is located outside of the main
flash. This means that two iterations of the SBL writeFlashRange
function are needed; one for the application binary and one for the CCFG binary.
Figure 4-7 demonstrates the flash write sequence using the SBL function
writeFlashRange.
Figure 4-7 Sequence Chart for Flash Write