Mbed OS on ST-Nucleo-L476RG, problem with serial port

Hi, I wanted to try mbed OS on my ST nucleo L476RG so I made all the required hal/cmsis modules and targets (I used stm32f4 modules as reference), you can find them all on my github: https://github.com/carmelomigliore?tab=repositories
It seems to work, I succesfully ran blinky, tested some GPIOs ecc.
I noticed however an odd issue with serial ports: I connected UART1 pins to my Raspberry Pi’s Tx and Rx pins, but on the serial monitor I got garbage… the string i’m sending is visible, but it’s surrounded of unreadable chars. The strange thing is that the virtual serial over USB works like a charm, but I’m pretty sure that also Pi’s serial works good. What can the problem be?

Is is the same UART (USB RX,TX and the UART 1 you connected to another board?). You can share a screenshot

You can write a simple test to verify Serial functionality, there’s a test in mbed-drivers (loopback) for instance.

No, USBRX,TX are connected to UART2, I used D8 and D2 pins which are connected to UART1. I’ll do some tests and will let you know… Could it be a clock problem? But then why the virtual serial over USB is ok?
Other than that it seems that mbed OS works good on this STM32L4, I’m seriously considering to develop my project on mbed OS rather than classic

Nevermind, I did a test with a gprs modem (adafruit fona) instead of Raspberry Pi and it worked flawlessly, so it was Pi’s fault. Mbed OS on this Nucleo board works great!

can I use mbed classic serial attach fun in mbedos? like this

@zm1011 I provided some more details to the linked question. Yes currently you can.