I have been using for a long time the stm32L496ZGT6 in a customized PCB with an uSD card module. Never had any problem interfacing the card. Due to the shortage of supply during the pandemic situation I bought a couple of stm32L552ZET6 that have the same pinout as the stm32L496.
The problem now is that I cannot put the SD card working with the stm32L552. I am using the same SDMCC configurations of the stm32L4, but for some reason, it doesn't work with the stm32L5. The SD card never mounts successfully.
I am using STM32CubeMX 6.0.1 and Keil uVision5.
I tried 1bit and 4bit modes, different clock divide factors, and external transceiver present modes (it doesn't exist in the L4) but nothing seems to work. I checked with the oscilloscope and the clock (SDMCC1_CK) is not generated. I have no idea what I am missing here.
I am sure everything is ok with the hardware. I even set the CMD, CK and D0 pins as Outputs and saw them toggling with the oscilloscope. But when defined as SDMMC these pins are not responding. The clock doesn't exist.
I believe is something related to the software.
1) The L552ZET6 has the TrustZone mode. I am not using it. Could it be the problem? I've tried with the TrustZone too but with no success. But I never used it before.
2) The L552ZET6 have the "SD x bit with dir voltage converter", the L496ZG doesn't. I am only using the standard 1/4 bits.
3) The L5 has the "external transceiver present" flag, the L4 doesn't. I've tried all the configurations without success.
4) The STMCubeMX generates the #include "fatfs.h" for L4. For the L5 the library is #include "app_fatfs.h". Could it be something related to this? Any problem reported with this library?
I don't have a deep knowledge of MCU architecture or coding. Any hint would be highly appreciated. It is not the first time that I have tried to host an SD card with the L552ZET6 without success. I just gave up several times in the past to make it work but now I am really committed to it.