To build this application, open the project file (apps/ota_demo/firmware/ota_demo_sam_e54_xpro_rnwf02.X
) in MPLAB X IDE. For more details on opening the project file in MPLAB X IDE, refer to the Opening the Project file. The following table provides details on the project file.
Project Name | Description |
---|---|
ota_demo_sam_e54_xpro_rnwf02.X |
MPLAB X project for SAM E54 Xplained Pro evaluation kit and RNWF02 Add On Board |
|
- This OTA DFU application demonstrates the RNWF02 Firmware Upgrade mechanism through the HTTP/HTTPS protocol.
-
Mount the Serial Flash and RNWF02 Add On Board on the mikroBUS Xplained pro extension boards. Connect the RNWF02 connected mikroBUS Xplained pro extension board to the EXTENSION 1 HEADER and Serial Flash connected extension board to EXTENSION 2 HEADER of SAM E54 Xplained Pro evaluation kit as illustrated in the following figure.
-
Connect the debugger USB port on the SAM E54 Xplained Pro evaluation kit to computer using a micro USB cable
-
Open the project and launch MCC (Microchip Code Configurator).
-
Configure Home-AP credentials for STA mode, using the Wi-Fi settings configuration. For more details about the Wi-Fi settings configuration, See Figure 1
Note: Configure chip-select (CE) for SPI Flash as illustrated in pin settings as shown below
-
Generate the code as illustrated below.
-
Build and program the code to the hardware using MPLAB X IDE
-
Open the Terminal application (for example, Tera Term or PuTTY) on the PC
-
Connect to the host board "EDBG Virtual COM Port" and configure the serial settings as follows:
- Baud: 115200
- Data: 8 Bits
- Parity: None
- Stop: 1 Bit
- Flow Control: None
-
Press the Reset button on the host board, see Figure 1
-
The board boots up and connects 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.
-
Two example sample firmware binaries are available in the
./ota_demo/tools
folder, start a python HTTP server using the following command. -
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
) -
In the address bar, type cmd and hit enter
-
This will open up a terminal window, located in this folder
-
Run the python OTA configurator by typing
python mchp_configurator.py
. Follow the instructions on the terminal, enter http server IP, port and filename image you want the RNWF to download.Note: Hit Enter when requested to enter IP and port and it will default to the computer IP and port 8000
-
-
Now the device creates a HTTP link with the OTA server and starts downloading the image file.
-
After successfully downloading the image, the DFU is triggered and firmware is Flashed into the RNWF02 module
-
Upon successful DFU, the host will Reset and print the RNWF02 module’s new firmware information