6.1.4.2 Running the Application
- 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-24. Host Board Setup for OTA Demo - Connect the debugger USB port on the AVR128DB48 Curiosity Nano board to computer using a micro USB cable
- Open the project and launch MCC with Melody Content Manager Tool
- 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-16
- Generate the code as illustrated
below
Figure 6-25. Generating the Code - Build and program the code to the
hardware using MPLAB X IDE
Figure 6-26. Programming the Board - Open the Terminal application (for example, Tera Term or PuTTY) on the PC
- Connect to the host board COM
port and configure the serial settings as follows:
- Baud: 115200
- Data: 8 Bits
- Parity: None
- Stop: 1 Bit
- Flow Control: None
- Press the SW0 (Soft Reset) button on the host board, see Figure 6-1.
- 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-27. Initial Firmware Version, OTA Enable - 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-28. Tools Folder - In the address bar, type
cmd and hit enter
Figure 6-29. CMD - This will open up a
terminal window, located in this folder
Figure 6-30. Terminal Window - Start an HTTP server,
enter
python -m http.server
. By default it will be listening on port 8000Figure 6-31. python -m http.server
- From File explorer,
navigate to the folder (
- 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-32. Tools Folder - In the address bar, type cmd and hit enter
Figure 6-33. CMD - This will open up a terminal window, located in this folder
Figure 6-34. 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 8000Figure 6-35. OTA Configurator
- From File explorer, navigate to the folder
(
- Now the device creates a HTTP link with the OTA server and starts downloading
the image file.
Figure 6-36. Image Download - After successfully downloading
the image, the DFU is triggered and firmware is Flashed into the RNWF02 module
Figure 6-37. DFU Progress - Upon successful DFU, the host
will Reset and print the RNWF02 module’s new
firmware information
Figure 6-38. Updated Firmware