Skip to main content
Christopher Rutherford
Associate
April 10, 2017
Question

Shared USART3_8_IRQHandler source differentiation

  • April 10, 2017
  • 1 reply
  • 740 views
Posted on April 10, 2017 at 12:24

Using the STM32 HAL API, I am using the HAL interrupt UART receive function 'HAL_UART_Receive_IT'.    In this case I am using UART6, because of this I have to use shared uart 3-8 interrupt handler 'USART3_8_IRQHandler(void)'.  If I wanted to use UART 4 and UART 6, when in the IRQ handler, how would I determine the UART source, so that I can correctly deal with the UART's data? 

Edit: Using STM32f091.

    This topic has been closed for replies.

    1 reply

    Jack Peacock
    Visitor II
    April 10, 2017
    Posted on April 10, 2017 at 13:53

    Look at the SCB->ICSR register.  The low 9 bits contain the interrupt vector, which will identify the USART requesting service.  You have to subtract 16 to skip the core vectors.

      Jack Peacock