7 years, 9 months ago.

PC Serial with STM32L476RG

Hello,

I'm trying to use the Serial printf example for the STM32L476RG. However I do not get any display in the terminal program. (Checked already for the correct virtual port.)

When I compile it for the STM32L152RE I get the data displayed on the PC. Used both versions like below but with no success on L476

Serial pc(SERIAL_TX, SERIAL_RX); Serial pc(USBTX,USBRX);

I have another program, reading an sensor and writing it to SD card, that works on both types of HW. Just not the serial for debugging.......

What am I missing here?

  1. include "mbed.h"

-------- Hyperterminal configuration 9600 bauds, 8-bit data, no parity --------

Serial pc(SERIAL_TX, SERIAL_RX); Serial pc(USBTX,USBRX); DigitalOut myled(LED1);

int main() { int i = 1; pc.printf("Hello World !\n"); while(1) { wait(1); pc.printf("This program runs since %d seconds.\n", i++); myled = !myled; } }

Update - problem found

Just in case somebody encounters the same issue.

In my case it was a hardware proplem with the STLink on the Nucleo board. The TX signal from the MCU was also on the RX pin of CN3. (tested with another RS232 USB bridge). Even I updated the firmware on the STlink to the latest version the information was not transmitted over the STLink via USB and virtual comm port. What was also strange is that STlink always connected to comm port 4 (Win10). Another Nucelo L476RG board works perfectly smooth and connects to port 8 or 9.

1 Answer

5 years, 1 month ago.

Hi, yes i have the same problem. The boardnumber is MB1136 rev C C-04 218030112.

And yes always ! -> "What was also strange is that STlink always connected to comm port 4 (Win10)"

Can i fix the TX RX problem manually ?

Best Regards Aaron