Difference between revisions of "UCM-iMX95 Yocto Linux: SPI"

From Compulab Mediawiki
Jump to: navigation, search
(Created page with " = SPI = SPI interface is available on header '''P15'''. The following example shows the usage of the Linux...")
 
 
Line 14: Line 14:
 
</pre>
 
</pre>
  
* System board setup:<br>short P15.3(MOSI) and  P15.2(MISO) pins.
+
* System board setup:<br>short '''P15.3 (MOSI)''' and  '''P15.2 (MISO)''' pins.
  
 
* Linux command line test:
 
* Linux command line test:

Latest revision as of 15:57, 9 January 2025

SPI

SPI interface is available on header P15. The following example shows the usage of the Linux spidev interface as a loopback:

spidev

  • Device Tree:
&lpspi7 {
...
	status = "okay";
...
};
  • System board setup:
    short P15.3 (MOSI) and P15.2 (MISO) pins.
  • Linux command line test:
./spidev_test -v -D /dev/spidev0.0 -p "hello"

You should see RX same as TX.

spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |hello|
RX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  |hello|