SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
The COMMAND_MEMORY_WRITE command requests the bootloader to write 8- or 32-bit data to a specified memory address. Data to be written must be contained in same packet as the command. The access width is given by the specified Access Type. The specified Access Type must be either a 0 or 1. The value of 0 forces 8-bit read accesses. The value of 1 forces 32-bit read accesses. The specified Number of Accesses gives the number of 8- or 32-bit read accesses. The number of data bytes received is given by the packet size byte. Maximum number of data bytes for access width 0 is 247 and 244 for access width 1.
Specific memory mapped areas must not be written to using the COMMAND_MEMORY_WRITE command.
Memory writes to the following memory mapped areas can cause the serial bootloader to end up in a nonfunctional state as these areas are used by the bootloader. This is valid for the following memory mapped areas:
The lower 4 KB of SRAM (0x20000000 to 0x20000FFF)
Any hardware registers controlling the functionality of the serial interface (UART or SPI) currently being used by the serial bootloader
The COMMAND_MEMORY_WRITE command cannot be used to write to Flash memory.
The format of the packet including the command ID is as follows:
unsigned char ucPacket[(from 9 to 255)];
ucPacket[0] = <size=(from 9 to 255)>;
ucPacket[1] = <checksum>;
ucPacket[2] = COMMAND_MEMORY_WRITE;
ucPacket[3] = <Memory Mapped Address [31:24]>;
ucPacket[4] = <Memory Mapped Address [23:16]>;
ucPacket[5] = <Memory Mapped Address [15:8]>;
ucPacket[6] = <Memory Mapped Address [7:0]>;
ucPacket[7] = <Access Type [7:0]>;
ucPacket[8] = <Data [0]>;
...
...
ucPacket[9 + (size-9)] = <Data [size-8]>;