Olimex Support Forum

ARM => ST => Topic started by: lim on October 21, 2020, 02:36:22 pm

Title: STM32CubeMX - Timebase Source
Post by: lim on October 21, 2020, 02:36:22 pm
Pardon my ignorance. I experience this problem since the beginning. Whenever, I used the default setting of "SYS Mode and Configuration" which its Timebase Source = SysTick, my problem halts at HAL_Delay().

I read about it is meant for RTOS, but I don't use any RTOS. Also not knowing is the right timer, I chose TIM10.

Anyone has any input on what is the right way to handle this issue, please?
Title: Re: STM32CubeMX - Timebase Source
Post by: lim on October 22, 2020, 03:42:56 pm
Sharing someone's comments "First of all CubeMX strongly suggests to change hw timer for ST HAL, because Systick is already used by FreeRTOS. I understood the problem is
with interrupt priority: ST HAL needs the highest priority (because
ticks counting must continue during whatever ISR, because some ISR code
could wait for some time... how bad!!!); FreeRTOS needs the lowest
priority (sincerely I couldn't understand why)."

However, one can still use Systick as default timebase, but needs to respect the HAL programming,i.e., do not call HAL time-related, I guess (I am not sure) like, HAL_Delay in any ISR. I have not experimented that myself.