Configuring QSPI

nRF5340 Product Specification

Before any data can be transferred to or from the external flash memory, the peripheral needs to be configured.

  1. Select the mandatory input/output pins in the following registers:
    For which pins to use, see Pin assignments. Only the dedicated QSPI pins shall be used.
  2. To ensure stable operation, set the GPIO drive strength to high drive. See the GPIO — General purpose input/output chapter for details on how to configure GPIO drive strength.
  3. Activate the dedicated peripheral setting of the GPIO pin. See the GPIO — General purpose input/output chapter for details on how to assign pins between cores, peripherals, or subsystems.
  4. Configure the interface towards the external flash memory using IFCONFIG0, IFCONFIG1, and ADDRCONF.
  5. Enable the QSPI peripheral and acquire I/O pins using ENABLE.
  6. Activate the external flash memory interface using the ACTIVATE task. The READY event will be generated when the interface has been activated and the external flash memory is ready for access.
Note:

If the IFCONFIG0 register is configured to use the quad mode, the external flash device also needs to be set in the quad mode before any data transfers can take place.

This can be done by sending custom instructions to the external flash device, as described in Sending custom instructions.