Hi,
I am implementing an SD Card driver over SPI on the S32K312 EVB using RTD 6.0.0 (Non-AUTOSAR Lpspi_ Ip driver).
According to the SD Physical Layer Simplified Specification, the SPI initialization sequence is:
My issue is with hardware-controlled PCS0.
When using the Lpspi_Ip driver with hardware PCS0, the PCS signal is automatically asserted/deasserted by the LPSPI peripheral during SPI transfers. Because of this, I cannot generate the initial 80 clock pulses while keeping CS HIGH and then CMD0 with CS LOW, as required by the SD specification.
I have the following questions:
Additionally, if NXP has any reference implementation, application note, example project, or SDK/RTD example demonstrating SD card communication over SPI on the S32K3 series, could you please share the reference?
Thank you.
Hi @parvathitp
The PCS (Peripheral Chip Select) signal is designed to be controlled by the LPSPI module. When a hardware PCS is selected, it is automatically asserted and deasserted by the LPSPI peripheral during SPI frame transfers.
There is no dedicated API available to manually control a hardware PCS signal while it is assigned to the LPSPI module. Therefore, as you mentioned, the best approach for this case is to configure the CS pin as a GPIO.
In this configuration, the CS signal is controlled through the SIUL2/GPIO APIs, and you are responsible for controlling it.
Currently, there is no S32K3-specific application note, example project, or reference document that demonstrates this exact implementation.
BR, VaneB