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.
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
解決済! 解決策の投稿を見る。
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
Note:
MISO (SIN) and MOSI (SOUT) have signals.
In debug mode, RxBuffer is always 0, but SPI_status is SUCCESS.
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
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?
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
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
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