Serial broken on Nucleo L152RE on mbed 81

27 Mar 2014

Trying the basic serial test at https://mbed.org/teams/ST/code/Nucleo_printf/

Using mbed library 78 as included if the above is imported, all is fine. Upgrading to latest mbed library version 81 I get this:

Error: Identifier "SERIAL_TX" is undefined in "main.cpp", Line: 8, Col: 11 Error: Identifier "SERIAL_RX" is undefined in "main.cpp", Line: 8, Col: 22

When tried with Nucleo F401RE board this compiles and runs OK.

Thanks

Andrew

27 Mar 2014

I guess they forgot to re-add them for that platform.

What happened is that SERIAL_TX and SERIAL_RX were only used for the Nucleo platform. Every single other platform uses USBTX and USBRX for the same task: So if you replace it with those it should work fine.

Now in the end the guy from STM decided to put it back anyway for backwards compatibility, or maybe with other non-mbed STM platforms. Apparantly he missed a platform.

That said, I would advice to simply use USBTX and USBRX on all platforms, precisely because you an use it on all platforms.

28 Mar 2014

It seems that USBTX and USBRX work on both the Nucleo F401RE and the L152RE so I'd suggest the example needs to be fixed t be compatible with both.

thanks

Andrew

03 Apr 2014

For the ST Nucleo F401RE USBTX and USBRX is not working now. SERIAL_TX and SERIAL_RX work fine.

It would be indeed great to have USBTX and USBRX for all platforms at least as an alias. Otherwise the documentation would become a nightmare and portability would go down the drain.