spi register read and write in imx8m

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

spi register read and write in imx8m

4,140件の閲覧回数
prathap_ponnuch
Contributor I

Hi All,

We are using imx8m custom board. In this board we have ethernet switch connected through spi communication. Here we want how to read and write register through spi communication.

Spi device(spidev1.1) detected in hardware.

We saw some script in following location

https://github.com/rm-hull/spidev-test

In this link spidev_test.c file available.How to compile and run this spidev_test.c in imx8m? How to check and verify single byte read and write.

gcc compiler not available in imx8m.How to install this into it.

Thanks in advance.

 

Regards,

prathap

0 件の賞賛
返信
3 返答(返信)

4,123件の閲覧回数
AldoG
NXP TechSupport
NXP TechSupport

Hello,

You may refer to the following guide:
https://variwiki.com/index.php?title=DART-MX8M_SPI


Also, you can try with unit test mxc_spi_test1.out, please take a look to the i.MX Reference Manual section 10.3.1 Enhanced Configurable Serial Peripheral Interface (ECSPI).

Regards,
Aldo.

0 件の賞賛
返信

4,106件の閲覧回数
prathap_ponnuch
Contributor I

HI Aldo,

 

Thanks for replay.

we used cross compiler and generated executable file.

After generated this executable file copied to imx8m location and run the following commands

# ./spidev_test -v -D /dev/spidev0.0 

 

But it shows no such  file or directory: ./spidev_test -v -D /dev/spidev1.1

How to solve this?

Thanks in advance.

 

Regards,

prathap

0 件の賞賛
返信

4,076件の閲覧回数
AldoG
NXP TechSupport
NXP TechSupport

Hello,
 

you have to enable both i.MX SPI driver (CONFIG_SPI_IMX) and User mode SPI driver (CONFIG_SPI_SPIDEV) in your kernel configuration please double check, in menuconfig:

Device Drivers -> SPI support -> <*> Freescale i.MX SPI controllers
Device Drivers -> SPI support -> <*> User mode SPI device driver support
 

Also, make sure that you have added the spidev node to your dts

Thank you,
Best regards,
Aldo.

0 件の賞賛
返信