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:
- Keep CS HIGH after power-up.
- Generate at least 74 clock pulses (I am sending 80 clocks by transmitting 10 bytes of 0xFF).
- Pull CS LOW.
- Send CMD0 (0x40 00 00 00 00 95).
- Keep CS LOW while polling with 0xFF until the card responds with **R1 = 0x01`.
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:
- Does the S32K312 LPSPI peripheral support keeping PCS inactive (HIGH) while generating SPI clocks?
- Is there any Lpspi_Ip API, register configuration, or recommended method to manually control PCS or temporarily disable hardware PCS during the SD card initialization sequence?
- If not, is the recommended approach to configure the SD card CS pin as a GPIO and manually control it while using LPSPI only for SCK, MOSI, and MISO?
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.