Question
STM32CubeMx with FreeRTOS, LED, UART stuck in infinite loop
Posted on July 31, 2014 at 03:55
However, if i were to disable the USART2 in CubeMx, the LED works!
Is there some configuration procedure to note??? I have not called the function HAL_UART_MspInit yet...
Hi there, I am using the STM32CubeMx code generator with the STM32L053 discovery board. In CubeMx, I enabled USART2 and changed the baud rate to 9600. Also, I configured the pins PA0 for user push button, PA5 for red LED, PB4 for green LED.
Here is a snippet of code that i inserted in TrueStudio:/* USER CODE BEGIN 2 */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, GPIO_PIN_SET);
/* USER CODE END 2 */ This is before the code generated for FreeRTOS but the debug never reaches this line of code.
It gets stuck here line 124:
However, if i were to disable the USART2 in CubeMx, the LED works!
Is there some configuration procedure to note??? I have not called the function HAL_UART_MspInit yet...