Adding bootloader support for the F4

Discussions about the STM32generic core
Post Reply
User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Adding bootloader support for the F4

Post by RogerClark » Tue Aug 29, 2017 3:00 am

Guys

Victor and I have been looking at Chris's bootloader for the F4 and are trying to get it to work with all the F4 cores (libmaple, STM32GENERIC and STM's core)

At the moment STM32GENERIC seems to be the core that is going to be the easiest to get working, as it already has bootloader support for the F1 e.g. via the "Magic" reset code sent via USB Serial.

So hopefully, the same code either already works on the F4 or it should not be too hard to make it work, if the USB Serial code is the same (or very similar)

I'm using the Black F4 board variant, and I've noticed it already has a linker script with offset at 0x4000 (flash start address 0x8004000), so all I've had to do is add the guard #ifdef around the VECT_TAB_OFFSET e.g.

Code: Select all

#ifndef VECT_TAB_OFFSET
#define VECT_TAB_OFFSET  0x00 /*!< Vector Table base offset field. 
                                   This value must be a multiple of 0x200. */
#endif
So I'll submit that as a PR.

I also added a "bootloader" entry to the upload method for the Generic Black F4 board, and I'm currently able to compile a binary in the IDE, but I need to manually upload using the latest dfu-util that supports DfuSe

Hence the next step is for me to automate the reboot via USB Serial, but I don't think I can use the maple_loader.jar as I'm not sure if its capable of sending the additional arguments to DfuSe (e.g. -s 0x8004000) - though I will double check this.

Post Reply