Hello, I just can’t figure it out, I want to load the firmware into stm32f103 via usb, and also have serial on the same usb.
Which bootloader should I use?
Flash and Serial usb f103
Re: Flash and Serial usb f103
for stm32f103 you need either a st-link v2
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
https://octopart.com/search?q=st-link+v2
or a usb-uart (3.3v) dongle
for a usb-uart you need to set boot0 to program it
alternatively, get a stm32f401/f411 (e.g. 401 black pill) that one has usb DFU built-in on chip. so you can program with a phone cable
but similarly, you need to set boot0 for that.
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
https://octopart.com/search?q=st-link+v2
or a usb-uart (3.3v) dongle
for a usb-uart you need to set boot0 to program it
alternatively, get a stm32f401/f411 (e.g. 401 black pill) that one has usb DFU built-in on chip. so you can program with a phone cable
but similarly, you need to set boot0 for that.
Re: Flash and Serial usb f103
ST-Link is there, the question is that people flash the bootloader, after which a UART appears on the USB and you can flash the STM using the UART
Re: Flash and Serial usb f103
It's strange, with stm32f103C8 64k, Serial did not work, but with stm32f103C8 128k, it worked.
How can you flash using USB?
As I understand it, there is a substitution of concepts. Roger does not have a bootloader, this is an addition to his kernel.
Is there a bootloader that could be used to flash STM?
How can you flash using USB?
As I understand it, there is a substitution of concepts. Roger does not have a bootloader, this is an addition to his kernel.
Is there a bootloader that could be used to flash STM?
Re: Flash and Serial usb f103
You can use roger's bootloader (https://github.com/rogerclarkmelbourne/ ... bootloader) or HID bootloader (https://github.com/Serasidis/STM32_HID_Bootloader).
Re: Flash and Serial usb f103
Yes, if you specify the Arduino settings correctly and upload the Roger bootloader, it works. But not on all boards. At some point, Serial is there, but does not want to be attached, the bootloader breaks
Re: Flash and Serial usb f103
1. Flash https://github.com/rogerclarkmelbourne/ ... 0_pc13.bin.
I flashed using ST-Link,
BOOT0-0,
BOOT1-0
2. Then flash it through Arduino, only using Maple DFU Bootloader 2.0.
If after step 1 you flash it using ST-Link, then Maple DFU Bootloader 2.0 stops working.
Serial is enabled in Arduino-Tools-
U(S)ART support: "Enable (generic "Serial")" and
USB support (if available): "CDC (generic "Serial supersede U(S)ART)"
P.S.
ST-Link after step 1 stops working, in order to restore operation, I used ST-Link Utility to flash a ready-made binary of any sketch, you need to hold Reset on the stm board, click on “Program...” or “Programm & Verify. ..", release Reset.
I flashed using ST-Link,
BOOT0-0,
BOOT1-0
2. Then flash it through Arduino, only using Maple DFU Bootloader 2.0.
If after step 1 you flash it using ST-Link, then Maple DFU Bootloader 2.0 stops working.
Serial is enabled in Arduino-Tools-
U(S)ART support: "Enable (generic "Serial")" and
USB support (if available): "CDC (generic "Serial supersede U(S)ART)"
P.S.
ST-Link after step 1 stops working, in order to restore operation, I used ST-Link Utility to flash a ready-made binary of any sketch, you need to hold Reset on the stm board, click on “Program...” or “Programm & Verify. ..", release Reset.
- Attachments
-
- USB_Serial.jpg (48.32 KiB) Viewed 17692 times
Re: Flash and Serial usb f103
if you are using stm32f103c8 blue pill you need to choose
generic_boot20_pc13.bin
https://github.com/rogerclarkmelbourne/ ... 0_pc13.bin
and flash that using st-link (or uart)
if you are in windows use stm32cube programmer to flash that boot loader
https://www.st.com/en/development-tools ... eprog.html
in linux the options varies, including this as well as one of the options.
stm32cube programmer is recommended with the 'official' stm core, it is integrated with arduino IDE including the 2.x versions.
after you have done that, the next time connect your phone usb cable (or press reset) and it should blink quickly, you need to click upload in the next 4-6 seconds to upload your sketch during those blinks
alternatively, click sketch > export compiled binary and the bin file for you sketch should be in the sketch project folder.
you can then flash that using stm32 cube programmer, and during those fast blinks
there may be more configs needed such as to choose alternate 2 for DFU if you use roger's bootloader to upload your sketch using a phone usb cable.
and in stm32cube programmer, do not write protect or copy protect the firmware (check the configs in stm32cube programmer)
if you select any of those options, the next time you if program the board, you need to *connect under reset* which is a special method to bypass the protection and only using st-link that is possible.
generic_boot20_pc13.bin
https://github.com/rogerclarkmelbourne/ ... 0_pc13.bin
and flash that using st-link (or uart)
if you are in windows use stm32cube programmer to flash that boot loader
https://www.st.com/en/development-tools ... eprog.html
in linux the options varies, including this as well as one of the options.
stm32cube programmer is recommended with the 'official' stm core, it is integrated with arduino IDE including the 2.x versions.
after you have done that, the next time connect your phone usb cable (or press reset) and it should blink quickly, you need to click upload in the next 4-6 seconds to upload your sketch during those blinks
alternatively, click sketch > export compiled binary and the bin file for you sketch should be in the sketch project folder.
you can then flash that using stm32 cube programmer, and during those fast blinks
there may be more configs needed such as to choose alternate 2 for DFU if you use roger's bootloader to upload your sketch using a phone usb cable.
and in stm32cube programmer, do not write protect or copy protect the firmware (check the configs in stm32cube programmer)
if you select any of those options, the next time you if program the board, you need to *connect under reset* which is a special method to bypass the protection and only using st-link that is possible.