2018-12-15 09:56 AM
I've complained about this before, but it is still broken and shows lack of grasp.
STM32Cube_FW_L4_V1.13.0\Projects\NUCLEO-L432KC\Examples\RTC\RTC_LSI\Src\main.c
The following code results in answers which are a multiple of 8, and loses precision which could otherwise be achieved if the math was thought through and ordered correctly.
/* Frequency computation */
uwLsiFreq = (uint32_t) SystemCoreClock / uwPeriodValue;
uwLsiFreq *= 8;
Should be
uwLsiFreq = (SystemCoreClock * 😎 / uwPeriodValue;
2018-12-15 11:12 AM
Probably the code cares for some STM32Xxxx running above 540 Mhz. 😉
2018-12-15 12:05 PM
Well the H7 can get close to that, but still...