florisla / stm32loader

Flash firmware to STM32 microcontrollers using Python.
GNU General Public License v3.0
109 stars 53 forks source link

How to integrate a CH340C onto a board - for both normal operation and reprogramming #53

Closed crosswick closed 2 years ago

crosswick commented 3 years ago

Hi, I hope this is a good place to ask a question like this.

I presume that the electrical connections as suggested (Serial DTR to MCU RESET, Serial RTS to MCU BOOT0) are meant to only be made when reprogramming an MCU, right?

I ask because when I simply power up a CH340C, the RTS pin is high, leading a connected GD32 (with the same boot pin scheme as an STM32) to enter the boot loader, instead of just powering on, which I would want when integrating the serial chip on a hardware design - so as to reprogram it easily without any extra hardware.

I'd be interested to know if there's any known good solutions to this; one thing I came across was the way a CH340 is integrated into this design, see the final page of the schematic: https://github.com/FYSETC/FYSETC-Cheetah/blob/master/hardware/1.2/Cheetah_Board%20V12b%20SCH.pdf

Thanks in advance for any help/pointers.

florisla commented 3 years ago

You're right, you only need these connections during programming.

I'm not a board designer so I can't offer good advice.

After the CH340C is booted, you can set RTS low in software. Or you could bypass the connection with a jumper or pushbutton in your design.