“IoT Made Easy!” – This application demonstrates the use of execute in place (XIP) using the WBZ351.
Devices: | PIC32CXBZ3 | WBZ35x |
Features: | BLE | XIP |
THE SOFTWARE ARE PROVIDED "AS IS" AND GIVE A PATH FOR SELF-SUPPORT AND SELF-MAINTENANCE. This repository contains example code intended to help accelerate client product development.
For additional Microchip repos, see: https://github.com/Microchip-MPLAB-Harmony
Checkout the Technical support portal to access our knowledge base, community forums or submit support ticket requests.
- 1. Introduction
- 2. Bill of materials
- 3. MPLAB X IDE Software Setup
- 4. Project Seutp
- 5. Application adaptions
- 6. Related links
This example application showcase outsourcing of dedicated functions to the external QSPI flash.
The central_trp_uart project served as the basis, with QSPI functionality subsequently integrated. The intended behavior of the software remain unaffected - see documentation of original source.
| TOOLS | QUANTITY |
|---|---|
| PIC32CX-BZ3 and WBZ35x Curiosity Board | 2 |
- MPLABX v6.20
- XC32 Compiler v4.40
- MPLAB® Code Configurator v5.5.1
- MCC core v5.7.1
- Harmony v1.3.2
- Content Manager v5.0.1
- PIC32CX-BZ3_DFP v1.2.183
- CMSIS v5.8.0
- MCC Harmony
- wireless_pic32cxbz_wbz version: v1.4.0
- csp version: v3.19.1
- core version: v3.13.4
- wireless_ble: v1.3.0
- dev_packs: v3.18.1
- CMSIS-FreeRTOS version: v10.5.1
Add defines for QSPI region
Add QSPI memory region
Add symbol at the end end of the flash. This symbol will be used for QSPI flash programming.
Add code of QSPI memory region. This code in internal flash region is used at application startup to program QSPI flash.

The QSPI interface allows the microcontroller to execute code directly from external flash memory. This is particularly useful when internal flash memory is limited or when larger applications need to be stored externally. However, executing code from external flash may introduce latency due to the slower access times compared to internal memory.
Running Interrupt Service Routines (ISRs) directly from external flash via QSPI is generally not recommended. ISRs require fast and predictable execution times, and the latency associated with accessing external flash may lead to missed interrupts.
Using the define QSPI_SECTION at function definition links the function to QSPI region, which is added in linker script, along with an copy of the code in flash region. The code of outsourced functions is written to QSPI flash at application startup in the application task. At function call the code will be executed directly from external flash memory.
List of functions outsourced to QSPI flash:
| function | start address | size (bytes) |
|---|---|---|
| void APP_BleStackEvtHandler(STACK_Event_T *p_stackEvt) | 0x04000000 | 164 |
| void APP_BleStackLogHandler(BT_SYS_LogEvent_T *p_logEvt) | 0x040000a4 | 20 |
| void APP_BleGapEvtHandler(BLE_GAP_Event_T *p_event) | 0x040000b8 | 328 |
| void APP_BleL2capEvtHandler(BLE_L2CAP_Event_T *p_event) | 0x04000200 | 66 |
| void APP_GattEvtHandler(GATT_Event_T *p_event) | 0x04000242 | 134 |
| void APP_BleSmpEvtHandler(BLE_SMP_Event_T *p_event) | 0x040002c8 | 82 |
| void APP_DmEvtHandler(BLE_DM_Event_T *p_event) | 0x0400031a | 74 |
| void APP_UartCBHandler() | 0x04000364 | 36 |
| ________ 904 |
The following steps have been added to setup external flash before serving main application tasks:
- reset flash
- enable QUAD I/O
- unlock flash
- verify JEDEC ID
- erase flash
- write memory
- read/verify memory



