6.4.1 Building and Running the OTA Demo Application

Building the Application

To build the application, perform the following steps:
  1. Open the project file (apps/wifi/ota_wincs02_demo/ota_pic32wm_bw1_curiosity.X) in MPLAB® X IDE.
  2. For more details on opening the project file in MPLAB X IDE, refer to the Opening, Building and Programming the Existing Application section of the WINCS02 Application Developer’s Guide in the Reference Documentation from Related Links.
Table 6-7. Project File Details
Project NameDescription
ota_pic32wm_bw1_curiosity.x
  • MPLAB X project for the PIC32WM-BW1 device.
  • This WINCS02 built-in OTA application demonstrates the WINCS02 firmware upgrade mechanism using Wi-Fi® interface.

Running the Application

The following steps describe how to run the OTA demo application for the WINCS02 firmware update on the PIC32WM-BW1 Curiosity Board, using the project built from the ota_pic32wm_bw1_curiosity.x:
  1. Connect the USB Type-C® cable to supply power to the PIC32WM-BW1 Curiosity Board.
  2. Open the project and launch MCC Harmony3.
  3. Configure the Home-AP credentials for the STA mode and set the SNTP IP address using the WINCS02 Wi-Fi® configuration options.
    • Ensure that the access point is connected to the internet.
    • For more details on Wi-Fi settings, refer to the Wi-Fi Service section of the WINCS02 Application Developer’s Guide in the Reference Documentation from Related Links.
  4. Update the certificates, server IP address and port number (obtained during server setup) in the net service socket configuration. See OTA Server Setup from Related Links. For more details on net socket service configuration, refer to the Net Socket Service section of the WINCS02 Application Developer’s Guide in the Reference Documentation from Related Links.
  5. Configure the OTA Server Socket, File Name and OTA Time Out in OTA System service.
  6. Follow the certificate creation steps for server and client certificate, refer to the Generating Certificates from Related Links.
  7. The user can generate the code as illustrated in the following figure.
    1. Click Generate to generate the code.
      Figure 6-104. Code Generation
  8. Build and program the code to the hardware using MPLAB X IDE.
    Figure 6-105. Make and Program Device Main Project