SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
The COMMAND_SEND_DATA command must only follow a COMMAND_DOWNLOAD or another COMMAND_SEND_DATA command, if more data is needed. Consecutive COMMAND_SEND_DATA commands automatically increment the address and continue programming from the previous location.
The command terminates programming when the number of bytes indicated by the COMMAND_DOWNLOAD command are received.
The bootloader sends the ACK in response to the command after the actual programming is complete. Each time this function is called, enter a COMMAND_GET_STATUS command to ensure that the data was successfully programmed into the Flash. If the bootloader sends a NACK response to this command, the bootloader does not increment the current address, which allows for retransmission of the previous data.
Remember the size byte of the packet is an 8-bit value. This provides the limit for the packet length of 256 bytes.
The format of the packet including the command ID is as follows:
unsigned char ucPacket[4-255];
ucPacket[0] = <size>;
ucPacket[1] = <checksum>;
ucPacket[2] = COMMAND_SEND_DATA;
ucPacket[3] = <image data[0]>;
ucPacket[4] = <image data[1]>;
ucPacket[5] = <image data[2]>;
ucPacket[6] = <image data[3]>;
ucPacket[7] = <image data[4]>;
...
...
ucPacket[<size-1>] = <image data[<size-3>];