UART Programming Auto BOOT0/RST

Post here first, or if you can't find a relevant section!
Post Reply
jefflongo
Posts: 1
Joined: Sun Jan 12, 2020 8:34 pm

UART Programming Auto BOOT0/RST

Post by jefflongo »

Hi all,

I'm new here. I'm currently working on a custom STM32 development board targetting STM32L021F4. I currently am able to program my board using both an ST-LINK as well as through the embedded bootloader via UART using an FT232RL USB<->UART bridge.

At the moment, I use a switch to toggle the BOOT0 pin high then use an on-board reset button to enter the embedded bootloader. However, I was wondering if it would be possible to use the FT232RL for automatic BOOT0 handling and resetting. From what I've researched so far, it seems STM32CubeProgrammer is the go-to for bootloader programming (I've also tried programs like stm32flash and FLASHER-STM32 but neither seem to be updated as they do not support my model of STM32). I've monitored the DTR and RTS pins to see if they might prove useful for this purpose. There does seem to be some activity on these pins which I thought might be useful:

Image

However, this causes the chip to enter the bootloader mode and then exit it at the second reset, thereby not allowing a connection to be completed. I'm not sure what purpose they are going for here. I can't be the only one who wants effortless USB programming for their STM32, and my chip does not have the option for DFU programming, so has anybody had any luck at getting touchless USB programming working with the embedded bootloader? Thanks!
User avatar
Just4Fun
Posts: 28
Joined: Thu Dec 19, 2019 10:45 am
Answers: 1

Re: UART Programming Auto BOOT0/RST

Post by Just4Fun »

Hi,
I've already done a similar thing for a custom board using a STM32F030R8 to automate the download from Arduino IDE + ST core, using the serial bootloader (through the STM32CubeProgrammer "interface") without modify the official ST core (only a little edit to boards.txt is needed only for Linux). The board is compatible with the ST Discovery with the same MCU.

Video 1 (Arduino IDE Win 10): https://www.youtube.com/watch?v=6FbTYJuxQKg

Video 2 (Arduino IDE Linux): https://www.youtube.com/watch?v=EtEQLoG5bts

Video 3 (edit to boards.txt for Linux): https://www.youtube.com/watch?v=4xNIKfevhF4

Video 4 (STM32CubeProgrammer): https://www.youtube.com/watch?v=XYIEiJyhBWA

Video 5 (emulating a 8080 CPU with Basic ROM): https://www.youtube.com/watch?v=JCPZ5kLHKaI


Image

My objective was to automate the download from Arduino IDE + ST core only, so I analyzed the DTR/RTS signals driven by Arduino IDE + ST core during the download process to find a simple circuit to drive NRST and BOOT0.
Another point is that these signals can have little differences using different serial-USB chips. My circuit is optimized to use a CH340 serial-USB adapter.

More, the DTR/RTS behavior is different between Win 10 and Linux, so I added a jumper to select the OS used.

I've added also a "download button" that allows to reset and activate the serial bootloader without messing with jumpers, for "manual" activation. This is shown in the Video 4 (the auto-reset circuit for Arduino IDE can be disabled with a switch) using the STM32CubeProgrammer.

I'm preparing a page on hackaday.io here: https://hackaday.io/project/168941

I can't attach the schematic here because this site refuses to do that... :( ...but you can see a preview here: https://mcu.selfip.com/viewtopic.php?f=24&t=171#p1449
Post Reply

Return to “General discussion”