2025-01-30 11:09 AM
I'm working on a stm32wle5c8 Lora project. I have my own overrides of HAL_InitTick, HAL_GetTick, HAL_Delay and HAL_IncTick because I want to use SysTick as a high-resolution timer. With this new project, a file Core/Src/sys_app.c is being generated that overwrites HAL_GetTick and HAL_Delay. What's worse.. The generated ones don't even do anything. HAL_GetTick does nothing unless the static variable SYS_TimerInitialisedFlag is set. There is nothing in the code that actually sets it, so HAL_GetTick will always return 0. HAL_Delay calls a function in another newly generated file Core/Src/timer_if.c which looks like this:
void TIMER_IF_DelayMs(uint32_t delay)
{
/* USER CODE BEGIN TIMER_IF_DelayMs */
/* USER CODE END TIMER_IF_DelayMs */
}
In essence, these files are overwriting functions that did something with functions that actually do nothing!
So, it would be nice if neither of these files are generated, but I cannot find the magic incantation of checkboxes and dropdowns to stop it from happening. Any help is much appreciated!
Solved! Go to Solution.
2025-01-31 12:52 PM
I've found the incantation and the source of the generated file. It's part of the SUBGHZ_PHY middleware apparently. You need to check "Use RTC for Timer." under SUBGHZ_PHY. Then, select RTC as the "RTC" under "Platform Settings." This is going to expect some defines from main.h that don't exist. It will also expect some functions that only exist statically in main.c. Good luck.
2025-01-31 12:52 PM
I've found the incantation and the source of the generated file. It's part of the SUBGHZ_PHY middleware apparently. You need to check "Use RTC for Timer." under SUBGHZ_PHY. Then, select RTC as the "RTC" under "Platform Settings." This is going to expect some defines from main.h that don't exist. It will also expect some functions that only exist statically in main.c. Good luck.