Serial interrupt hangs after one successfull execution

17 Jan 2017

Hello,

currently I'm running an STM32F446RE Nucleo Board and try get a mbed Project running. Purpose of this project is to read and answer messages from a UART-Bus.

The Controller receives an UART Message via an Serial (Serial s1) Interface, consisting of 3 to 10 Bytes, reads the first Byte, which holds Information regarding the number of following bytes. When enough bytes according to the first byte are collected, the controller beginns to evaluated the received message.

Afterwards the received message is passed via the USB-COM Interface (Serial(USBTX, USBRX)) for debugging purposes. An answer generated according to the received message will be sent using the Interface that received the message, as well als the USB-COM Interface.

The first run through this works perfectly fine. The message is received, answerd and both received message as well as sent answer are paased to the USB-COM.

But the second message, that should be read, doesn't even tick of the RxIRG of the receiving Serial (Serial s1).

What unnerves me, is that the first message, for example, consistiong of 8Bytes is successfully read, but the second one, or any other Byte send to the Interface (Serial s1) won't be recognised after the first message.

Greetings, Chris

18 Jan 2017

Chris, I have a similar interrupt based serial receiver in the project below. It was tested on the Nucleo-L476RG which is close to your hardware.

The receive interrupt handler packs the received data into a circular buffer where you can retrieve it.

In particular, look at

void rxHandler() // serial port receive interrupt handler

int rxbufNotEmpty() // check if rx buffer has data

int pc_getBuf() // get one character from the buffer


The project code is here https://developer.mbed.org/users/nixnax/code/PPP-Blinky

Let me know if that helps,
Nicolas