2018-10-24 05: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,
****
2018-10-24 06: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
2018-10-24 06: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);
2018-10-24 07:53 PM
do you use the cube ?
I had to enable the DMA and the Uart interrupt,
please check my posts, here:
2018-10-24 07: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.
2018-10-24 08: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
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
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.
2018-10-25 01:08 PM
Got it now, need enable RX interrupt in CR1. Thx
// RXNE Interrupt Enable
SET_BIT(huart1.Instance->CR1, USART_CR1_RXNEIE);