5 years, 4 months ago.

mbed v116 breaks F746Nx serial RX interrupts


When migrating the mbed library from v115 to v116, USB serial RX interrupts stopped working (kind of).

1. Receiving single characters is ok, the RX serial interrupt works fine.

2. When receiving character bursts, the issue appears. Example is a PC's UP arrow. It sends a 3 character sequence of:

(ESC) [ A

When the UP arrow burst occurs, the CPU freezes. All other RTOS tasks also freeze.


Question relating to:

The STM32F746G-DISCO discovery board (32F746GDISCOVERY) is a complete demonstration and development platform for STMicroelectronics ARM® Cortex®-M7 core-based STM32F746NGH6 microcontroller.

1 Answer

5 years, 4 months ago.


can you please post this on github as an issue for mbed repository please? I'll tag the maintainers and someone wil have a look. please provide a code snippet to reproduce the issue. Thanks

I have posted the same question to github. Still waiting for a reply...

I've tracked the problem down to the way I echo back the received character. When the ISR receives a character, the ISR echoes back the character, along with a couple escapes sequences, making the echoed character look green on the console:

//defines, buffer and variables
#define DOGREEN             "\033[0;32;2m"
#define DONONE              "\033[0m"
#define PCRXBUFSIZE         128 
bool LocalEcho = true;
uint32_t pcRxQty = 0;                       //RX data counter/pointer
char pcRxBuffer[PCRXBUFSIZE];               //RX data buffer

//the failing line inside the ISR that echoes back the character
    if(LocalEcho) pc.printf("%s%c%s", DOGREEN, pcRxBuffer[pcRxQty - 1], DONONE);

If I echo back only the character without the escape sequences, everything is ok. If I use the line above, the F746NG freezes, but only with v116 of the mbed library and when a RX character burst happens (ESC) [ A. The K64F works fine with the above line and v116.

I have been using this echoing technique for years with mbed devices.

posted by Kevin Braun 23 Mar 2016