Below are two steps need to be
performed before starting firmware upgrade process:
- Send one-byte command 0x55 to
check application code execution status, so that you know which application code
need to be upgraded.
- Send one-byte command 0x11 to
check bootloader status, if device responds 0x51, means that bootloader is in
active status and is ready for firmware upgrade. Otherwise, you need to send
one-byte command 0xAA to force bootloader from suspend to active status
first.
When you are sure bootloader is in
active status, send the password to unlock the device first, then erase the needed
flash space and program new application code.
Here are tips to send the application
code.
- Make sure the application code
.txt file is 16-byte aligned. The host software is responsible to fill unused
space with dummy data bytes, make sure the .txt file is 16-byte aligned, see
Figure 6-2 and Figure 6-3.
- Send the first line (first 16
bytes in the firmware) of the new application’s firmware in the end. This is to
avoid the case an uncompleted firmware be executed unexpected. For current
bootloader just to check if the first 8 bytes are all 0xFF to check if the
application firmware exist, it will not check if the firmware to be completed.
If you send the first line of the firmware in the end, that makes sure that the
whole firmware has been sent successfully.
After programming new application
code, send the command CMD start application to execute new application code.