cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F415 SDIO + STOP Mode

MZadn.2
Associate II

I am using an SD card with STM32F415. The MCU periodically enters STOP mode.

Currently, I observe the following behaviour in the IDE related to SDIO:

- Before enabling SDIO for the first time, the current consumption in STOP mode is as expected (around 180 µA), and the 48 MHz clock is greyed out in the Clock Configuration diagram in the IDE.

- As soon as I enable SDIO in SD 1-bit mode, the 48 MHz clock becomes active in the Clock Configuration diagram, and the current consumption in STOP mode jumps up by 1 mA. This is true even if I disable the call to MX_SDIO_SD_Init() in main().

- When I later disable the SDIO interface in the configurator, the 48 MHz clock remains active, and the current consumption in STOP mode remains with the additional 1 mA introduced when enabling the SD card for the first time.

I see no way of disabling the 48 MHz clock, either temporarily (before going to STOP mode) or permanently (by disabling the SDIO altogether in the IDE). I suppose this is also the reason why I can't eliminate that additional mA in STOP mode.

What is the correct way to turn off all the SDIO-related peripherals before switching to STOP mode to save as much power as possible?

stm32f415-clock.png

1 REPLY 1
Danish1
Lead III

My recommendation would be to study the Reference Manual for your stm33, to try to understand what the stm32 libraries are doing and why.

When ST’s HAL library function to start SDIO is called, it knows it needs the 48MHz clock, so it enables that clock.

But other peripherals might also use the 48MHz clock (off the top of my head, I think it is often used for the true-random-number generator and there could be others).

The HAL library function to turn off SDIO doesn’t know if you’re using the 48 MHz clock for other peripherals so it doesn’t stop that oscillator.

That’s my understanding. Only you know your entire system so only you can decide if it is safe to turn it off.