1 year, 5 months ago.

Serial can't be remapped to other output pins?

I was attempting to change the Serial output from the default USB virtual com one to one of the other supported pin pairs (PB_6, PB_7) but I end up getting an error over USB serial stating "new serial object is using same UART as STDIO"... so can one not use the UART for anything other than debugging over USB? Is there a way to disable that? Seems silly to advertise certain pins as having UART capability when they can't be used for that purpose.

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F031K6T6 microcontroller.

2 Answers

1 year, 4 months ago.

It's advertised correctly. F031K6 has only one serial port, you have an option to remap it to different pins. But since it's connected to USB bridge, debug goes there by default. If you want to use serial for something else you can, but you need to use macro NDEBUG to disable debug (printf).

Although I haven't tried it yet with Mbed OS 5, the SoftSerial library could help, when you are out of serial pins.

posted by Zoltan Hudak 06 Sep 2019
1 year, 4 months ago.

Hi Please read https://os.mbed.com/teams/ST/wiki/STDIO Regards, Jerome