spi register read and write in imx8m

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

spi register read and write in imx8m

4,134 次查看
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,117 次查看
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,100 次查看
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,070 次查看
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 项奖励
回复