Skip to content

Latest commit

 

History

History
113 lines (58 loc) · 5.26 KB

GUID-91FF64BD-84D4-43A7-BD5B-9554B5C144C7.md

File metadata and controls

113 lines (58 loc) · 5.26 KB

Curiosity PIC32MZ EF 2.0 Development Board: Building and Running the File System based QSPI Flash Bootloader applications

Parent topic:FS QSPI Flash Bootloader

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/fs/qspi/

To build the application, refer to the following table and open the project using its IDE.

Bootloader Application

Project Name Description
bootloader/firmware/pic32mz_ef_curiosity_v2.X MPLABX Project for Curiosity PIC32MZ EF 2.0 Development Board

Programmer application

Project Name Description
app_programmer/firmware/pic32mz_ef_curiosity_v2.X MPLABX Project for Curiosity PIC32MZ EF 2.0 Development Board
  • To run the demo, the following additional hardware are required:

  • Install the microSD click on to the mikroBUS 1 Header of the device

  • For programming and UART Console, connect a micro USB cable to the USB Debug port J700

Running the Application

  1. Open the bootloader project bootloader/firmware/pic32mz_ef_curiosity_v2.X in the IDE

  2. Make sure that the app_programmer/firmware/pic32mz_ef_curiosity_v2.X is added as a loadable project to bootloader application

    • As the QSPI Flash memory may not have any valid binary required by bootloader for the first time, Adding the app_programmer 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

    mplab_loadable_pic32mz_ef_curiosity_v2

  3. Open the Terminal application (Ex.:Tera Term) on the computer to get programmer application messages through UART once loaded

  4. Configure the serial port settings as follows:

    • Baud : 115200

    • Data : 8 Bits

    • Parity : None

    • Stop : 1 Bit

    • Flow Control : None

  5. Build and program the bootloader application using the IDE

  6. Once programming is done bootloader starts execution and directly jumps to application space to run the programmer application

    • LED3 starts blinking indicating that the programmer application is running and you should see below output on the console

      fs_serial_mem_console_bootup

  7. Open the programmer application project app_programmer/firmware/pic32mz_ef_curiosity_v2.X in the IDE

  8. Update app_programmer/firmware/src/app_monitor.c to update printf message from Serial Memory to QSPI Flash Memory as below

    	printf("\r\n###### File System (QSPI Flash Memory) Programmer Application Running ######\r\n");
  9. Clean and Build the project to generate the binary (Do not program the binary)

  10. Copy the generated application binary file to a sdcard from the Host PC

    • <harmony3_path>/bootloader_apps_serial_memory/apps/fs/qspi/app_programmer/firmware/pic32mz_ef_curiosity_v2.X/dist/pic32mz_ef_curiosity_v2/production/pic32mz_ef_curiosity_v2.X.production.bin
  11. Rename the copied application binary file to image.bin

  12. Insert the sdcard with the application binary image.bin to the sdcard slot on the microSD click

  13. Following snapshot shows output of successfully copying the programmer application binary to QSPI Flash Memory

    • LED3 should still be blinking

      fs_serial_mem_console_copying_pic32mz

  14. Remove the sdcard from the sdcard slot

  15. Press and hold the Switch SW1 to trigger Bootloader from programmer application and you should see below output

    fs_serial_mem_console_trigger_pic32mz

  16. Once Firmware Update is successful LED3 should start blinking indicating updated programmer application running and you should see below output on the console

    fs_serial_mem_console_updated_pic32mz

Additional Steps (Optional)