imx7d how to transfer 32-bit data at a time

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

imx7d how to transfer 32-bit data at a time

2,528 次查看
864535720
Contributor II

Hello everyone
my development board is IMX7DSABRE. Linux kernel version is 4.9.88
When I use SPI to transfer data on imx7d, my imx7d is the master device and my module is the slave device. My module receives 32bit data at a time. The driver I use is driver/spi/spidev.c. The test program I use is tools/spi/spidev_test.c.
If I transmit 8bit data each time, then there will be no problem, but if I transmit 32bit data each time, the program prompts: can't send spi message: Invalid argument
How can I transfer 32-bit data at a time.
By the way, I have achieved 16-bit half-duplex transmission through the read and write functions. But our SPI must work in full-duplex mode, that is, to use the spidev_message function area to transfer data.
Excuse me, how should I solve the problem I am facing now?

标签 (4)
0 项奖励
回复
3 回复数

2,459 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Qidong,

See below, please!

----------------------------

1.The communication mode of SPI is originally full-duplex communication.

2. SPI allows 8bit and 16bit data transmission.

3. If you use 8bit mode, you need to send 4 times in a loop to achieve the purpose of transmitting 32bit data.

-----------------------------

Hope the information is helpful to you.

Have a nice day!

B.R,

Weidong

2,459 次查看
864535720
Contributor II

孙哥,你好。因为外设模块的特殊性,需要一次性传输32位。后面我通过参考driver / spi / spidev.c里面的代码,实现了一次传输32位的功能。可能还存在一些小的问题。后面我解决不了了再来请教你。

0 项奖励
回复

2,459 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

你客气了,谈不上请教,一起讨论!

Weidong

0 项奖励
回复