WICED supports OTA(Over-The-Air) updates for distribution of software updates. This allows firmware upgrades when needed without requiring physical access, saving time and resources.
The ota_fr application in the apps/snip directory demonstrates how to use WICED multi-application support to perform factory reset and OTA upgrade. The following steps assume you have a BCM943362WCD4 WICED evaluation board (a BCM943362WCD4 WICED module on a WICED evaluation board). If your board is different, substitute BCM943362WCD4 for your platform name.
*This process was also verified and tested on the Avnet BCM94343W_AVN BCM4343W based development kit.
- WICED OTA Upgrade
- Factory Reset process
Prepare the WICED evaluation board for OTA upgrade
1. Build the snip.ota_fr application to function as your factory reset and OTA application
2. Notice that the factory reset application (FR_APP) is set in <WICED-SDK>/apps/snip/ota_fr/ota_fr.mk to point to the snip.ota_fr application elf file.
3. Run the following make target to download your production and factory reset applications to the board:
make snip.ota_fr-BCM943362WCD4 download download_apps run
On the terminal (putty / CoolTerm) it should show as following.
If you are using Linux or OSX you might get the following error.
Downloading Bootloader ...
make: *** [main_app] Segmentation fault: 11
No changes detected
In this case you should copy the make file over to the following location from your built-in make file. For the OSX, you might have to install Xcode and then copy the make file.
- Linux 32bit: /tools/common/Linux32
- Linux 64bit: /tools/common/Linux64
- OSX: /tools/common/OSX
4. Build an application that will upgrade the current application.
For this example we will build the snip.scan application:
Upgrade the application running on the WICED evaluation board
After carefully completing the above steps, the WICED evaluation board is ready to for an OTA upgrade.
'Loading OTA upgrade app' log message is displayed in the terminal when the OTA upgrade application is ready.
Work through the following steps:
1. Using the Wi-Fi connection manager on your computer, search for, and connect to the Wi-Fi AP called : Wiced Device
The AP name and passphrase is defined in /include/default_wifi_config_dct.h file. The default passphrase in SDK 3.1.2 is WICED_PASSPHRASE.
/* This is the soft AP available for normal operation (if used)*/
#define SOFT_AP_SSID "WICED Device"
#define SOFT_AP_CHANNEL 1
#define SOFT_AP_SECURITY WICED_SECURITY_WPA2_AES_PSK
#define SOFT_AP_PASSPHRASE "WICED_PASSPHRASE"
2. Open a web browser and enter the IP address of the eval board: 192.168.10.1 (default)
After a short period, the WICED Webserver OTA Upgrade webpage will appear.
3. Click 'Choose File' and navigate to the file
(this is the snip.scan application binary file that was created in step 2 above)
4. Click 'Open' (the dialogue box disappears)
5. Click 'Start upgrade' to begin the upgrade process
- The progress bar within the webpage indicates the upgrade progress
- The webpage displays 'Transfer completed, WICED device is rebooting now' when the process completes
6. With the upgrade complete, the snip.scan application runs and Wi-Fi scan results are regularly printed to the terminal
Perform factory reset on the WICED evaluation board
1. Push and hold the SW1 button THEN momentarily press and release the Reset button.
The D1 LED flashes quickly to indicate factory reset will occur *IF* SW1 is held for a further 5 seconds. Continue to hold SW1.
2. After the copy process is complete, the WICED evaluation board reboots and runs the factory reset (OTA_FR) application. Observe the log messages at the terminal to confirm the factory reset is completed successfully.
WICED Multi-Application Support
As of WICED-SDK 3.1.1, WICED Application Framework (WAF) supports loading and storing of multiple application binaries in the external serial flash. Up to 8 binaries are supported. The first five binaries are reserved for internal usage and the last three binaries are free for users to use. The binaries are organized as follows:
- Factory reset application (FR_APP)
- DCT backup image (DCT_IMAGE)
- OTA upgrade application (OTA_APP)
- Resources file system (FILESYSTEM_IMAGE)
- WIFI firmware (WIFI_FIRMWARE)
- Application 0 (APP0)
- Application 1 (APP1)
- Application 2 (APP2)