Transfer/ Receive n bytes & Synchronous Transmit via SPI

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

Transfer/ Receive n bytes & Synchronous Transmit via SPI

ソリューションへジャンプ
1,090件の閲覧回数
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 解決策
1,003件の閲覧回数
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 返答(返信)
1,015件の閲覧回数
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 件の賞賛
返信
1,004件の閲覧回数
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 件の賞賛
返信
991件の閲覧回数
SuperBeginner
Contributor III

Hi @Irina_Costachescu ,

Thank you for your reply.

You solved my problem, thanks.

0 件の賞賛
返信