8.4 Firmware Upgrade Using Mobile App (MBD)
To perform the OTAU, the firmware bin image stored in the mobile phone is updated to the RNBD451 device via OTA. The OTAU bin file needs to be transferred to the mobile phone via email and then added to the Microchip Bluetooth Data (MBD) application. The method to transfer the bin file is the same for Android and iPhone. The RNBD451 connected to serial emulator software through a UART-to-USB convertor reports the serial logs from the device.
Prerequisites
- Host PC supporting virtual serial port
- Terminal Emulator Application – TeraTerm or CoolTerm is recommended
- Microchip Bluetooth Data App for iOS or Android – Available on AppStore (for iOS) or Google Play Store (Android)
- Pre-programmed RNBD451 module
To establish the connection between the RNBD451 and MBD application, perform the following steps:
- Power ON the RNBD451 module by connecting the RNBD451 evaluation board using a micro-USB cable to the host PC.
- Open the terminal emulator software. In this scenario, it is Tera Term.
- Configure the serial port settings (see the following figure). Note: By default, the RNBD451 device is programmed to operate in 115200 baud rate. Configure the same in the terminal emulator software for effective communication.
- Transfer the OTAU bin file to the iPhone.Note: This document for the OTA update procedure refers to iPhone only. For Android mobile, follow the same procedure.
iPhone
Copy the OTAU file to MBD by email.- Send the OTAU bin file to the personal email account via email.
- Open the attached OTAU file.
- Tap the share icon (see the following figure).
- Tap the MBD icon (see the following figure). After launching the MBD application, the OTAU file is copied to the MBD inbox folder.
- Turn on mobile Bluetooth and open the MBD application.
- By default, the RNBD451 is programmed to behave in Data mode, where the device advertises during power-up. The device that advertises the Bluetooth Low Energy packets are called peripheral devices. Each peripheral device has a unique advertising name. The mobile acts as a Bluetooth Low Energy central device, scans the surrounding Bluetooth Low Energy advertisements and lists all the available devices in the scan list.
- Tap OTA DFU in the MBD application.
- Select the RNBD451_XXXX from the scan list (XXXX means the last two bytes of the device BD address).
- The central device (mobile application) now gets connected with the device and connection-related logs are visible on the terminal emulator software (Tera Term).
- Put the device into Command mode by issuing the
$$$
command. - Enable the Echo mode by issuing the
+
command. - Tap Select Image to choose the available firmware file. The OTAU firmware image file copied in step 4 is visible on the screen. Upon selecting the image shown above, the below selection displays.
- After selecting the bin file, the
%OTA_REQ%
event is displayed in the terminal emulator software. In the previous step, the
Send%OTA_REQ%
request is initiated to the host, and it waits for its approval. The host can either accept (OTAA,01
) or reject (OTAA,00
) the request. If the RNBD451 connected to the host MCU, this acceptance has to be done by the host MCU. Otherwise, OTAU will be terminated.OTAA,01
to allow DFU and make the decision within 30 seconds. If a timeout occurs, the RNBD451 automatically rejects the DFU. If a rejection occurs, the command error and result code displays on the MBD application. The following figure illustrates the MBD OTA DFU firmware update error.- After confirmation of the firmware version, click OK to continue.
Figure 8-53. Microchip Bluetooth Data DFU OTA Firmware Version Confirmation - The firmware update is initiated and
%OTA_UPDATING,XX%
is displayed in the serial emulator, which represents the procedure progressing status.Figure 8-54. Firmware Update in Progress: Serial Terminal View Figure 8-55. Firmware Update in Progress: MBD OTA DFU View - After completing the transmission, the RNBD451 performs validation automatically, then follows the validation result. If validation is successful, the system reboots automatically.
Figure 8-56. Firmware Validation Complete - The mobile application displays the confirmation about the successful OTA update, OTA update successfully.
Figure 8-57. MBD OTA DFU Firmware Update Complete - The user must verify and confirm the firmware update is successful at the device side. After the completion of the OTAU, the device automatically reboots.
Enter the Command mode by issuing the
$$$
command.Enable the Echo mode by issuing the
+
command.- Type the
V
command to get the current firmware version of the device.Figure 8-58. Updated Firmware Version Check: Serial Terminal