User's Manual

3.3.8 Device Firmware Upgrade
3.3.8.1 Introduce Device Firmware Upgrade
Device Firmware Upgrade (DFU) feature allows RN4020 to upgrade its firmware in
the field. As any DFU process, firmware upgrade should be handled very carefully to
avoid unrecoverable damage to the device.
RN4020 supports two ways of doing DFU: wired solution through UART or wireless
solution Over The Air (OTA). Both solutions provide firmware integrity support. If
upgrade fails for any reason, keep RN4020 alive and try to recover by applying the
DFU process again.
When RN4020 performs DFU through UART, following conditions must be met:
UART hardware flow control (RTS/CTS) must be used
No UART communication other than streaming the DFU image.
No RF communication attempts. All other operations during DFU period.
When RN4020 performs DFU through OTA, following conditions must be met:
Only one-to-one connection allows between the device to be update
firmware and the device that provides update image.
Try best to avoid RF interference
Once DFU is finished, the update status will be sent through UART. If DFU is
successful, message “Upgrade OK” will be sent via UART and the device
automatically reboot. The configurations of RN4020 may be changed after the
upgrade. If this is the case, it is recommended to perform a factory reset and
configure RN4020 properly afterwards.
If DFU fails, message “Upgrade Err” will be send through UART and the device stays
in DFU mode. In case DFU fails, DO NOT POWER DOWN OR RESET THE DEVICE.
The complete DFU image could be sent again to fix any error introduced by
communication until DFU image is correctly received by RN4020 module.
3.3.8.2 ~,<1,2>
Command “~” put the device into device firmware service mode. To use this
command, it is mandatory to enable UART flow control. Command “~” expects one
input parameter.
If the input parameter is 1, DFU mode is set to be upgrade through UART. Message
“DFU” will be output and then RN4020 is waiting for DFU image through UART. User
then streams the signed Microchip RN4020 image to UART. If a terminal emulator is
used, it is recommended to use feature such as “send file” or something similar.