xspi_quad_edma_transfer#
Overview#
The xspi_quad_edma_transfer example shows how to use the XSPI driver with EDMA to access a Quad SPI NOR flash device in QPI SDR (4-4-4) mode.
In this example, XSPI will send data and operate the external Quad NOR flash connected with XSPI. The flash is first configured into QPI 4-4-4 mode, then the following operations are performed:
Sector Erase (4KB)
Page Program (4-4-4) via EDMA
EDMA Read and verify (4-4-4)
AHB Read and verify (4-4-4)
After all tests complete, the flash is reset back to standard SPI mode.
Expected output#
XSPI QPI SDR (4-4-4) EDMA example started!
4-byte address mode entered.
QPI (4-4-4) mode enabled.
Flash vendor ID: 0xEF
Erasing Serial NOR over XSPI...
Erase done.
Erase verify (EDMA read) - OK.
Page program done.
==> EDMA program+read: PASS.
==> AHB program+read: PASS.
XSPI QPI SDR (4-4-4) EDMA example finished.
Flash reset to default SPI mode.
Supported Boards#
FRDM-IMXRT700
Hardware requirements
Mini/micro USB cable
FRDM-IMXRT700 board
Personal Computer
Board settings
No special settings are required. XSPI0 is used, which connects to the on-board W25Q25PWZEIM Quad SPI NOR flash (32MB). EDMA (DMA0, channels 0/1) is used for page program transfers.
The flash-ops object (xspi_quad_flash_edma_ops.c) and the XSPI/EDMA driver objects are
placed in SRAM by the custom linker scripts so that erase/program operations do not stall
instruction fetch from the same flash.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see similar output in the terminal:
XSPI QPI SDR (4-4-4) EDMA example started!
4-byte address mode entered.
QPI (4-4-4) mode enabled.
Flash vendor ID: 0xEF
Erasing Serial NOR over XSPI...
Erase done.
Erase verify (EDMA read) - OK.
Page program done.
==> EDMA program+read: PASS.
==> AHB program+read: PASS.
XSPI QPI SDR (4-4-4) EDMA example finished.
Flash reset to default SPI mode.