1.2.4 PIC32CZ CA70 Curiosity Ultra Development Board: Building and Running the OTA Bootloader Applications
Downloading and Building the Application
To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repo or download as zip file. This content can also be download using content manager by following these instructions.
Path of the application within the repository is apps/ble/external_memory/.
To build the application, refer to the following table and open the project using its IDE.
OTA Bootloader
| Project Name | Description |
|---|---|
| ota_bootloader/firmware/pic32cz_ca70_cult.X | MPLAB X Project for PIC32CZ CA70 Curiosity Ultra Development Board |
OTA Application
| Project Name | Description |
|---|---|
| ota_app/firmware/pic32cz_ca70_cult.X | MPLAB X Project for PIC32CZ CA70 Curiosity Ultra Development Board |
Setting Up PIC32CZ CA70 Curiosity Ultra Development Board
- To run the demo, the following additional hardware are required:
- Short J2-1 and J2-2 using jumper in the RNBD451 Add-on Board
- Insert RNBD451 Add-on Board into mikroBUS connector
- Connect the Debug USB port on the board to the computer using a micro USB cable
Setting up the host scripts
- Refer to the OTA Bootloader Host Script Help for settings up python scripts which are used in order to update the application binary image
Running the Application
- Open the OTA bootloader project ota_bootloader/firmware/pic32cz_ca70_cult.X in the IDE.
- Ensure that the ota_app/firmware/pic32cz_ca70_cult.X is added as a
loadable project to OTA bootloader application.
- As the external memory may not have any valid binary required by OTA bootloader for the first time. Adding the ota_app as loadable allows MPLAB X to create a unified hex file and program both these applications in their respective memory locations based on their linker script configurations.

- Open the Terminal application (e.g., Tera Term) on the computer.
- Connect to the Virtual COM port and configure the serial settings as follows:
- Baud: 115200
- Data: 8 Bits
- Parity: None
- Stop: 1 Bit
- Flow Control: None
- Build and program the OTA bootloader application using the IDE.
- Once programming is done, OTA
bootloader starts execution and directly jumps to application space to run the
OTA application.
- LED1 starts blinking indicating that the OTA application is running
- Observe the below message
on console

- Open the OTA application project ota_app/firmware/pic32cz_ca70_cult.X in the IDE.
- Update ota_app/firmware/src/app.c to update printf() message from
####### Application running ####### to ####### New Application
running ####### as below.

- Clean and Build the OTA application project to generate the binary (Do not program the binary).
- Go to the
<harmony3_path>/bootloader_apps_ota/apps/ble/external_memory/ota_app/firmware/pic32cz_ca70_cult.X/dist/pic32cz_ca70_cult/production/pic32cz_ca70_cult.X.production.bin
directory and open the command prompt to run the below
command.
python <harmony3_path>/bootloader_apps_ota/tools/ota_host_mcu_header.py -p 0x402000 -j 0x402000 -l 0x0 -f pic32cz_ca70_cult.X.production.bin
- This command adds OTA Host MCU Header to the application binary. If command executed successful then "image.bin is generated successfully" message display on the command prompt.
- Run the below
command.
python <harmony3_path>/bootloader_apps_ota/tools/ota_rnbd_header.py -f image.bin
- This command adds OTA RNBD Header to the image.bin and generates RNBD_image.bin application binary. If command executed successful then "RNBD_image.bin is generated successfully" message display on the command prompt.
- Refer to the Send application binary using MBD App to program RNBD_image.bin application binary to the target.
- Once Firmware Update is successful:
- LED1 still blinking indicating that the OTA application is running
- Observe the below message on console

- Repeat Steps 8-13.
- Observe LED1 still blinking
- Observe message printed on console
