cancel
Showing results for 
Search instead for 
Did you mean: 

HELP! Cannot get NUCLEO-C031C6 to communicate on serial port

CBarb.1
Associate III

I have never had any issues with any of the NUCLEO boards communicating via the serial port but for some reason I can't seem to get this board to send serial data, it does show up as a serial port on the Windows Device manager and everything else appears to work fine but I cannot get it to send any serial data to my serial terminal programs. Have attached my project files on a zip file I am sure I am missing something very simple. Any help or suggestions will be greatly appreciated.

8 REPLIES 8
Karl Yamashita
Lead II

Are you using the Virtual Com Port of the ST-Link? Or some USB to Serial adapter on PB6 and PB7?

If you find my answers useful, click the accept button so that way others can see the solution.
Karl Yamashita
Lead II

If you're using the VCP and you are using the default setup of the Nucleo board, then you need to fix the UART peripheral as it is wrong. From the schematics the VCP uses USART2 on PA2 and PA3. USART1 is incorrect.

If you find my answers useful, click the accept button so that way others can see the solution.
Simon.T
ST Employee

Hello @CBarb.1​ ,

As @Community member​  said, by default the VCP of the STLINK is connected on PA2 or PA3. I saw on your IOC file that you selected PB7 and PB6 as VCP.

So you there are two solutions to have the VCP working either you can change the serial port from USART1 with PB6 and PB7 to USART2 with PA2 and PA3 or you can unsolder the SB27/SB32 and solder the SB31/SB33 following the NUCLEO schematic page 3 (https://www.st.com/resource/en/schematic_pack/mb1717-c031c6-b02_schematic.pdf)

Best regards,

Simon

Yes I am using the VCP of the ST-Link on the Nucleo board, I can't believe that I did not notice such a blatant error. I guess that is what happens when you rely on the default set-up of the peripherals of the Nucleo board. I just reconfigured the serial port to USART2 and now everything works!!

Thank you for your help

CBarb.1
Associate III

I can't believe that I did not notice such a blatant error. I guess that is what happens when you rely on the default set-up of the peripherals of the Nucleo board. I just reconfigured the serial port to USART2 and now everything works!!

Once again thank you all for your help

CBarb.1
Associate III

While I am on a similar subject, one thing I noticed is that if I set the Use Float with printf on the project properties for the C/C++ build I get errors in compilation with this MCU?? It does show that there is no FPU, so how do you get to do a printf to print a float value??

S.Ma
Principal

In this code, the STM32C0316-DK works with STLinkV3minie VCP xor Serial to Bluetooth HC-06 dongle.

SIF.C or BTEL_drivers.C are the entry point files to dig.

STM32C03 has only 2 uart, so check carefully the schematics and jumper/solder bridges to make sure nothing else electrically prevent the STM32C0 to STLinkVCP communication.

Pavel A.
Evangelist III

Vincent, thank you for the demo. The code is a bit involved though.

If I want just to print to the STLinkV3minie VCP of C0316-DK, is swapping of UART1 TX/RX needed? Need to change factory setting of the jumpers?

I have the DK, tried to initialize UART1​ on PB6,PB7 via Drivers/BSP/STM32C0316-DK/stm32c0316_discovery.c. Cannot print anything to ST-LINK VCP.

The schematic is bizarre. Why they waste pins connecting together PB3-4-5-6 and PB7-8? PB0-1-2? (but I'm a software type, don't understand anything in hardware)