Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 1 month ago.
Mbed-OS Serial Port Bug?
Hello,
I am working on a project that uses 4 serial ports on the LPC1768 processor. I'm using Mbed-OS because I'll need to add Ethernet. I have found that if I declare more than 3 serial ports at the start of the program, the program does not start.
I therefore tried a version of Blinky, with just the serial port declarations at the start, and once again, as soon as you add the 4th Serial port declaration, the program stops and the Mbed flashes its LEDs.
It's not specific to any one port, you can change them around, it just fails as soon as you add a 4th. I also tried using SoftSerial for the 4th port, but still it crashes.
Any suggestions gratefully accepted.
Thanks
Roger
Are you watching mbed debug messages on a terminal? When it fails like this it usually gives you a hint what the problem is.
posted by Graham S. 29 Sep 2017Thanks Graham, I've re-run my test code with terminal attached and it comes up with:
CMSIS-RTOS error: STD C/C++ library mutex initialization failed (status: 0x5, tsk ID: 0x10001E20).
posted by Roger McArdell 29 Sep 2017hi Roger, can you post a code snippet to reproduce this? The error indicates that mutex initialization failed. I woudl liek to see the reason. What version of mbed-os are you using? toolchain?
posted by Martin Kojtal 29 Sep 2017Up until a few moments ago, the Mbed-OS was the latest version (last modified 4 days ago) revision 3241:c9e63f1. The code required to cause the crash is very simple as follows:
DigitalOut led1(LED1);
Serial pc(P0_0,P0_1); UART 3 TX, RX Serial abox_link(P0_2, P0_3); UART 0 TX, RX Serial Screen2Port(P0_10,P0_11); Serial CodecPort(P2_0,P2_1); TX, RX
int main() {
}
However, I’ve just updated to the very latest version released in the last half an hour and it now works! Fantastic. Thank you to whoever has picked this up and fixed the bug.
posted by Roger McArdell 29 Sep 2017