An exception occurred when configuring flexio for SPI communication

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

An exception occurred when configuring flexio for SPI communication

2,961件の閲覧回数
zenging
Contributor I

HI, NXP
The version I used is S32DS 3.5, and the chip I chose is S32K311.

I want to configure flexio for SPI communication, but after I follow your tutorial configuration is complete. Burning debugging appears to be stuck in the function of the SPI transfer.
Because I set the breakpoint but the program is not stuck at the breakpoint.

6cddfecd8f21fba1051a10b64296c6f.png1d84a645997c82dff0702af909ec0c5.png

I want to know if there is something wrong with my configuration that prevents the program from running. Here's my program and I hope you can check it for me.

Finally, I hope you can provide me with a flexio spi communication program based on S32K311 version 3.5 for my reference, thank you.

0 件の賞賛
返信
7 返答(返信)

2,923件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @zenging 

Currently, the only RTD version that provides driver examples for S32K311 devices is the S32K3 Real-Time Drivers Version 3.0.0 CD04. Unfortunately, all software included in this release has Code Drop quality status in terms of testing is not fully tested. So, it is not recommended for production use but you can be used them as a reference.

 

BR, VaneB

0 件の賞賛
返信

2,909件の閲覧回数
zenging
Contributor I

HI @VaneB

I have some questions about the configuration of flexio. I saw in your tutorial on flexio configuration SPI that when configuring flexio_SPI components, tx, rx, clk, cs are configured using four channels and four pins.

e7e7a1418eb3ff8e6ebdc921b575d9b.png

However, flexio's channel configuration in my version 3.5 has only two options.

0234e69da6212e6f22d625dc8c0914e.png

Should I check Enable Flexio Add Channel and Enable Flexio Add Pin in the configuration of Flexio_Mcl_Ip?

b4bddd967a28524c21821d5e595c23b.png

Whether these configuration problems will cause my program to have problems when using the SPI transfer function so that the program can not run properly.

6cddfecd8f21fba1051a10b64296c6f.png

1d84a645997c82dff0702af909ec0c5.png

Finally, the following is my project, I hope you can help me to see if there is any problem with the configuration.

0 件の賞賛
返信

2,893件の閲覧回数
zenging
Contributor I

By the way, the problem appears to be with Flexio_Mcl_Ip_GetShifterStatus() in the Flexio_Spi_Ip_SyncTransmitProcessData() function, through debugging of serial print. It seems that the IsShifterFlagRaised parameter is only set to 1 the first time TX is entered. After that, neither receive nor transmit can be set to 1. I would like to ask if this is because I have a problem with flexio_Spi configuration.

3bea3a387eb763d78ce1715b3639b34.pngb9ec777dac30e4210820c74d4d11ba4.png

For my spi configuration, I want to configure it to mode 1 and clock at 4Mhz. The following pictures are some of my flexio_spi configurations, hoping to correct them.

fb1b220a34a398bc76b9e53b61039ae.png7f1a9205f4fd0b08e80eb67d8e4921e.pngac5fdd0164da388137729c8f49f93ff.png84eea5c93916710e570cbc6f2dc8389.png

0 件の賞賛
返信

2,872件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @zenging 

In recent versions of the software, instead of configuring each channel separately, channel configuration is done in pairs. SpiFlexioTxAndClkChannelsConfig selects 1 PIN to configure as TX channel and 1 PIN to configure as CLK channel and SpiFlexioRxAndCsChannelsConfig selects 1 PIN to configure as RX channel and 1 PIN to configure as CS channel (the order of the pin configurations corresponds to the order in which the parameter is named).

Looking at the shared images, I see that you modified the Flexio_Spi_Ip_SyncTransmitProcessData() function, am I correct? If so, did you modify any other functions?

0 件の賞賛
返信

2,853件の閲覧回数
zenging
Contributor I

HI @VaneB 

Regarding what you said, I modified Flexio_Spi_Ip_SyncTransmitProcessData() function.In fact, I just added the function of serial print so that I know where the function is going wrong. This change should not cause problems with the function.

 

In addition to this function, I also added a serial print to Flexio_Spi_Ip_SyncTransmit() to find the location where my program keeps getting stuck in a loop.

09ac59b1bdff22247e7e1483f7a67ce.png
So could you please help me to see if there is something wrong with my initial configuration? Because I am not sure whether there is something wrong with the peripheral configuration of Flexio_Spi and Flexio_Mcl_Ip. What I want to configure is mode 1 of the SPI with a clock frequency of 4MHz.

 

0 件の賞賛
返信

2,788件の閲覧回数
zenging
Contributor I

Hi,@VaneB 

Regarding Flexio_Spi_Ip_SyncTransmit, this function can now transmit and receive data.

f37d9c076042d8d39f9bbd425d4dc4f.png

But I have other problems here. My vision is to send 68 bytes of data and get 68 bytes of data at the same time. When 68 bytes of data have been sent, the program enters the DevAssert() function. The program can no longer run.

20e50ee11a0c222398789627d625bd9.png

All the received data printing is done at the bottom of Flexio_Spi_Ip_SyncTransmit. And the data I received was not what I expected. What causes this in general?

aef32cf21fce24b10fa1e046942bc09.png

 

0 件の賞賛
返信

2,701件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @zenging 

The DEV_ASSERTs seem to be the ones called during Lpuart_Uart_Ip_SyncSend(). To verify that the UART is not interfering with the functionality, could you use breakpoints instead?

0 件の賞賛
返信