Question
Set multiple UART interrupt in STM32G0B0
Now I'm implementing interrupt in USART1(PB7,PB6) and UART3(PC4,PC5).
So I wrote a USART1 code at first and It is working well.
However, I added a USART3 code and USART1 which is not working well even USART3.
I used this code.
USART_Communication_Rx_IT_Continuous_Init
Working well
void StartReception(void)
{
/* Initializes Buffer swap mechanism :
- 2 physical buffers aRXBufferA and aRXBufferB (RX_BUFFER_SIZE length)
*/
pBufferReadyForReception = aRXBufferA;
pBufferReadyForUser = aRXBufferB;
uwNbReceivedChars = 0;
uwBufferReadyIndication = 0;
/* Clear Overrun flag, in case characters have already been sent to USART */
LL_USART_ClearFlag_ORE(USART1);
/* Enable RXNE and Error interrupts */
LL_USART_EnableIT_RXNE(USART1);
LL_USART_EnableIT_ERROR(USART1);
}After adding the USART3 code, it is not working
void StartReception(void)
{
/* Initializes Buffer swap mechanism :
- 2 physical buffers aRXBufferA and aRXBufferB (RX_BUFFER_SIZE length)
*/
pBufferReadyForReception = aRXBufferA;
pBufferReadyForUser = aRXBufferB;
uwNbReceivedChars = 0;
uwBufferReadyIndication = 0;
USART3_pBufferReadyForReception = USART3_aRXBufferA;
USART3_pBufferReadyForUser = USART3_aRXBufferB;
USART3_uwNbReceivedChars = 0;
USART3_uwBufferReadyIndication = 0;
/* Clear Overrun flag, in case characters have already been sent to USART */
LL_USART_ClearFlag_ORE(USART1);
LL_USART_ClearFlag_ORE(USART3);
/* Enable RXNE and Error interrupts */
LL_USART_EnableIT_RXNE(USART1);
LL_USART_EnableIT_ERROR(USART1);
LL_USART_EnableIT_RXNE(USART3);
LL_USART_EnableIT_ERROR(USART3);
}
