Skip to main content
willcfj
Associate III
October 27, 2019
Question

STM32CubeMX generates wrong SysTick value for a non-1ms FreeRTOS period.

  • October 27, 2019
  • 1 reply
  • 670 views

I'm just getting started with doing RTOS programming but I can't see this being anything but a CubeMX bug. My target MCU is an STM32H750 running at 400MHz. I wanted the FreeRTOS tick to be 100Hz. I set that parameter in CubeMX, but noticed that all my osDelay functions were about 1/10th of what they should be. If I set the RTOS tick to 1000Hz, all is good, but for a 100Hz period the Systick period is still programmed to 399,999. So, looks like the RTOS code is being correctly set to assume a 100Hz tick, but the actual SysTick is hard coded to 1KHz? I've poked around a bit and don't see the SysTick programming, (I used the debugger to look at the SysTick period register).

It is easy to override and need to do it in user code anyway. Is the best place in between HAL_Init() and osKernelStart()?

will

This topic has been closed for replies.

1 reply

willcfj
willcfjAuthor
Associate III
October 27, 2019

OK, not sure how or why, but now it works fine. The correct Timer Tick value is being programmed for an RTOS period of 100Hz. I'll blame user error somehow, but not sure how.

will