How to optimize power consumption by SAI
I'm developing a battery powered application using the STM32WBMMG and working to minimize power consumption. I'm using STM32Monitor-Power and X-NUCLEO-LPM01A to supply power to our custom board and measure current. The application periodically uses the SAI to generate audio (alert tones). If I comment out the call to MX_SAI1_Init() in main(), the average current measurement drops by 500uA so I'd like to keep the SAI disabled until it's needed. To that end, I added a call to HAL_SAI_DeInit() near the end of the initialization sequence in main() and bracketed audio generation with HAL_SAI_Init() & HAL_SAI_DeInit() calls. However, current measurement only decreases by ~100uA following the call to HAL_SAI_DeInit().
Here are the measured values (avg current over 10 seconds):
- With SAI fully initialized by MX_SAI1_Init(): I=3.4mA
- With call to MX_SAI1_Init() commented out: I=2.9mA
- With MX_SAI1_Init() followed by call to HAL_SAI_DeInit(): I=3.3mA
How can I properly set the SAI registers to obtain the optimal (500uA) power savings?
