Arm Mbed and Pelion Device Management support forum

NUCLEO-F303K8 SERIAL2_RX (pin D13) not receiving?

I am trying to connect to SERIAL2_RX/SERIAL2_TX on a NUCLEO-F303K8 board via RS232 using an RS232 to TTL level shifter instead of the built-in USB to Serial connection. Transmitting on Pin A7 (PA_2) works as expected but data coming to Pin D12 (PB_4) is not recognized.

I have verified the hardware with a scope and If I switch the hardware to use SERIAL1 on pins D4/D5, everything works as expected. Is there possibly a known conflict with the built-in USB to serial bridge?

Hi Chris,

It looks the RX pin for serial2 is PA_15, please look here.


according to board’s user manual, the default pins which are used for the ST-Link VCP are PA2 and PA15. Where PA15 is not connected to any pin of standart arduino header.

If you want change default pins for STDIO, you need to modify mbed_app.json.

    "requires": ["bare-metal"],
    "target_overrides": {
        "*": {
            "target.stdio_uart_tx": "PA_2",
            "target.stdio_uart_rx": "PB_4"

Thanks for the suggestion.

I have not been able to test it yet. When I try to add a mbed_app.json file to the online compiler, it parses the file but it does not appear to have any affect on the code. I assume this is because my project is using the pre-built mbed library. I can’t include the mbed-dev library with the online compiler because of a size restriction/bug.

I then tried to switch to the cli environment but I can’t get the mbed-dev library to download (it just times out). I have searched the forums and it appears to be a common problem that they are working on.

If you have any suggestions on an easy way to test, I would appreciate it. My trivial test program is here: <<program /users/ChrisABailey/code/Nucleo_Serial_test/>>


Once I got the CLI working the solution works as expected here is a minimal working program (compiled with mbed-CLI):