Transfer/ Receive n bytes & Synchronous Transmit via SPI

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

Transfer/ Receive n bytes & Synchronous Transmit via SPI

跳至解决方案
1,046 次查看
SuperBeginner
Contributor III

Dear NXP,

I have two questions regarding SPI communication development using MBDT:

  • How can I read or write n bytes (>2 bytes)?
    I have verified that 2-byte data transmission is working fine with the packet generator using the example project "s32k3xx_spi_async_interr_ebt".
    However, when I try to transmit 4 bytes of data (0xAA 0xAB), the EVB only receives the 0xAA data.
    I know this is quite normal, but I just want to provide an example to help you better understand my issue.
  • How do I develop synchronous transmit?
    I referenced the example "s32k344_spi_sync_master_ebt" and tried to start data transmission with LPSPI2, but it doesn’t work.
    I checked the status. "SPI_SetupEB" shows 0 and "SPI_SyncTransmit" shows 1.

    I have confirmed that my hardware connections are normal, as the asynchronous example project works correctly when programmed directly.
    SPI_async_mode.PNG

     

    SPI_async_mode_freemaster.PNG

Please help me. Thank you.

MBDT  S32K312EVB-Q172 

0 项奖励
回复
1 解答
959 次查看
Irina_Costachescu
NXP Employee
NXP Employee

Hi @SuperBeginner 

I would like to point you to the following thread, as a reference to a similar use case that was approached. Could you please check if the solution provided here is suitable for your use case? https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/SPI-configuration-MODEL-based-design-to...

Hope this helps,

Irina

在原帖中查看解决方案

0 项奖励
回复
3 回复数
971 次查看
SuperBeginner
Contributor III

Dear NXP,

Regarding the second question - "How do I develop synchronous transmit?", I found the answer myself.

I found this was an oversight on my part, I didn't enable SpiPhyUnitSync under the S32 Config tool.

SPI_Setting_1.PNG

SPI_Setting_2.PNG

This resulted in my SPI communication not functioning in synchronous mode.

But regarding the first question - "How can I read or write n bytes (>2 bytes)?", I still need your help.

I don't know who can help me.

Please forgive me for now tagging engineers who have helped me in the past.

Thank you.

@Irina_Costachescu  @dragostoma 

0 项奖励
回复
960 次查看
Irina_Costachescu
NXP Employee
NXP Employee

Hi @SuperBeginner 

I would like to point you to the following thread, as a reference to a similar use case that was approached. Could you please check if the solution provided here is suitable for your use case? https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/SPI-configuration-MODEL-based-design-to...

Hope this helps,

Irina

0 项奖励
回复
947 次查看
SuperBeginner
Contributor III

Hi @Irina_Costachescu ,

Thank you for your reply.

You solved my problem, thanks.

0 项奖励
回复