2016-10-11 01:42 AM
I am not able to receive data with any usart (usart1, usart3) with interrupts.
The RXNE interrupt never gets asserted and therefore the interrupt is never called. I have jumpered the TX/RX terminal in ''loopback'' fashion for testing.While debugging, I see the TDR and the RDR data however the RXNE is never asserted.Both TXIE and RXNEIE are asserted in CR1 of the respective USART, however the only one that works is the TXIE.What am I missing? This is a stupidly simple matter that should work, however it has consistently frustrated me.Development with Keil MDK 4.72, have attempted both the ''Standard Peripherals Library'' and the new CubeMX HAL with identical results.Any help/suggestion will be greatly appreciated! #stm32 #uart #interrupt #usart2016-10-11 01:55 AM
Don't look at the USART's registers in the debugger.
The debugger is intrusive, and reading the RDR by debugger has the same consequence as reading it by the processor, i.e. clearing RXNE. JW2016-10-11 03:30 AM
Hi tavares.eduardo,
You can start with these examples, it may be helpful:•STM32Cube_FW_F3_V1.6.0\Projects\STM32F3-Discovery\Examples\UART ,if you are a Cube user•STM32F30x_DSP_StdPeriph_Lib_V1.2.3\Projects\STM32F30x_StdPeriph_Examples\USART\USART_HyperTerminalInterrupt, if you are SPL user.-Syrine-2016-10-11 02:12 PM
Thanks waclawek.jan, I didn't know that having the debugger is intrusive.
I'll keep that in mind in future debug sessions. However after getting the code to work with Syrine's suggestion, having the ''usart1'' debugger open did not disable the RXNE as expected.Thanks Syrine for both suggestions.In fact I had used a very similar code example (for the 303_eval board with the necessary changes), but it wasn't working. I replace all the code with the code from theSTM32F30x_DSP_StdPeriph_Lib_V1.2.3\Projects\STM32F30x_StdPeriph_Examples\USART\USART_HyperTerminalInterrupt.
After making a slight change to enable the receive interrupt before transmission and the code works now.
I will attempt the same thing but with the CubeMX version and go from there.