1.1.35 PIC32CK SG Curiosity Ultra Development Board: Building and Running the UART 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/uart_bootloader/
To build the application, refer to the following table and open the project using its IDE.
Bootloader Application
Project Name | Description |
---|---|
bootloader\pic32ck_sg01_trustzone\pic32ck_sg01_cult\pic32ck_sg01_cultgroup | MPLABX Project for PIC32CK SG Curiosity Ultra Development Board |
Test Application
Project Name | Description |
---|---|
test_app\pic32ck_sg01_cult_trustzone\pic32ck_sg01_cult\pic32ck_sg01_cultgroup | MPLABX Project for PIC32CK SG Curiosity Ultra Development Board |
Setting up PIC32CK SG Curiosity Ultra Development Board
- Connect the Debug USB port on the board to the computer using a micro USB cable
Setting up the host script
- Refer to Bootloader Host Script Help for setting up the btl_host.py utility used to send the application binary from host PC
Running the Application
Open the test application project bootloader\pic32ck_sg01_trustzone\pic32ck_sg01_cult\pic32ck_sg01_cultgroup in the IDE
Set pic32ck_sg01_cult.X as main project.
Build the project to generate the binary (Do not program the binary)
Copy the generated application binary file and save in different folder( Note: the bin file generated has no fuse bits)
- <harmony3_path>bootloader_apps_uart\apps\uart_bootloader\test_app\pic32ck_sg01_cult_trustzone\pic32ck_sg01_cult\pic32ck_sg01_cult.X\dist\default\production\pic32ck_sg01_cult.X.production.unified.bin
Set pic32ck_sg01_cult_secure.X as main project in the IDE and launch MCC.
Enable Fuse Bit and Regenerate the application
Build the project to generate the binary (Do not program the binary)
Run the btl_fuse_bin_gen.py from command prompt to generate fuse bits bin file
python <harmony3_path>\bootloader\tools\btl_fuse_bin_gen.py -d PIC32CK_GC01_SG01 -f <harmony3_path>\bootloader_apps_uart\apps\uart_bootloader\test_app\pic32ck_sg01_cult_trustzone\pic32ck_sg01_cult_secure\pic32ck_sg01_cult_secure.X\dist\default\production\pic32ck_sg01_cult_secure.X.production.hex -o devcfg.bin
Open the bootloader project bootloader\pic32ck_sg01_trustzone\pic32ck_sg01_cult_secure\pic32ck_sg01_cult_secure.X in the IDE
Build and program the application using the IDE
Once both file are generated devcg.bin and pic32ck_sg01_cult.X.production.unified.bin is ready Run below command to flash the bin file.
python <harmony3_path>/bootloader/tools/btl_host.py -v -i <COM_PORT> -d PIC32CK_GC01_SG01 -a 0xc000000 -f <folder_path>/pic32ck_sg01_cult.X.production.unified.bin -e 0xa000000 -g <folder_path>\devcfg.bin
If above step is successful then the LED0 should start blinking
Open the Terminal application (Ex.:Tera Term) on the computer
Configure the serial port settings as follows:
- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None
Reset or Power cycle the device
LED0 should start blinking and you should see below output on the console
Press and hold the Switch SW0 to trigger Bootloader from test application and you should see below output
If fuse bits are already programmed, to only update the application, use
python <harmony3_path>/bootloader/tools/btl_host.py -v -i <COM_PORT> -d PIC32CK_GC01_SG01 -a 0xc000000 -f <folder_path>/pic32ck_sg01_cult.X.production.unified.bin
To program the fuse bits, the device must first be erased using the IDE. After erasing, repeat steps 11 to 17.
Additional Steps (Optional)
- To bootload any other application refer to Configuring an application to be bootloaded for CORTEX-M based MCUs