2023-05-02 09:15 AM
When running your PWR_ModeSelection example on a NUCLEO-L496ZG board the current consumption in run range 2, 24MHz depends on the order objects are linked in the executable. When the object_list is in this order:
hal/stm32l4xx_hal.o
hal/stm32l4xx_hal_cortex.o
hal/stm32l4xx_hal_dma.o
hal/stm32l4xx_hal_gpio.o
hal/stm32l4xx_hal_pwr.o
hal/stm32l4xx_hal_pwr_ex.o
hal/stm32l4xx_hal_rcc.o
hal/stm32l4xx_hal_rcc_ex.o
hal/stm32l4xx_hal_rtc.o
hal/stm32l4xx_hal_rtc_ex.o
hal/stm32l4xx_hal_uart.o
hal/stm32l4xx_hal_uart_ex.o
hal/stm32l4xx_nucleo.o
hal/system_stm32l4xx.o
lprun_test.o
lpsleep_test.o
run_range1_test.o
run_range2_test.o
shutdown_test.o
sleep_range1_test.o
sleep_range2_test.o
standby_rtc_sram2_test.o
standby_rtc_test.o
standby_test.o
stm32l4xx_hal_msp.o
stm32l4xx_it.o
stop1_mroff_rtc_test.o
stop1_mroff_test.o
stop2_rtc_test.o
stop2_test.o
syscalls.o
startup_stm32l496xx.o
main.o
The average current consumption as measured by a X-NUCLEO-PM01A is 3305uA. When the default object order in the example is used:
hal/stm32l4xx_nucleo.o
hal/system_stm32l4xx.o
hal/stm32l4xx_hal.o
hal/stm32l4xx_hal_cortex.o
hal/stm32l4xx_hal_dma.o
hal/stm32l4xx_hal_gpio.o
hal/stm32l4xx_hal_pwr.o
hal/stm32l4xx_hal_pwr_ex.o
hal/stm32l4xx_hal_rcc.o
hal/stm32l4xx_hal_rcc_ex.o
hal/stm32l4xx_hal_rtc.o
hal/stm32l4xx_hal_rtc_ex.o
hal/stm32l4xx_hal_uart.o
hal/stm32l4xx_hal_uart_ex.o
startup_stm32l496xx.o
syscalls.o
main.o
stm32l4xx_hal_msp.o
stm32l4xx_it.o
lprun_test.o
lpsleep_test.o
run_range1_test.o
run_range2_test.o
shutdown_test.o
sleep_range1_test.o
sleep_range2_test.o
standby_rtc_sram2_test.o
standby_rtc_test.o
standby_test.o
stop1_mroff_rtc_test.o
stop1_mroff_test.o
stop2_rtc_test.o
stop2_test.o
The average current consumption in the same mode drops to 2407uA.
What in the world is going on? The position of startup_stm32l496xx.o in the link order seems to be making the difference. I've noticed that your examples tend to put the link order in HAL files, start asm file, application files. Why, and what could be going on here? I've verified that the CPU clock frequency is the same in both cases. The only difference in the map files appears to be the location of Reset_Handler.
Thank you.
--b
2023-05-05 12:22 PM
Ok , I am going to check it on Monday because I have the board in office
2023-05-31 04:01 AM
Any update on this?