Hi! I’m just getting started with Mbed on a NUCLEO-F103RB board and am seeing some weird issues with USART1 using the UnbufferedSerial class. (I’m using UnbufferedSerial for this because this is supposed to be a half-duplex connection and I want to try to inspect the timing of the bytes.)
UnbufferedSerial ser1 (NC, PA_10, 9600);
UnbufferedSerial ser3 (NC, PB_11, 9600);
My program is a simple serial spy using the RX lines of USART1 and USART3 to spy on another PCB serial TX and RX lines and send out a report over USB (USART2). I’m using PA_10 for USART1_RX and PB_11 for USART3_RX. I can receive either line on the target just fine with USART3, but not with USART1.
When I use an oscilloscope, I notice that the voltage doesn’t swing from 3.3V to ground, but rather only goes down to about about 1.5V, which suggests that the peripheral is not configured properly (not acting like an input). I suspect that there is an initialization problem, but penetrating the thick outer shell of of the HAL through the mists of C++ makes it difficult to find where exactly things are getting initialized. I also wonder if some other component is configuring itself on top of PA_10 in the background somewhere.
What’s even more strange, when I try to change to use the alternate pins for USART1, nothing seems to change.
UnbufferedSerial ser1 (NC, PB_7, 9600);
Not only does PB_7 not react to the serial data, if i switch the wire back to PA_10, this pin still transmits garbage as though it were still configured as USART1_RX.
Any ideas how to get USART1 working on either pin? Thanks!