Power Optimization with STM32L4: Sleep Mode during SDMMC DMA Interrupts
Hello, fellow forum members,
I'm acquiring data from an ADC using DMA, and writing the filled buffer in SDCard, using SDMMC, also with DMA, on an STM32L452RC.
I recently came across an interesting challenge involving power optimization while waiting for an SDMMC DMA interrupt. I wanted to inquire if it is possible to put the device into a low-power sleep mode, or any other suitable, during this waiting period. My goal is to maximize power savings by allowing the device to enter a low-power state during periods of inactivity and only wake it up when the SDMMC DMA or ADC interrupts are triggered. There's any technical limitation to achieving it?
I also have been looking at the `sd_diskio.c` generated code and in the write and read methods there's a blocking condition which is released on the DMA callback is triggered:
timeout = HAL_GetTick();
while((WriteStatus == 0) && ((HAL_GetTick() - timeout) < SD_TIMEOUT)){}So what's the point of using DMA if it's blocking the main loop?
Best regards