cancel
Showing results for 
Search instead for 
Did you mean: 

Making the DTR/RTS option support CH340

wc7086
Associate II

Almost all development boards produced by Chinese vendors use CH340 as the uart converter chip, I would like stm32cubeprogrammer to be able to control the RTS and DTR of this chip.

If the feature works fine for the FT232RL, I don't know why it won't work for the CH340.

https://community.st.com/t5/stm32cubeprogrammer-mcus/boot0-nrst-control-with-dtr-rts/td-p/255331

 

8 REPLIES 8

You'd need to look at what the CH340 is doing differently at a chip, USB and driver level.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wc7086
Associate II

Here is a log of another program's work where I selected RTS high and DTR low.

 

RTS level high (+3-+12V), reset.
DTR low (-3 to 12V), select BootLoader.
... Delay 100ms
RTS level goes low (-3--12V) to release reset.
DTR maintains low

Pavel A.
Evangelist III

Do you mean, using RTS or DTR to drive BOOT0 ? Then yes, this can be useful.

 

I understand the goals

Definitely not at those voltages

The Win32 COMM API allows for the pins to be driven high/low, ST uses this interface to modulate the pin levels.

You need to be looking at why the CH340 isn't facilitating this at it's pins, this isn't ST's fault / bug

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

But at least there could be an option to set DTR/RTS before connection / unset after? The user can connect these pins as they want ? Their Qt serial library should support it

I seem to have found the problem, the STM32CubeProgrammer can control the pin voltages correctly, but it does not invert the RTS pin before it starts reading the BootLoader information, and the MCU is still waiting for the RTS pin to go back high.

 

I tried pulse mode, but the duration was short enough that it didn't trigger a reset.

Hello @wc7086

The request to control the pulse window length for DTR/RTS is already opened and being worked on by our development team (Internal ticket number : 166876).

This should be available in a future release.

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.