2020-04-24 06:58 AM
HAL_RCC_GetSysClockFreq(void) in stm32f7xx_hal_rcc.c uses a (unt64_t) divide which could be avoided. This uses, on my build, 716 bytes of code space alone for the required _udivmoddi4 call, and this is not used anywhere else in my code.
Would it be possible to investigate recreating the calculation more efficiently?
There is already some bit manipulation in the calculation, and it would appear that the 64-bit datatype is just not required for the significant bits involved.
2020-04-25 04:48 AM
Isn't it easier to maintain the "last system frequency I switched to" in a variable?
JW
2020-04-25 02:00 PM
> their goal is code which works in every case
But in reality their implementation is so terrible that it doesn't work in any case, even the USART...