[S32K311] LPSPI RxBuffer Always Zero & Unstable ADC Readings on PTA3/PTA10

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

[S32K311] LPSPI RxBuffer Always Zero & Unstable ADC Readings on PTA3/PTA10

ソリューションへジャンプ
431件の閲覧回数
johns_chuang
Contributor III

Dear Team,

I'm encountering a couple of issues while working with the S32K311 and would like to ask if anyone has experienced the same or can offer suggestions for resolution.


1. Lpspi_Ip_SyncTransmit() RxBuffer always returns 0x00:
The function Lpspi_Ip_SyncTransmit() returns LPSPI_IP_STATUS_SUCCESS. The data inside the TxBuffer is transmitted correctly — I confirmed the expected waveform on the MOSI line (PTB3), and the slave device receives the data and responds correctly on the MISO line (PTB2). However, the RxBuffer remains all 0x00 after the call to Lpspi_Ip_SyncTransmit(). Are there any known configuration issues or points I should double-check?


2. Unstable ADC readings on PTA3 and PTA10:
Although the measured analog voltage on the hardware side ranges as expected (from 0V to 3.1V), the ADC result for PTA10 only fluctuates between 3000 and 6000, unlike PTC5 and PTB13 which properly reflect input changes with values ranging from ~100 to ~16000.

I’m using BCTU, with PTA10 assigned to FIFO1, and PTA3, PTC5, and PTB13 assigned to FIFO2. I use BctuWatermarkNotif to read FIFO1 and BctuWatermarkNotif2 for FIFO2.

johns_chuang_0-1751954540319.png

johns_chuang_1-1751954575010.png

Among them, only PTC5 and PTB13 behave as expected. The readings from PTA3 and PTA10 do change, but they do not correlate with the actual analog signals — the values appear disconnected from the real input and show no consistent relationship to the hardware voltage.

Are there specific configuration steps or known limitations I should check regarding these channels?


I would greatly appreciate any guidance or suggestions you may have. Thank you!

Best regards,

Johns

タグ(1)
0 件の賞賛
返信
1 解決策
409件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

is this your own board design or do you use some EVB board? If first one, be sure there is right connection, no shorts etc. If you measure signal on MCU's PTB2 pin, then you can try to check respective SIUL2 MSCR and IMCR setting within debugger, if right value is set.
Regarding ADC; PTA10 is for example debug pin, so I guess you should select different one.

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
427件の閲覧回数
johns_chuang
Contributor III

Note:

MISO (SIN) and MOSI (SOUT) have signals.

johns_chuang_0-1751955925919.png

 

In debug mode, RxBuffer is always 0, but SPI_status is SUCCESS.

johns_chuang_1-1751956007754.png

 

0 件の賞賛
返信
410件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

is this your own board design or do you use some EVB board? If first one, be sure there is right connection, no shorts etc. If you measure signal on MCU's PTB2 pin, then you can try to check respective SIUL2 MSCR and IMCR setting within debugger, if right value is set.
Regarding ADC; PTA10 is for example debug pin, so I guess you should select different one.

BR, Petr

0 件の賞賛
返信
380件の閲覧回数
johns_chuang
Contributor III

Hi Petr,

Thanks for your reply.

Yes, we are using our own board design. The hardware was originally designed for the S9KEAZN8, with both SPI and ADC working properly. However, due to Flash size limitations, we switched to S32K311.

From the hardware side, we haven’t observed any obvious noise or abnormal behavior when measuring the voltage or signals directly.

As for PTB2, we configured it in SIUL2_Port as shown in the screenshot below. Could you kindly check if there's any misunderstanding or mistake in our configuration?

johns_chuang_0-1752040399974.png

 

Also, we are using only SWCLK / NRST / SWDIO for debugging.
Is this sufficient, or does the presence of PTA10 (JTAG_TDO) during debugging mean it cannot be used as an ADC input?

If that's the case, I'm wondering why PTC5 (JTAG_TDI) still works fine for ADC even during debugging?

Thanks again for your support!

Best regards,
Johns

0 件の賞賛
返信
377件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

PTB2 setting in PortConfig looks normal, I rather though to check actual MSCR and IMCR registre content witihn debugger.
If SWCLK/SWDIO is used for debugging then PTA10/PTC5 usage would be OK.

Let me check your project, but I will need to install RTD600 you used for that.

BR, Petr

0 件の賞賛
返信
355件の閲覧回数
johns_chuang
Contributor III

Hi Petr,

Thank you for your support. We've resolved the SPI issue — it turned out to be a flywire connection problem. After re-routing, the MCU is now able to correctly read data from the MISO line.

I will start a separate thread to discuss the ADC part.

Thanks again for your help!

Best regards,
Johns

0 件の賞賛
返信