Skip to content

Latest commit

 

History

History
128 lines (102 loc) · 6.96 KB

File metadata and controls

128 lines (102 loc) · 6.96 KB

central_trp_uart_fct

Back to Main page

“IoT Made Easy!” – This application demonstrates the use of execute in place (XIP) using the WBZ351.

Devices: | PIC32CXBZ3 | WBZ35x |
Features: | BLE | XIP |

⚠ Disclaimer

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.

Contents

1. Introduction

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.

2. Bill of materials

TOOLS QUANTITY
PIC32CX-BZ3 and WBZ35x Curiosity Board 2

3. MPLAB X IDE Software Setup

  • 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

4. Project Seutp

4.1 Pin configuration

4.2 System configuration (CFGCON1)

4.3 QSPI configuration

4.4 MPU configuration

4.5 Linker script customization

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.

5. Application adaptions

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

6. Related links





Back to top