2025-09-19 1:41 AM - last edited on 2025-09-19 3:56 AM by mƎALLEm
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code.
in STM32U073MCT6 microcontrollers, I have a problem which is like this;
in main.c I have
while (1)
{
/* USER CODE END WHILE */
HAL_GPIO_WritePin(ioOUT_DISP_A_GPIO_Port, ioOUT_DISP_A_Pin, 1);
/* USER CODE BEGIN 3 */
}
and my led is blinked which is high 3.3 v
however, whenever I enable freertos, led is 0 v
what should I do?
2025-09-19 1:51 AM - edited 2025-09-19 4:35 AM
Hello,
As soon as osKernelStart() is called that infinite loop in main() is unreachable.
You need to handle that gpio state in one of the Tasks, example the default task.
2025-09-19 3:53 AM
Hello @JamesMoriarty
As @mƎALLEm mentioned you need to toggle your led in one of the tasks.
Please check the example below as reference.