ThreadX makes HAL_Delay() & HAL_GetTick() functions highly unreliable
I have set up ThreadX on my STM32U5A9 board using CubeMX. In such configuration it is recommended to use SysTick for ThreadX and select some other timer as a Timebase Source so I selected TIM7.
Now HAL_Delay() and HAL_GetTick() functions are very unreliable. If the system is a bit busy, 1s delay can easily take 10s and HAL_GetTick() counts much slower than it should. The problem is TIM7 IRQ priority. CubeMX generates code setting it to the lowest available priority 15, instead to the highest allowable - probably 1 would be a good choice so it is a bit lower than SysTick priority 0. Where/how do I modify current HAL_GetTick() timer priority in CubeMX?
The problem is that many HAL functions rely on HAL_Delay() and HAL_GetTick() functions while using LL_mDelay() is not recommended and SysTick is handled in ThreadX assembler code.
I begin to contemplate using DWT counter. It could be used in HAL_Delay() function, but not in HAL_GetTick() since at 160MHz DWT.CYCCNT resets every ~28s. Maybe high resolution 32b TIM2 timer incrementing every 1ms would be a better choice.
ST, why do not you implement a simple 64b DTW hardware clock cycle counter? I think it would perfectly fit HAL_Delay() and HAL_GetTick() needs without using ISR just to increment software counter.
Probably this problem can be seen as a CubeMX bug.

