Transfer/ Receive n bytes & Synchronous Transmit via SPI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transfer/ Receive n bytes & Synchronous Transmit via SPI

Jump to solution
1,045 Views
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 Kudos
Reply
1 Solution
958 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
970 Views
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 Kudos
Reply
959 Views
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 Kudos
Reply
946 Views
SuperBeginner
Contributor III

Hi @Irina_Costachescu ,

Thank you for your reply.

You solved my problem, thanks.

0 Kudos
Reply