cancel
Showing results for 
Search instead for 
Did you mean: 

A question about the UART irq code generate by cubemx

NoobE
Associate

When a USART is configured without a clock, the code generator treats it as a UART and assigns HAL_UART_IRQHandler as the interrupt handler. However, within this handler, there is a blocking operation during the idle process:(void)HAL_DMA_Abort(huart->hdmarx);

When certain error conditions occur, the code can become stuck in HAL_GetTick(). This happens because the SysTick priority is lower than that of the UART interrupt. I have observed this behavior multiple times, particularly when noise is present on the UART signal line.

Has Anyone seen this situation before?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

HAL assumes SysTick (or whatever is being used to drive HAL_GetTick) has a higher priority than functions it is called from. It's up to you to ensure this is the case.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Super User

HAL assumes SysTick (or whatever is being used to drive HAL_GetTick) has a higher priority than functions it is called from. It's up to you to ensure this is the case.

If you feel a post has answered your question, please click "Accept as Solution".