2024-05-11 05:34 AM
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
2024-05-11 05:42 AM
You'd need to look at what the CH340 is doing differently at a chip, USB and driver level.
2024-05-11 05:50 AM
2024-05-11 05:58 AM
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
2024-05-11 06:57 AM
Do you mean, using RTS or DTR to drive BOOT0 ? Then yes, this can be useful.
2024-05-11 07:41 AM
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
2024-05-11 08:29 AM - edited 2024-05-11 08:30 AM
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
2024-05-11 10:32 PM
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.
2024-05-20 08:18 AM
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