ECSPI skipping a byte while sending data from slave to master

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

ECSPI skipping a byte while sending data from slave to master

1,355 次查看
harish_g
Contributor III

Hi ,

I am trying to communicate with two imx7d Sabre SD boards using ECSPI. The master board sent a "Hello World" and the slave in return sent a "Hello World" in the sample program. The slave is first allowed to fill its TXFIFO, after which master initiates the transactions. While the master sends all the bytes properly, the slave omits the first byte and starts to send data from the second byte onwards. I have attached the code which created this problem. Is there any specific reason, why this happens or is it something which is wrong with my code?  

Regards ,

G.Harish

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

1,131 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi harish,

how are you doing your testing? How do you know the slave is missing the first byte to send and not the master which is loosing the first byte when receiving?

0 项奖励
回复

1,131 次查看
harish_g
Contributor III

Hi Carlos,

              One of the methods i tried to debug was with a CRO by probing the MISO,MOSI and SCLK lines . What i saw was, during the first cycle ( i.e. First burst ), the slave also was sending a byte while the master was pushing its data into the slave. Also, the prints i used, proved that the byte which arrives first in the Master, arrives during the very first burst initiated by the master. So, using these two clues, i identified that the slave itself sends the second byte without sending the first byte.

Regards,

G.Harish

0 项奖励
回复

1,131 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi harish,

you can download FreeRTOS BSP for imx6sx and you will find there an ecspi driver demo that will be compatible with imx7d.


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复