The following steps can be followed to perform a FW image update to a device enabled
to run the ROM Bootloader.
For this example, let's assume we have an updated application which begins at address
0x00000000, has a length of 0x28000 and a CRC over all of the bytes has a value of
0xFACEFACE.
- The device needs to bootup into the ROM Bootloader. This can be done either by
setting the pAppVtor to an invalid value OR by setting the pinTriggerDio to the
specified pinTriggerLevel.
- The bootloader needs to know which serial interface is being used.
- UART - send the AutoBaud sequence as described in Section 8.5.1.2.1.1
- SPI - send any ROM Bootloader cmd (ping command is a good
suggestion)
- Now that the bootloader is triggered and communicating correctly, prepare the
device for the FW image update
- Send the BLDR_CMD_CHIP_ERASE command
- Wait for the ACK/NACK and then send the BLDR_CMD_GET_STATUS
- Wait for the ACK/NACK and ensure the previous command was completed
successfully with the BLDR_CMD_RET_SUCCESS value
- Start the Application Download
- Send the BLDR_CMD_DOWNLOAD_CRC command, passing as input the
startAddress=(0x00000000), length=(0x28000), CRC=(0xFACEFACE)
- wait for the ACK/NACK and then send the BLDR_CMD_GET_STATUS
- wait for the ACK/NACK and ensure the previous command was completed
successfully with the BLDR_CMD_RET_SUCCESS value
- Loop over the bytes of the image and send the data to the ROM Bootloader
- Send the BLDR_CMD_SEND_DATA command, passing as input the next 252 bytes
of the application image.
- wait for the ACK/NACK and then send the BLDR_CMD_GET_STATUS
- wait for the ACK/NACK and ensure the previous command was completed
successfully with the BLDR_CMD_RET_SUCCESS value
- Repeat steps 5a-5c until all 0x28000 bytes have been transferred
- Start the CCFG Download
- Send the BLDR_CMD_DOWNLOAD_CRC command passing as input the
startAddress=(0x4E020000), length=(2048),
CRC=(calc_crc(ccfg_contents))
- wait for the ACK/NACK and then send the BLDR_CMD_GET_STATUS
- wait for the ACK/NACK and ensure the previous command was completed
successfully with the BLDR_CMD_RET_SUCCESS value
- Loop over the bytes of the CCFG contents and send the data to the ROM
Bootloader
- Send the BLDR_CMD_SEND_DATA command, passing as input the next 252 bytes
of the CCFG content.
- wait for the ACK/NACK and then send the BLDR_CMD_GET_STATUS
- wait for the ACK/NACK and ensure the previous command was completed
successfully with the BLDR_CMD_RET_SUCCESS value
- Repeat steps 5a-5c until all 2048 bytes have been transferred
- Reset the device either by pulling the RST pin externally or by sending the
BLDR_CMD_RESET command.
- Keeping in mind that the triggerPin should now be inverted so that the
bootcode/bootlaoder can freely pass execution onto the application this
time around
- DONE! The device will now bootup into the new flash content that has been
programmed to it.