6.4.2 Running the Application

  1. Mount the AVR128DB48 Curiosity Nano host board, the Serial Flash board and the RNWF02 Add On Board on Curiosity Nano base board at respective headers as illustrated in the following figure.
    Figure 6-23. Host Board Setup for OTA Demo
  2. Connect the debugger USB port on the AVR128DB48 Curiosity Nano board to computer using a micro USB cable
  3. Open the project and launch MCC with Melody Content Manager Tool
  4. Configure Home-AP credentials for STA mode, using the Wi-Fi settings configuration. For more details about the Wi-Fi settings configuration, See Figure 3-14
  5. Generate the code as illustrated below
    Figure 6-24. Generating the Code
  6. Build and program the code to the hardware using MPLAB X IDE
    Figure 6-25. Programming the Board
  7. Open the Terminal application (for example, Tera Term or PuTTY) on the PC
  8. Connect to the host board COM port and configure the serial settings as follows:
    1. Baud: 115200
    2. Data: 8 Bits
    3. Parity: None
    4. Stop: 1 Bit
    5. Flow Control: None
  9. Press the SW0 (Soft Reset) button on the host board, see Figure 6-1.
  10. The board boots up and connect to Home-AP, as per the configurations given in Step 4. After the successful Wi-Fi connection the device opens up a TCP tunnel and wait for the OTA server and firmware image details from the configurator tool.
    Figure 6-26. Initial Firmware Version, OTA Enable
  11. Three example sample firmware binaries are available in the ./ota_demo/tools folder.
    • From File explorer, navigate to the folder (./ota_demo/tools)
      Figure 6-27. Tools Folder
    • In the address bar, type cmd and hit enter
      Figure 6-28. CMD
    • This will open up a terminal window, located in this folder
      Figure 6-29. Terminal Window
    • Start an HTTP server, enter python -m http.server. By default it will be listening on port 8000
      Figure 6-30. python -m http.server
  12. Run the python OTA configurator tool from the ./ota_demo/tools folder, as illustrated in the following figure
    • From File explorer, navigate to the folder (./ota_demo/tools)
      Figure 6-31. Tools Folder
    • In the address bar, type cmd and hit enter
      Figure 6-32. CMD
    • This will open up a terminal window, located in this folder
      Figure 6-33. Terminal Window
    • Run the python OTA configurator by typing python mchp_configurator.py. Follow the instructions on the terminal, enter HTTP server IP, port and Image file name to be downloaded by RNWF.
      Note: Hit Enter when requested to enter IP and port and it will default to the computer IP and port 8000
      Figure 6-34. OTA Configurator
  13. Now the device creates a HTTP link with the OTA server and starts downloading the image file.
    Figure 6-35. Image Download
  14. After successfully downloading the image, the DFU is triggered and firmware is Flashed into the RNWF02 module
    Figure 6-36. DFU Progress
  15. Upon successful DFU, the host will Reset and print the RNWF02 module’s new firmware information
    Figure 6-37. Updated Firmware