cancel
Showing results for 
Search instead for 
Did you mean: 

UART with STM32F405

mathieusteketee
Associate III

I am having some issues with setting up the UART for my STM32F405RGT6. 

I have a custom PCB which has an CH340C (U7) serial chip and a USB-C (U1) port. See wiring diagram:

mathieusteketee_2-1713962578180.png

I have set up my project in STM32CubeIDE and have connected to my MCU with a ST-LINK/V2 as of now. 

The problem is I cant find the Serial Port for my USB-C in the Device Manager. 

mathieusteketee_4-1713962908821.png

I have installed the CH340C driver and it is up and running on my pc. Link to driver: 

https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/windows-710

 

mathieusteketee_3-1713962786778.png

 

Do I have to set up something in the STM32CubeIDE code to make it work?

Would this be in the stm32f4xxhal_uart.c or  stm32f4xxhal_uart.h file?

 

Thank you!

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

@mathieusteketee wrote:

Do I have to set up something in the STM32CubeIDE code to make it work?


No: things on the PC just see a COM port - they neither know nor care what hardware lies behind it.

If the COM port is not appearing in Device Manager, then nothing on the PC can see it at all.

This is nothing to do with ST - it's all down to the CH340C.

 

EDIT:

Where does your VCC power supply come from?

 

View solution in original post

3 REPLIES 3
Andrew Neil
Evangelist III

@mathieusteketee wrote:

Do I have to set up something in the STM32CubeIDE code to make it work?


No: things on the PC just see a COM port - they neither know nor care what hardware lies behind it.

If the COM port is not appearing in Device Manager, then nothing on the PC can see it at all.

This is nothing to do with ST - it's all down to the CH340C.

 

EDIT:

Where does your VCC power supply come from?

 

Thank you for your reply @Andrew Neil .

 

I see, then the fault must be in the driver or someting hardware. I have however measured the connections between the STM32 (RX/TX) and the serial chip (CH340C). 

 

The VCC power suply comes from a linear voltage Regulator 3v3 (U2). See wiring diagram. 

mathieusteketee_0-1713965653832.png

 

Any tips for the CH340C?


@mathieusteketee wrote:

the fault must be in the driver or someting hardware.


Yes.

 


@mathieusteketee wrote:

I have however measured the connections between the STM32 (RX/TX) and the serial chip (CH340C). 


Your problem is in CH430C, or between it and the PC - not between the CH430C and STM32.

 


@mathieusteketee wrote:

Any tips for the CH340C?


Nothing specific.

Are you sure it's genuine & working?

Check carefully that it's correctly oriented, all joints are good, no shorts, etc.

Do you have a known-working CH430C to compare against?

 

The STM32F405RGT6 has USB - why not use that?