Identify Bootloader?

Bootloader for STM32F103 and STM32F4xx micro-controllers
No special driver is required. Support for Windows, Linux and Mac Operating System
Post Reply
Tenson_UK
Posts: 3
Joined: Mon Jan 09, 2023 1:00 am

Identify Bootloader?

Post by Tenson_UK »

Hello!

I've got a 3D printer (Anker M5) and I want to see if I can flash new firmware on it. The board uses the ST32F407 and runs a bastardised version of Marlin.

I know that I can flash it using DFU mode, but that needs some soldering to set the boot pin and I'd like to find a solution others can also follow easily.

I'm sure the board must have a bootloader installed as the printer is able to update the firmware by flashing it over UART3 from an embedded linux system running on a different board.

So I would like to ask if there is a way to query the MCU and identify the bootloader in use?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Identify Bootloader?

Post by fpiSTM »

It is probably the system bootloader which is used, referring to the documentation:
https://www.st.com/resource/en/applicat ... ronics.pdf

USART3 can be used to flash the STM32F417xx
STM32F407xx_BL.png
STM32F407xx_BL.png (61.51 KiB) Viewed 5933 times
Tenson_UK
Posts: 3
Joined: Mon Jan 09, 2023 1:00 am

Re: Identify Bootloader?

Post by Tenson_UK »

As far as I know, this requires the hardware boot pin to be pulled (low or high I don't remeber), right? Which is not happening, it's all software.

I have read that STM32duino bootloader has a 'key' you can send (leaf) that will active it. How does one send this, just ascii encoded over UART like typing in a terminal?

Is there a software key for HID so I wouldn't need to pull the boot pin manually?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Identify Bootloader?

Post by fpiSTM »

Tenson_UK wrote: Mon Jan 09, 2023 1:04 pm As far as I know, this requires the hardware boot pin to be pulled (low or high I don't remeber), right? Which is not happening, it's all software.
Right, anyway it is possible to jump to the bootloader by software. I don't know the firmware it uses anyway I would advice to request support there (probably Marlin).
Tenson_UK wrote: Mon Jan 09, 2023 1:04 pm I have read that STM32duino bootloader has a 'key' you can send (leaf) that will active it. How does one send this, just ascii encoded over UART like typing in a terminal?
Yes there is a key but it is used with the VCP (USB) not real hardwre U(S)ART.
Tenson_UK wrote: Mon Jan 09, 2023 1:04 pm Is there a software key for HID so I wouldn't need to pull the boot pin manually?
HID BL is a specific bootloader and as you state it flash thanks UART3, I don't think you have this one.
Tenson_UK
Posts: 3
Joined: Mon Jan 09, 2023 1:00 am

Re: Identify Bootloader?

Post by Tenson_UK »

Thanks for helping me understand better!

I found a library for 'HAL Drivers' in the source for the version of Marlin currently running on the board. Is this a bootloader?

Can I use this somehow to flash my own program on the board without the need to mess with the boot pins?

As you said, perhaps I need to seek help from the Marlin groups. Marlin was originally developed for AVR ATMega and used the Arduino bootloader. I don't know much about how they run it on ST32.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Identify Bootloader?

Post by GonzoG »

HAL - Hardware Abstraction Layer
No, it's not a bootloader. Those a libraries that allow for easier access to hardware.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Identify Bootloader?

Post by ag123 »

I think various 3d printers used a sd card based boot loader, e.g. put the file with particular name in the root directory of the sd card and it'd load and flash it.

If you are flashing your firmware using the on-chip boot loaders e.g. DFU, uart, SWD etc, you would need to be sure the firmware has been compiled to run at 0x8000000. That can be done e.g. that you build your own firmware from Marlin's original source codes.

I'd guess your best bet is to find the JTAG/SWD connectors, and that if they are exposed, get a st-link v2 or better v3
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools ... ridge.html
https://www.st.com/en/development-tools ... v3set.html
https://www.st.com/en/development-tools/st-link-v2.html
and you'd be able to update the firmware without using the boot0 pin.
Post Reply

Return to “STM32 HID bootloader”