Going lower level enables more control... for who has the tech know how for it.
Saving power is relative, there maybe many ways to reduce power, only few will have a significant impact.... power saving starts with a mission profile. Then, usually follows the question: what is the lowest core frequency that meet the application needs, to minimize the active and running power, then the power saving mode (clock stop...).... is the application sleeping 50% or 98% of the time?
HAL vs LL may require higher core frequency if more code is run relatively. Similarly for RTOS/linux vs Bare metal... trade offs are.to be well selected.
Generally speaking I agree with you, but two things:
Using LL need deepest knowledge of the micro (and this is a must for the best solution ever).
From the ST website: "The general rule to minimize the power consumption is to perform the task for the shortest possible time, at the lowest possible operating frequency and with the clock enabled to a minimal part of the silicon."
HAL need SysTick "The SysTick timer is configured to be used to generate variable increments by calling HAL_IncTick() function in SysTick ISR and retrieve the value of this variable by calling HAL_GetTick() function. The call HAL_GetTick() function is mandatory when using HAL drivers with Polling Process or when using HAL_Delay()." So, to reach the best low consumption SysTick must be enabled on wakeUp and vice-versa. ISR is shortest using LL than HAL, and they don't need SysTick .
The point can be: is a HAL ISR 20% slowest than LL, and it's called every minute, is the effort to learn all the uC so deep necessary?
I saw code where the LL are "copied" inside a ISR or a routine, like this:
GPIOA->ODR &= ~(1<<4); {
while (!((SPI1->SR)&(1<<1))) {};
SPI1->DR = opcode; }
>> illeggible!
In the past I used the Standard Template Library, and I prefer LL than HAL. But many lazy programmers use HAL without knowing how they work...
Sometime yes. Ofcourse, if you search only a bit set/reset OK. On a serial R/W interrupt things are most compicated (for me in HAL mode :face_with_tears_of_joy:). Unfortunately good library (as HAL are IMHO) makes programmers lazy.