2025-07-05 10:33 PM - last edited on 2025-07-07 3:10 AM by mƎALLEm
IDE : STM32CubeIDE Version: 1.16.1
Board : STM32F407VG DISC1
SYS Timebase Source : TIM6
Hello,
In my project, i use I2C and multiple UARTs. It worked fine before adding FreeRTOS tasks. Recently i need add buttons to my project, so i add a new task to handle interrupts. To synchonize my EXIT ISR (callback) and the button handling task, a binary semaphore is adpoted.
Strange things happened, after creating a binary semaphore with xSemaphoreCreateBinary(), all I/Os, I2C and UARTs, are failed. Even HAL_Delay() did not work, bebugger died in HAL_GetTick() in HAL_Delay. all abnormalities happened before starting FreeRTOS kernel and initializing tasks. Commenting the xSemaphoreCreateBinary() system is back to normal.
Can someone tell me what causes the problem.
2025-07-07 6:46 AM
Hello @sinolegend,
Could you share xSemaphoreCreateBinary()?
Potential causes could be heap/stack corruption or a conflict of HAL timebase (using TIM6), so try increasing the heap size and make sure TIM6 is not used by both HAL and RTOS.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.