MCUXpresso SDK Documentation

xspi_quad_polling_transfer

xspi_quad_polling_transfer#

Overview#

The xspi_quad_polling_transfer example shows how to use the XSPI driver with polling to access a Quad SPI NOR flash device. In this example, XSPI will send data and operate the external Quad NOR flash connected with XSPI. The flash is configured for quad transfers, then the following operations are performed at multiple transfer sizes (64, 128, 256 bytes):

  • Sector Erase (4KB)

  • Page Program

  • IP Read and verify

  • AHB Read and verify

After all tests complete, the flash is reset back to standard SPI mode.

Expected output#

XSPI Quad I/O polling example started!
4-byte address mode entered.
Quad I/O mode enabled.
Flash vendor ID: 0xEF

--- Test: 64 bytes ---
  IP read verify: PASS
  AHB read verify: PASS

--- Test: 128 bytes ---
  IP read verify: PASS
  AHB read verify: PASS

--- Test: 256 bytes ---
  IP read verify: PASS
  AHB read verify: PASS

--- Test: 512 bytes ---
  IP read verify: PASS
  AHB read verify: PASS

XSPI Quad I/O polling 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).

The flash-ops object (xspi_quad_flash_ops.c) and the XSPI driver object 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
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. 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) polling example started!
4-byte address mode entered.
QPI (4-4-4) mode enabled.
Flash vendor ID: 0xEF

--- Test size: 64 bytes ---
  IP read: PASS
  AHB read: PASS

--- Test size: 128 bytes ---
  IP read: PASS
  AHB read: PASS

--- Test size: 256 bytes ---
  IP read: PASS
  AHB read: PASS

XSPI QPI SDR (4-4-4) polling example finished.
Flash reset to default SPI mode.