SWCU192 November 2021 CC1312R7 , CC1352P7 , CC2652P7 , CC2652R7
The COMMAND_DOWNLOAD command is sent to the bootloader to indicate where to store data in flash and how many bytes will be sent by the COMMAND_SEND_DATA commands that follow. The command consists of two 32-bit values that are both transferred MSB first. The first 32-bit value is the address to start programming data into, while the second is the 32-bit size of the data that will be sent. This command must be followed by a COMMAND_GET_STATUS command to ensure that the program address and program size are valid for the device. On the CC13x2x7 and CC26x2x7 devices, the flash starts at address 0x0000 0000. The command does not perform any kind of erase operation; it only prepares for the following flash programming performed by COMMAND_SEND_DATA commands. Required flash erase can be done by the COMMAND_BANK_ERASE and COMMAND_SECTOR_ERASE commands.
The format of the packet including the command is as follows:
unsigned char ucCommand[11];
ucCommand[0] = <size=11>;
ucCommand[1] = <checksum>;
ucCommand[2] = COMMAND_DOWNLOAD;
ucCommand[3] = Program Address [31:24];
ucCommand[4] = Program Address [23:16];
ucCommand[5] = Program Address [15:8];
ucCommand[6] = Program Address [7:0];
ucCommand[7] = Program Size [31:24];
ucCommand[8] = Program Size [23:16];
ucCommand[9] = Program Size [15:8];
ucCommand[10] = Program Size [7:0];