SPI_PAL example code not working properly on S32k118 Evaluation board

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

SPI_PAL example code not working properly on S32k118 Evaluation board

4,496件の閲覧回数
Adarshnanda
Contributor II

Hey,

 

I was exploring SPI peripheral on S32k118 evaluation board. I flashed the spi_pal_s32k118 example on the board, and made the connections according to the user manual, and checked the same using pinmux.

Here, in this code, the master(FLEXIO peripheral on the same board) sends data in an array -{1,2,3,4,5,6,7,8,9,10}, and so does the slave(LPSPI0), if the data matches on both sides, the LED is OFF, and if it doesn't , the LED remains on.

In my case the LED was ON, then i debugged it and saw the values received by the master and the slave, then I found that the Slave was receiving the correct data, while the master was receiving 0xFF or 0x00.

Later I modified code to check only if the mastersend data is the same as slave receive data, and this time the LED remained OFF and it was working properly.

My question is that, why is the master not receiving the right data? Can anybody help me out ?

I am pretty sure that the connections are right.

I am attaching the screenshots.

 
 

Adarshnanda_0-1673590157594.pngAdarshnanda_1-1673590263683.png

 

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

4,488件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Adarshnanda,

Please tell me the version of S32K SDK and S32DS. Note S32K118EVB-Q064(SCH-29945) is supported by this application.(not S32K118EVB2Q048 SCH-47530)

I tested spi_pal_s32k118 example in S32K SDK RTM4.0.3 with S32DS v3.4. The transfer is successful, and GREEN led was on.

spi_pal_s32k118 If transfer is successful, GREEN led will be on.png

This is the connection, check that the yellow wire is connected correctly.

S32K118EVB-Q064.jpg


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

4,468件の閲覧回数
Adarshnanda
Contributor II

Hey Robert,

Thanks for the reply. I am actually using the other board (this one -S32K118EVB2Q048 SCH-47530)

Now, I have created a new application project for s32k118 microcontroller, and have written almost the same code as written in the example project for master and slave transmission,there are some changes in the FLEXIO pins for SPI. Still, I am facing some issues.

In some cases, I am able to receive the correct slave_receive data and in some cases there is some problem with the data_arrangement, but still there is no data in the master_receive.(I am sending the odd numbers from 1 to 20 instead of 1 to 10).

I am attaching the project with this thread (I have added a delay function, just for my use case), and posting all the screenshots here. Can you please help me out with this @Robin_Shen 

Adarshnanda_0-1673852382133.png

Adarshnanda_1-1673852410966.png

Adarshnanda_2-1673852446538.pngAdarshnanda_3-1673852469772.png

 

 

0 件の賞賛
返信

4,456件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

The position of S32K118EVB-Q064 pins on the Header(J1\J2\J3) is somewhat different from that of S32K118EVB2Q048. 

Can you confirm your Hardware Wiring according to the schematic in the S32K118EVB Evaluation Board - REV A Design Files, and retest the spi_pal_s32k118 example that have not been modified?

Hardware Wiring.png

Please check the information at the bottom side of your board.  Here is the information of my S32K118EVB2Q048(700-47530 REV X1   SCH-47530 REV A1)

4,451件の閲覧回数
Adarshnanda
Contributor II

Thanks for the help @Robin_Shen .

I found the error, the MISO line(PTA1) was actually connected to a DNP resistor on S32K118EVB2Q048, and I was expecting the data out of it, my bad! , thankyou for solving the issue.

Slave is working fine, as usual & now the data is coming in master_receive as well, I saw the correct data, a number of times and incorrect data as well. Why am I facing such inconsistent data in the master_receive?

I am attaching a screenshot here, please have a look, what do you think, is it a hardware issue?

Adarshnanda_0-1673862173151.png

 

Can you help me @Robin_Shen 

0 件の賞賛
返信

4,436件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

->The MISO line (PTA1) is actually connected to a DNP resistor on the S32K118EVB2Q048.
So which pin did you finally choose as MISO? Did you check the data by using logic analyzer?

0 件の賞賛
返信

4,416件の閲覧回数
Adarshnanda
Contributor II

Hey @Robin_Shen ,

Now I chose PTA2 as the MISO pin and it works. Screenshots attached.

Still there is some issue with the data being received, I am yet to check it with the logic analyzer, but I am not sure why I am facing this issue sometimes.

Adarshnanda_1-1674284819410.png

 

Adarshnanda_2-1674284839453.png

 

0 件の賞賛
返信

4,143件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Sorry. I did not notice that it still not work.
Are you using the USB cable (J7) or an external 12V (J16) power supply? Please try to power the board by J7 and select P3V3 power the S32K118(J10 1-2). 

0 件の賞賛
返信