AnsweredAssumed Answered

USART communication via RXNE interrupt only reads one char

Question asked by Wapers on Dec 11, 2013
Latest reply on Dec 12, 2013 by Wapers
Hello ST Community,

I am using a STM32F2 uC for my project, and I have configured an USART interface as an UART by not initializing the clock settings. In order to program the device the UART is connected to I send commands that terminate in <CR><LF> through the interface, then this device automatically sends data without needing the uC to transmit anything else, I would only need to read the data.

I have verified the communication via polling, If I execute a reading function on the infinite loop everything seems to work and I get the responses I expected. However, I need to make this reading procedure via interrupts and here is where I have encountered a few problems.

I enable the RXNE interrupt and set the priority with the NVIC structure, the code jumps to the IRQ handler as expected, however it only jumps once or twice maximum and I can't read the whole response. It's also worth noting thata the characters I read are equal to the first characters I expect from a response from the device, so I believe there is something wrong with the way I am managing this interrupt.

My starting point is an example on the Standard Peripherial Library manual where it explains the procedure to set an interrupt on the USART3 interface. I have also tried to use my polling loop on the IRQ handler function with no success.

Any help or directions are appreciated, thanks in advance!

Outcomes