Ahoj,
I not understand what exactly you want to achieve and how you have it connected but…
Your “device” I connected to a ftdi usb ttl converter. Both (The Nucleo and The FTDI) I connected to the PC via USB and on the desktop I have open terminal for each one.
From my point of view code working well and exactly how it was written.
The “dev_rx” will occur only when a data will come from your “device”. In my case, when I send a char from The FTDI to the Nucleo. The “pc_rx” will occur when it will be vice versa, from the Nucleo to the FTDI. The sended char will be always on the opposite side.
BR, Jan
PS: The Serial callback issue occurs only with full Mbed OS5 and not with the Mbed OS5 bare metal profile (that is without RTOS functionality and that mean no mutexes are applied). Bare metal is the only one possibility how is possible to use NUCLEO-F303K8 with latest version of the MbedOS5, because the board have not enough of memory.
“Bare metal is the only one possibility how is possible to use NUCLEO-F303K8 with latest version of the MbedOS5, because the board have not enough of memory.”
is what I wanted to know.