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
The eraseFlashRange
function uses
the bootloader command CMD_ERASE
for CC2538 and
CMD_SECTOR_ERASE
for CC13xx and CC26xx.
The CC13xx or CC26xx
CMD_SECTOR_ERASE
takes an address parameter and erases the
flash sector in which the address is located.
The CC2538 CMD_ERASE
command
requires a second argument for the erase size. The CC2538 bootloader erases the
flash sectors (2KB) that are covered by the range [address, address + size].
After each bootloader erase command,
eraseFlashRange
checks the bootloader status using the
CMD_GET_STATUS
command.
Figure 4-6 shows the sequence chart for a flash erase using the serial bootloader protocol.
The last four bytes in the command (datasize
) is specific for
CC2538. For CC13xx or CC26xx, the CMD_SECTOR_ERASE
command (and
consequent CMD_GET_STATUS
) must be repeated for each flash sector
to erase.
If the whole Flash memory is to be erased on
CC13xx or CC26xx, use the CMD_BANK_ERASE
command. This erases the
whole Flash memory in one operation, which is faster than deleting sectors
individually.