cancel
Showing results for 
Search instead for 
Did you mean: 

Is FreeRTOS configuration bug in CubeMx causing freeze-up when calling osDelay()?

Michael98006
Associate III

I'm running on a Discovery STM32H745I board with a dual-core MCU, generating code for IAR with CubeMx. I generated a FreeRTOS-based FW for the CM7 core (CM4 core doesn't use FreeRTOS in this instance). When calling the osDelay() function, the code freezes. The root cause seems to be the following auto-generated code in the FreeRTOSConfig.h file:

/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,

to prevent overwriting SysTick_Handler defined within STM32Cube HAL */

/* #define xPortSysTickHandler SysTick_Handler */

Now, I have changed my timebase to TIM17 for both CM4 and CM7 MCU cores and re-generated the project so that HAL doesn't use SysTick as my timebase. I'm not sure why this #define is commented out, but when I remove the comments by hand, everything starts working ok (that is, the #define xPortSysTickHandler SysTick_Handler is present in my code).

I'm using CubeMx 5.3.0. Does this version have a bug?

The only reason I was able to figure out what the issue was, was by comparing my source code to the code generated by CubeMx for my STM32H743-based board, where the #define above was not commented out after I selected TIM17 as my timebase. Not sure if having a single MCU core on the H743 makes a difference for CubeMx.

Thanks for any insight into this issue.

0 REPLIES 0