Creating a Bootloader for generic boards

Bootloader for boards that don't have the addition hardware found on the Maple mini, which resets the USB
User avatar
RogerClark
Posts: 5936
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Creating a Bootloader for generic boards

Post by RogerClark » Fri Jul 10, 2015 8:54 pm

if you want to just build the bootloader

just use the files in separate stm32duino-bootloder repo, not the sub folder in the arduino_stm32 repo

The bootloader is built from a makefile, there are multiple build targets and multiple configurations
so if you want to build it using Eclipse, you will need to work out how to replicate what the make file does.

I dont use eclipse that often, so i suggest you post to an Eclipse related forum and ask them how to build a project that uses a makefile with multiple build targets

dlankvel
Posts: 4
Joined: Thu Jul 09, 2015 2:27 pm

Re: Creating a Bootloader for generic boards

Post by dlankvel » Mon Jul 13, 2015 10:54 am

>We don't build the bootloader with the Arduino IDE, or any other IDE for that matter, but straight with gcc in the command line.

Check!! I could indeed build the bootloader with CLI without any problems :-)

Thanks foor the help !

Regards,

dlankvel
Posts: 4
Joined: Thu Jul 09, 2015 2:27 pm

Re: Creating a Bootloader for generic boards

Post by dlankvel » Mon Jul 13, 2015 11:02 am

And in Eclipse it's working fine out of the box aswell. I just imported the repository as new Makefile project and set the C/C++ build command to 'make all' , then build the project without any further issues.

So my main problem was the that CoIDE does not have the ability to the the build command manually like Eclipse..

Problem solved..

Thanks..

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

Re: Creating a Bootloader for generic boards

Post by RogerClark » Mon Jul 13, 2015 11:31 am

BTW.

the default Makefile target may either do nothing, or build the Maple mini.

if you want to build another target, e.g. a board that doesnt have the Maple USB hardware, you may need to change something in your Eclipse project which has the same effect as specifying a build target when you run make from the command line

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

Re: Creating a Bootloader for generic boards

Post by Valery » Fri Jan 08, 2016 8:57 pm

Roger, Why do you use PC14 for button by default?
PC14 - PC15 are connected to RTC OSC, and I want to use RTC.

I tried to make generic-pc13 with changed button BANK to PORTB, and Button PIN to 9 (like Maple mini), but it doesn't work. ( It looks like working, LED is Blinking, but PC cant to recognise USB device)
I have tried to make generic-pc13 with default settings (Button on PC14) and compare the result with bin file from /binares and my resulting .bin file was 20 Byte smaller... It Blinking the led, but DFU doesn't work...

Could anybody make the bootloader for PC13_BUTTON_PB9?

#elif defined TARGET_GENERIC_F103_PC13_BUTTON_PB9

#define LED_BANK GPIOC
#define LED_PIN 13
#define LED_ON_STATE 0

// Button (if you have one)

#define BUTTON_BANK GPIOB
#define BUTTON_PIN 9
#define BUTTON_PRESSED_STATE 1

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

Re: Creating a Bootloader for generic boards

Post by Valery » Sat Jan 09, 2016 9:33 am

The problem has been solved by updating binutils :-)
I'm happy, it's working perfect!!!

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

Re: Creating a Bootloader for generic boards

Post by RogerClark » Sat Jan 09, 2016 9:17 pm

ok

Im not sure what you mean about binutils but as long as you have fixed the problem, i guess its fine.

User avatar
ahull
Posts: 1511
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Creating a Bootloader for generic boards

Post by ahull » Sat Jan 09, 2016 11:46 pm

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.
- Andy Hull -

zmemw16
Posts: 1156
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:02 am

Code: Select all

binutils                         2.25-5                       i386         GNU assembler, linker and binary utilities
binutils-avr                   2.24+Atmel3.4.4-1  i386         Binary utilities supporting Atmel's AVR targets
binutils-multiarch         2.25-5                      i386         Binary utilities that support multi-arch targets
i suspect it might be the last one?
srp

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

Re: Creating a Bootloader for generic boards

Post by RogerClark » Sun Jan 10, 2016 9:29 am

OK.

I've only ever built the bootloader on Windows, and have not had any issues.

I just put the Arduino GCC Arm compiler in my PATH and everything seemed to work OK.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest