flexio_spi_edma_lpspi_transfer_slave_dynamic#
Overview#
The flexio_spi_edma_lpspi_transfer_slave_dynamic example shows how to use flexio spi slave driver in edma way:
In this example, a flexio simulated slave connect to a lpspi master. The CS signal remains low during transfer, after master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Supported Boards#
EVKB-IMXRT1050
Hardware requirements
Mini/micro USB cable
EVKB-IMXRT1050 board
Personal Computer
Board settings
Remove the resistor R334 and weld 0Ω resistor to R278,R279,R280,R281.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J24-4 SIN SW5-3
SIN J24-5 SOUT SW5-2
SCK J24-6 SCK SW5-1
PCS0 J24-3 PCS0 SW5-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
MIMXRT1060-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKB board
Personal Computer
Board settings
Remove the resistor R305 and weld 0Ω resistor to R346,R350,R356,R362.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J17-4 SIN SW2-3
SIN J17-5 SOUT SW2-2
SCK J17-6 SCK SW2-1
PCS0 J17-3 PCS0 SW2-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
MIMXRT1170-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1170-EVKB board
Personal Computer
Board settings
Remove 0Ω resistor to R200,R406.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J10-10 SIN J26-6
SIN J10-8 SOUT J26-4
SCK J10-12 SCK J26-2
PCS0 J10-6 PCS0 J26-8
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
MIMXRT1060-EVKC
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKC board
Personal Computer
Board settings
Remove the resistor R305 and weld 0Ω resistor to R346,R350,R356,R362.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J17-4 SIN SW2-3
SIN J17-5 SOUT SW2-2
SCK J17-6 SCK SW2-1
PCS0 J17-3 PCS0 SW2-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
FRDM-IMXRT1152
Hardware requirements
Type-C USB cable
FRDM-IMXRT1152 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J11-10 SIN J44-1
SIN J11-8 SOUT J44-3
SCK J11-12 SCK J44-5
PCS0 J11-6 PCS0 J44-7
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
EVK-MIMXRT1010
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1010 board
Personal Computer
Board settings
Remove the resistor R90 and weld 0Ω resistor to R800. To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J57-8 SIN J26-6
SIN J57-10 SOUT J26-4
SCK J57-12 SCK J26-8
PCS0 J57-6 PCS0 J56-10
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1015
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1015 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-4 SIN J18-5
SIN J19-5 SOUT J18-6
SCK J19-6 SCK J18-3
PCS0 J19-3 PCS0 J18-1
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1020
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1020 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-4 SIN J18-5
SIN J19-5 SOUT J18-6
SCK J19-6 SCK J18-3
PCS0 J19-3 PCS0 J18-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1024-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1024-EVK board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J19-8 SIN J18-10
SIN J19-10 SOUT J18-12
SCK J19-12 SCK J18-6
PCS0 J19-6 PCS0 J18-8
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1040-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1040-EVK board
Personal Computer
Board settings
Weld 0Ω resistor to R346,R350,R356,R362.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J17-4 SIN SW2-3
SIN J17-5 SOUT SW2-2
SCK J17-6 SCK SW2-1
PCS0 J17-3 PCS0 SW2-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
EVK-MIMXRT1064
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1064 board
Personal Computer
Board settings
Remove the resistor R334 and weld 0Ω resistor to R278,R279,R280,R281.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J24-4 SIN SW5-3
SIN J24-5 SOUT SW5-2
SCK J24-6 SCK SW5-1
PCS0 J24-3 PCS0 SW5-4
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1160-EVK board
Personal Computer
Board settings
Remove 0Ω resistor to R200,R406,R408,R404.
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SOUT J10-10 SIN J26-6
SIN J10-8 SOUT J26-4
SCK J10-12 SCK J26-2
PCS0 J10-6 PCS0 J26-8
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SCK J44-12 SCK J41-2
SIN J44-10 SOUT J41-6
SOUT J44-8 SIN J41-4
PCS0 J44-6 PCS0 J41-8
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.
FRDM-IMXRT1186
Hardware requirements
Type-C USB cable
FRDM-IMXRT1186 board
Personal Computer
Board settings
To make the example work, connections needed to be as follows:
MASTER connect to SLAVE
Pin Name Board Location Pin Name Board Location
SCK J3-18 SCK J1-6
SIN J3-14 SOUT J1-10
SOUT J3-16 SIN J1-8
PCS0 J3-12 PCS0 J1-12
Prepare the Demo
Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA 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
You can see the similar message shows following in the terminal if the example runs successfully.
LPSPI Master interrupt - FLEXIO SPI Slave edma dynamic transfer example start.
This example use one lpspi instance as master and one flexio spi slave on one board.
Master uses interrupt and slave uses edma way.
Master transfers indefinite amount of data to slave, and the CS signal remains low during transfer.
After master finishes the transfer and re-asserts the CS signal, interrupt is triggered to let user know.
Slave must configure the transfer size larger than master's.
Please make sure you make the correct line connection. Basically, the connection is:
LPSPI_master -- FLEXIO_SPI_slave
CLK -- CLK
PCS -- PCS
SOUT -- SIN
SIN -- SOUT
Slave received 128 bytes of data
Slave received 128 bytes of data
LPSPI master <-> FLEXIO SPI slave transfer all data matched!
End of Example.