6.2.5.2.2 Running the Application
- Mount the RNWF11 Add On Board on SAME54 Xplained Pro Evaluation Kit at respective header. For more details about the boards placement, refer Figure 6-37.
- Connect the debugger USB port on the SAME54 Xplained Pro evaluation kit to computer using a micro USB cable.
- Change the configuration. There are two options
to change the configuration:
- Option 1: Change the configuration
manually in the code.
- Open the code in MPLAB IDE v6.00 or
higher and add Home AP and device information in the application code.
- In
configuration.h
, add Wi-Fi configurations inSYS_RNWF_WIFI_STA_SSID
,SYS_RNWF_WIFI_STA_PWD
,SYS_RNWF_STA_SECURITY
. - TBD.
- In
- Open the code in MPLAB IDE v6.00 or
higher and add Home AP and device information in the application code.
- Option 2: Change the configuration via
MCC.
- For more details about Wi-Fi
configurations, refer Figure 3-31.
- The following fields can be
configured via MCC Wi-Fi settings:
- SSID
- Security Type
- Passphrase
- The following fields can be
configured via MCC Wi-Fi settings:
- Refer Figure 3-47 to understand how to make OTA configuration changes.
- The following fields can be
configured via MCC OTA configuration settings:
- OTA Tunnel Port
- The following fields can be
configured via MCC OTA configuration settings:
- For more details about Wi-Fi
configurations, refer Figure 3-31.
- Option 1: Change the configuration
manually in the code.
- Save the changes and then build and program the project.
- Connect to the “USB to UART” COM port and
configure the serial settings as follows:
- Baud – 115200
- Data – 8 Bits
- Parity – None
- Stop – 1 Bit
- Flow Control – None
- The board boots up and connects to Home-AP,
as per the configurations given in step 3. 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. In the first boot up, the device read the RNWF11 module firmware image and copies it to the SPI flash factory image
partition as the SPI flash partitions are empty. SPI flash memory have three partitions:
- Factory image partition
- 1st image partition
- 2nd image partition
These partition images are used for fail-safe recovery mechanism. In case the OTA firmware upgrade fails and corrupts RNWF11 program flash, the images stored in these partitions can be used for recovery. The fail-safe mechanism is implemented inrnwf_app.c
Note: The RN firmware image is copied to the SPI flash factory partition in the first boot as the SPI flash partition is empty. If the user wants to re-initialize the SPI flash and copy the RN firmware to factory partition again, user can press and hold PB2 button for 10 second on the AVR128DB48 Curiosity Nano host board to erase the SPI flash. - Two example sample firmware binaries are
available in the
./ota_demo/tools
folder.Following are two image types:at_cmd_app_rtos.X.production.ota.bin
– the image which contain the default FLFS contents. The FLFS contents include the certificates and keys for secure connection.at_cmd_app_rtos.X.production.without_flfs.ota.bin
– the image which do not contain the FLFS contents. This image is used when the user prefer to retain the FLFS contents after DFU is performed.
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. - 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 RNWF11 module.
- Upon successful DFU, the host will Reset and print the RNWF11 module’s new firmware information.