lpspi_qspi_flash#
Overview#
This example shows how to use LPSPI to control the QSPI flash, such as erasing, programing, reading.
Accessing the QSPI flash requires using the CS continuous mode. To enable this mode with LPSPI, dynamic adjustment of the TCR[CONT] and TCR[CONTC] is necessary at specific timing during the data transfer. For example, TCR[CONT]=1 at the first frame, TCR[CONTC]=1 at frame boundaries, and TCR[CONT]=0 for the final frame. To simplify control flow, this project does not use LPSPI’s CS continuous mode. Instead, it manages the CS signal via GPIO in coordination with LPSPI.
When the project run finished, you can see the pass or fail information from the terminal.
Supported Boards#
FRDM-MCXN236
Hardware requirements
Type-C USB cable
FRDM-MCXN236 board
Personal Computer
Board settings
No special settings required.
Prepare the Demo
Connect a mini USB cable between the PC host and the MCU-Link USB port on the board.
Open a serial terminal on PC for MCU-Link serial device with these 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
The project status and result are shown in the terminal.