2021-06-14 08:35 AM
Hello Everyone,
I am currently working with a dev board based on STM32L4R5 using STM32CubeIDE , HAL libraries and FreeRTOS.
Project: UART2 initialized using the code generator:
Added __HAL_UART_ENABLE_IT() after initialization.
Along with this disabled the " Call HAL Handler " for the USART2 IRQAlso modified the IRQ priorityI have also initialized an queue that is used to send data from the UART IRQ and then received by a task/thread.
/* Create the queue(s) */
/* definition and creation of bluetoothDataQueue */
osMessageQDef(bluetoothDataQueue, 50, uint8_t);
bluetoothDataQueueHandle = osMessageCreate(osMessageQ(bluetoothDataQueue), NULL);
UART IRQ:
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
/* USER CODE BEGIN USART2_IRQn 0 */
uint8_t console_rx_byte;
if ( USART2->ISR & USART_ISR_RXNE_RXFNE )
{
console_rx_byte = USART2->RDR;
osMessagePut( USART2_RxQueue, rxData, 0 );
}
/* USER CODE END USART2_IRQn 0 */
/* USER CODE BEGIN USART2_IRQn 1 */
/* USER CODE END USART2_IRQn 1 */
}
Issue:
When I comment out the line:
osMessagePut( USART2_RxQueue, rxData, 0 );
There is no issue encountered. But when the Line is added, the HAL_Init() function does not return.
From basic debugging the problem lies here in the HAL_Init()
/* Use SysTick as time base source and configure 1ms tick (default clock after Reset is MSI) */
if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
{
status = HAL_ERROR;
}
else
{
/* Init the low level hardware */
HAL_MspInit();
}
Could someone please let me know If I am doing something wrong here.
Thank you.
2021-06-25 07:12 AM
Hello @POval.1 ,
Can you please share your example for further check ?
Thanks in advance.
BeST Regards,
Walid
2024-06-08 02:05 AM
I am encountering the exact same issue with the nucleus F443ze board. Have you find the solution?
2024-06-08 07:27 AM
I found the solution for my case, i forgot the enable the USE_NEWLIB_REENTRANT setting for Freertos in cubemx.