The QSPI peripheral can work in two modes. In the first mode, you can just access the memory with functions like read, write, and erase. The other mode is XiP (eXecution in Place). In this mode, your QSPI memory is cast to an MCU unified address space to address 0x12000000.
This getting started guide describes how to configure a QSPI device, program it, and start the Blinky application.
You must first test the setup of your toolchain. To do so, compile, program, and run a very simple example that does not use a SoftDevice, for example the Blinky SysTick Example.
Use the PCA10056 board in version 0.10.0 or higher.
Make sure that you have all the required tools installed and that the board is connected to your computer. See Setting up the development kit (for nRF52840) or Setting up the development kit (for nRF52832) for more information.
This procedure requires programming your development kit with two examples. You must download the Blinky application to the QSPI memory and the main memory must be programmed with the bootloader application.
pca10056_qspi\blank\armgcc
directory.Alternatively, you can compile the application using make
and use the nrfjprog tool to program the device:
After completing these steps, LEDs will be blinking on your development kit. In case of problems, see Troubleshooting.
Note that code is executed from QSPI memory a few times slower than the code executed from internal flash. Therefore, avoid using frequency-related solutions in code, for example nrf_delay functions.
Move the flash in your application linker script to adress 0x12000000. To do this in GCC projects, complete these steps:
*
.ld file.A Keil project must be reconfigured in project options. Then, the HEX file must be programmed and verified using the command from section Procedure. Keil does not navitely support programming of a QSPI memory device.
An IAR project must be reconfigured in project options, as shown below. Then, the output HEX file must be programmed and verified using the command from section Procedure. IAR does not navitely support programming of a QSPI memory device.
Bootloader is an important part of the QSPI XiP solution. It configures the QSPI peripheral, the memory device, and jumps to the 0x12000000 address. To create your own bootloader, you can use the QSPI bootloader Example as a reference design.
QspiDefault.ini
in the nrfjprog installation directory or prepare your own one.QspiDefault.ini
file in the nrfjprog installation directory(or prepare your own one) and use a safer configuration. For example: sdk_config
file. Find QSPI_CONFIG_FREQUENCY
and set it to 15.