Bug: RTOS task scheduler too fast
MCWB Version: 6.2.1
CubeMX Version: 6.10.0
Issue: I generate a default project for the B-G431-ESC1. Only settings I change is to enable the FreeRTOS with TIM6 as the tick timer. Firmware Package Version is V1.5.1 (Recommended).
Via CubeMX I add a GPIO output pin for debug purposes and regenerate the project. FreeRTOS settings show that TICK_RATE_HZ is set to 1000 (1ms).
I open the project with CubeIDE and add HAL code to toggle the added debug Pin inside the HAL_TIM_PeriodElapsedCallback for TIM6. My expectation is that the pin now toggles at an 1ms interval. When looking at the pin's signal, I see that this is the case, as expected.
I now create a custom task inside CubeMX. The default code adds osDelay(1) which translates to 1ms. I move the code to toggle the pin to this custom task. My expectation is that the pin should again toggle at an 1ms interval.
However, when checking the pin's signal, the pin toggles at a 500µs interval.
When double-checking the code, I noticed that the default code added by the Motor SDK that's responsible for the MediumFrequencyTask and SafetyTask tasks both add a wait time of vTaskDelay(1) which should translate to a 1ms interval (as the tick time is 1000Hz = 1ms), however there's a comment saying "/* Delay of 500us */" which means the issue with the faulty task timing is known.
What's the deal with this?
How can I fix this?
