Creating a Bootloader for generic boards

STM32duino bootloader aka Maple bootloader
zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Creating a Bootloader for generic boards

Post by zmemw16 » Sun Jan 10, 2016 12:03 pm

as per usual for me, somewhere, somewhen i've seen a warning saying not to add the directory to the system path.

i think it was windows and eclipse/gdb/openocd tutorial related.

srp

Valery
Posts: 14
Joined: Fri Jan 08, 2016 8:19 pm

Re: Creating a Bootloader for generic boards

Post by Valery » Sun Jan 10, 2016 7:06 pm

ahull wrote:
RogerClark wrote:ok

Im not sure what you mean about binutils but as long as you have fixed the problem, i guess its fine.
sudo apt-get install binutils... provides a bunch of useful binary utilities in Linux. This includes the strings command, which is often used in bash scripts. I'm not sure which of these missing utilities was causing the failure, but it would be interesting to know.
Exectly! I used Ubuntu 14.04 LTS, and "sudo apt-get instal binutils" fixed the problem.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Creating a Bootloader for generic boards

Post by zmemw16 » Mon Jan 11, 2016 12:51 am

if you're doing a boot loader build for a stm32f1 target, i don't understand why the 'system' binutils would
affect a stm32f1 target?

i'm an idiot, elf to bin convert?

stephen

Valery
Posts: 14
Joined: Fri Jan 08, 2016 8:19 pm

Re: Creating a Bootloader for generic boards

Post by Valery » Mon Jan 11, 2016 2:34 pm

I don't know.
I just was looking for the depends, and first I tried "sudo apt-get install binutils".
So it helped.
Maybe this one:
binutils-arm-none-eabi
GNU assembler, linker and binary utilities for ARM Cortex-A/R/M processors

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Creating a Bootloader for generic boards

Post by zmemw16 » Mon Jan 11, 2016 5:44 pm

i haven't got anything 'arm' installed, that does seems strange though, then again i'm using arduino with stm32 and it will be somewhere under ./.arduino15

stephen

evildave_666
Posts: 32
Joined: Mon Apr 27, 2015 11:20 pm

Re: Creating a Bootloader for generic boards

Post by evildave_666 » Sun Oct 23, 2016 2:22 am

I'm running into problems compiling the bootloader on Ubuntu Xenial (16.04 LTS). Ultimately for making a PB12 image for the black pill but I haven't gotten that far yet, I can't even get a working image for an existing board.

Recompiling the blue pill PC13 one results in an image that when flashed looks OK to the point where it does the fast-flash sequence on reset but never correctly enumerates on USB. (The board has of course had its resistor value modified already)

I'm using the standard Xenial arm-none-eabi crosscompile toolchain.

User avatar
RogerClark
Posts: 7157
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Creating a Bootloader for generic boards

Post by RogerClark » Sun Oct 23, 2016 3:12 am

Which version of GCC are you using.

The never versions e.g. 5.x have much harsher code optimisation as standard and the code does not run.

See the readme in github

evildave_666
Posts: 32
Joined: Mon Apr 27, 2015 11:20 pm

Re: Creating a Bootloader for generic boards

Post by evildave_666 » Sun Oct 23, 2016 5:48 am

I was using the standard Xenial-supplied 4.9.3. Thanks, I was able to make a bluepill binary that worked using the 4.8 arduino crosscompiler toolchain. Hopefully the blackpill version will work as well.

Edit: Blackpill works:

Code: Select all

#elif defined TARGET_GENERIC_F103_PB12
        // Blackpill
        #define LED_BANK                        GPIOB 
        #define LED_PIN                         12
        #define LED_ON_STATE            0       

fredbox
Posts: 95
Joined: Tue Jul 07, 2015 4:44 pm

Re: Creating a Bootloader for generic boards

Post by fredbox » Tue Oct 25, 2016 1:29 am

I've added instructions on building the bootloaders using Linux Mint 17.3 and Arduino 1.6.12 with stm32duino to the bootloader wiki. The needed toolchain is already included in the standard stm32duino installation.

evildave_666
Posts: 32
Joined: Mon Apr 27, 2015 11:20 pm

Re: Creating a Bootloader for generic boards

Post by evildave_666 » Tue Oct 25, 2016 1:49 am

I'm kind of concerned what will happen when the arduino-supplied toolchain for arm moves on to 4.9 or higher, the move has already happened for avr in 1.6.10.

Keeping multiple hand-rolled toolchains around is a pain to maintain, and 4.8 is already unmaintained upstream.

Post Reply