Texas Instruments CC2650DK ユーザーズマニュアル

ページ / 1570
Bootloader Interfaces
8.2.3.2
COMMAND_DOWNLOAD
This 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 should be followed by
a COMMAND_GET_STATUS command to ensure that the program address and program size are valid
for the device. On CC26xx, the flash starts at address 0x1800 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];
8.2.3.3
COMMAND_SEND_DATA
This command should only follow a COMMAND_DOWNLOAD command 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 is 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 NAK signal to this command, the
bootloader does not increment the current address, which allows for retransmission of the previous data.
The format of the packet including the command is as follows:
unsigned char ucCommand[4-255];
ucCommand[0] = <size>;
ucCommand[1] = <checksum>;
ucCommand[2] = COMMAND_SEND_DATA;
ucCommand[3] = Data byte to be programmed[0];
ucCommand[4] = Data byte to be programmed[1];
ucCommand[5] = Data byte to be programmed[2];
ucCommand[6] = Data byte to be programmed[3];
ucCommand[7] = Data byte to be programmed[4];
ucCommand[<size-1>] = Data byte to be programmed[<size-4>];
8.2.3.4
COMMAND_SECTOR_ERASE
This command erases a specified flash sector. One flash sector has the size of 4KB.
The command consists of one 32-bit value that is transferred MSB first. The 32-bit value is the start
address of the flash sector to be erased.
The bootloader responds with an ACK signal to the host device after the actual erase operation is
performed.
On CC26xx, the flash starts at address 0x1800 0000 and it has 32 sectors of 4KB each.
678
Bootloader
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated