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.
Figure 8-39. Firmware Update using MBD Block Diagram

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
    Figure 8-40. Installing Microchip Bluetooth Data App
To establish the connection between the RNBD451 and MBD application, perform the following steps:
  1. Power ON the RNBD451 module by connecting the RNBD451 evaluation board using a micro-USB cable to the host PC.
  2. Open the terminal emulator software. In this scenario, it is Tera Term.
  3. Configure the serial port settings (see the following figure).
    Figure 8-41. Serial Terminal Recommended Settings
    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.
  4. 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).
      Figure 8-42. Microchip Bluetooth Data Interface
    • Tap the MBD icon (see the following figure). After launching the MBD application, the OTAU file is copied to the MBD inbox folder.
      Figure 8-43. Save Firmware to MBD
  5. Turn on mobile Bluetooth and open the MBD application.
    Figure 8-44. Microchip Bluetooth Data App Interface
  6. 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.
  7. Tap OTA DFU in the MBD application.
  8. Select the RNBD451_XXXX from the scan list (XXXX means the last two bytes of the device BD address).
    Figure 8-45. Microchip Bluetooth Data OTA DFU Interface
  9. The central device (mobile application) now gets connected with the device and connection-related logs are visible on the terminal emulator software (Tera Term).
    Figure 8-46. RNBD451 Device Connection Log in Serial Terminal
  10. Put the device into Command mode by issuing the $$$ command.
  11. Enable the Echo mode by issuing the + command.
    Figure 8-47. RNBD451 Device Configured in Command Mode
  12. Tap Select Image to choose the available firmware file. The OTAU firmware image file copied in step 4 is visible on the screen.
    Figure 8-48. Microchip Bluetooth Data OTA DFU Firmware Image Selection
    Upon selecting the image shown above, the below selection displays.
    Figure 8-49. Microchip Bluetooth Data App OTA DFU Browse Firmware Image
  13. After selecting the bin file, the %OTA_REQ% event is displayed in the terminal emulator software.
    Figure 8-50. OTA Firmware Update Request
  14. In the previous step, the %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.

    Send 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.
    Figure 8-51. Microchip Bluetooth Data OTA DFU Firmware Update Error
    Figure 8-52. OTA Firmware Update Request Approval
  15. After confirmation of the firmware version, click OK to continue.
    Figure 8-53. Microchip Bluetooth Data DFU OTA Firmware Version Confirmation
  16. 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
  17. 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
  18. The mobile application displays the confirmation about the successful OTA update, OTA update successfully.
    Figure 8-57. MBD OTA DFU Firmware Update Complete
  19. 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.
    1. Enter the Command mode by issuing the $$$ command.

    2. Enable the Echo mode by issuing the + command.

    3. Type the V command to get the current firmware version of the device.
      Figure 8-58. Updated Firmware Version Check: Serial Terminal