![NXP Semiconductors SLN-LOCAL2-IOT User Manual Download Page 64](http://html.mh-extra.com/html/nxp-semiconductors/sln-local2-iot/sln-local2-iot_user-manual_1721901064.webp)
9.4.1.6 Clean request
{
"messageType":1,
"fwupdate_message": {
"messageType":0,
"fwupdate_common_message": {
"messageType":2
}
}
}
9.4.1.7 Response format
{
"error": <Operation return code>,
}
9.5 Testing OTA/OTW updates
To demonstrate the OTA and OTW updates, use the Python test script in sln_local2_iot_bootloader/unit_tests/fwupdate_client.py.
From a high-level perspective, this script “JSONifyes” a specified binary and flashes it either via the OTA or OTW mechanism,
depending on the update method specified as an argument to the script. This method allows you to flash the main app binary
without a J-Link. NXP provides OTA/OTW update tools which are currently intended as a unit test. These tools are not intended
to be used for production environment in the current release.
While the use of OTA and OTW is nearly identical, the setup is slightly different between the two, because the OTA update requires
a network connection and the OTW update requires a serial connection.
9.5.1 OTA setup
This section describes the steps necessary to perform an OTA update. To perform an OTA update using the test script, the
SLN-LOCAL2-IOT kit must be connected to a Wi-Fi network and the proper bit in the FICA table must be set to indicate to the
bootloader that an OTA update is being expected. The update bit is set by the test script. A TCP server is running in the main
application and waits for a JSON sent by the script to set the FICA bit.
The SLN-LOCAL2-IOT kit and the client running the Python script must be on the same network for the OTA to work.
Connecting to a Wi-Fi network:
• Connect the board to the computer via the USB Type C port.
• Open your favorite serial monitor and connect to the board COM using the 115200 baud rate.
• In the serial monitor, type the following command: “setup
SSID PASSWORD
”.
• The board will reset and then it will try to connect to the Wi-Fi network.
• If the connection is successful, the IP adress of the board is displayed in the serial monitor. Write it down.
9.5.2 OTW setup
To perform an OTW update using the test script, the SLN-LOCAL2-IOT must be connected via UART and the proper bit in the FICA
table must be set to indicate to the bootloader that an OTW update is being expected. The update bit is set by the
“updateotw”
command in the shell.
Note that the USB CDC is already connected to the kit and supplying power as well as the serial communication. To run the OTW
via UART, it requires an additional UART module connected to header J26 on the kit. Make sure that TX, RX, Vcc, and GND are
connected properly. The schematic of header J26 is shown in
NXP Semiconductors
Bootloader
SLN-LOCAL2-IOT Developer’s Guide, Rev. 0, 19 April 2021
User's Guide
64 / 87