USART1_IRQHandler ISR routine not been called?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 5:23 PM
Hi,
I am using a STM32F407VE MCU board with USART1 as debug port. I am able to output string to USART1 but not receiving. This ISR routine never been trigger after I enter some chars from teraterm.
I do believe I setup the ISR in .s file and enable ISR routine. Not sure whats going on.
Any comments?
Thanks,
****
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 6:02 PM
Enable ISR routine? What is this - enable NVIC or UART interrupts? Both are needed. Do you use ST's HAL or LL library or something home rolled?
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 6:48 PM
I believe I did both. See below. Thx
In startup_stm32f407xx.s -
.word USART1_IRQHandler /* USART1 */
.word USART2_IRQHandler /* USART2 */
.word USART3_IRQHandler /* USART3 */
In uart.c -
/* USART1 interrupt Init */
HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(USART1_IRQn);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 7:53 PM
do you use the cube ?
I had to enable the DMA and the Uart interrupt,
please check my posts, here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 7:58 PM
Check for framing, parity and noise type errors, and clear them.
Could just be it's not receiving anything properly. RX not enabled, wrong pin, noisy signals, inversion.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-24 8:48 PM
If you use HAL_UART_Receive_IT or HAL_UART_Transmit_IT - these functions enable needed UART interrupts (*), so you're done. Check other reasons why interrupt does not arrive. Functions without _IT in their name simply do not use interrupts, if you use these functions, it is normal that no UART interrupts occur.
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 11:31 AM
I do get into USART1_IRQHandler() for TX just not for RX when I have input from teraterm through Prolific USB to serial Comm port. Thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 12:25 PM
Kind of hard to debug with no code, no schematic, and no scope traces.
Make sure the status register isn't flagging errors, that the interrupt for RXNE is enabled. Check peripheral registers in debugger. Check wiring and pin numbers. Probe signal at pin.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 1:08 PM
Got it now, need enable RX interrupt in CR1. Thx
// RXNE Interrupt Enable
SET_BIT(huart1.Instance->CR1, USART_CR1_RXNEIE);
