[COMPLETED] Combining Blink & Count to the bootloader

STM32duino bootloader aka Maple bootloader
User avatar
ahull
Posts: 1597
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Combining Blink & Count to the bootloader

Post by ahull » Tue Jun 20, 2017 12:25 pm

I was using makebootloader in a general sense, rather than a Makefile, but I guess we could possibly use the abilities of make to do something like

make bootloader maple
or
make bootloader bluepill
or
make bootlader PB1 PC13
or
make bootloader $BUTTON $LED

EDIT:
Actually Make uses the syntax
make target FOO=bar, so the above examples might be

make bootloader BOARD=bluepill |maple |uglyboard etc

or

make bootloader BUTTON=PB1 LED=PC13

.. and so forth ...

.. and have the makefile spit out what we need by building both the bootloader and the blinky with the same parameters and munging the two together.

https://stackoverflow.com/questions/282 ... ne-to-make

What I initially envisaged was a script or program that when called with the correct parameters would generate a suitable boot+blink combined .bin based on the details it was passed. However getting make to do the donkey work might be a more portable solution, since a standalone script would not be OS agnostic, and Make presumably is (for the most part).
Last edited by ahull on Tue Jun 20, 2017 12:29 pm, edited 1 time in total.
- Andy Hull -

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Combining Blink & Count to the bootloader

Post by Rick Kimball » Tue Jun 20, 2017 12:29 pm

If the whole point is to make the usb serial show up, why not skip the blinky?
-rick

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

Re: Combining Blink & Count to the bootloader

Post by ahull » Tue Jun 20, 2017 12:35 pm

As I understand it, the idea is to include the blinky, so that people are less uncertain about whether the booloader worked or not.

Currently if you install just the bootloader, and fire the board on your PC, the serial port does not show up, and there is really nothing to suggest you were successful.

However if you add a suitable blinky, then when they install the bootloader for the first time, you can have the board enumerates as a serial port and the blink sketch blinks the LED, thus proving that something useful as been achieved.

This then removed a bunch of doubts and noob questions.
- Andy Hull -

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

Re: Combining Blink & Count to the bootloader

Post by RogerClark » Tue Jun 20, 2017 12:37 pm

Rick Kimball wrote:
Tue Jun 20, 2017 12:29 pm
If the whole point is to make the usb serial show up, why not skip the blinky?
Yes.

Thats the conclusion I came to.

I just compiled a blank sketch, to get Serial USB to appear

Then ran my utility to combine generic_boot20_pc13.bin with blank.ino.generic_stm32f103c.bin

All I need to do is add something into the makefile so that it runs the mergebin utility after compiling the bootloader bin
Attachments
combined_pc13.zip
(11.43 KiB) Downloaded 5 times

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Combining Blink & Count to the bootloader

Post by Rick Kimball » Tue Jun 20, 2017 1:05 pm

How about spewing the build info about the bootloader on the serial output?

Something like:

"Success! Bootloader version blah and blah is installed."
Then maybe spew out the information about the leds used and buttons used? And a short tutorial on how to use all the features.
-rick

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

Re: Combining Blink & Count to the bootloader

Post by ahull » Tue Jun 20, 2017 1:30 pm

Rick Kimball wrote:
Tue Jun 20, 2017 1:05 pm
How about spewing the build info about the bootloader on the serial output?

Something like:

"Success! Bootloader version blah and blah is installed."
Then maybe spew out the information about the leds used and buttons used? And a short tutorial on how to use all the features.
Good move, the tutorial could simply be a link to the relevant wiki page.
- Andy Hull -

stevestrong
Posts: 1611
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Combining Blink & Count to the bootloader

Post by stevestrong » Tue Jun 20, 2017 2:07 pm

Going back to split/merge and other stuff, I have found this GNU utilities package for windows, it may be handy for someone:
http://unxutils.sourceforge.net/

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

Re: Combining Blink & Count to the bootloader

Post by RogerClark » Tue Jun 20, 2017 10:24 pm

Rick Kimball wrote:
Tue Jun 20, 2017 1:05 pm
How about spewing the build info about the bootloader on the serial output?

Something like:

"Success! Bootloader version blah and blah is installed."
Then maybe spew out the information about the leds used and buttons used? And a short tutorial on how to use all the features.

Thats something I had considered as well.

I initially did a Blink & Count sketch, the. put in some other text.

But I agree, having a paragraph of text that it repeatedly sends once a second is a good idea

User avatar
zoomx
Posts: 498
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Combining Blink & Count to the bootloader

Post by zoomx » Wed Jun 21, 2017 7:39 am

The classic "The quick brown fox jumps over the lazy dog" or "lorem ipsum dolor sit amet consectetur adipiscing elit" that seems latin but mean nothing....
Or an ASCII table.
Or the bootloader identification and version.

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

Re: Combining Blink & Count to the bootloader

Post by RogerClark » Wed Jun 21, 2017 7:56 am

zoomx wrote:
Wed Jun 21, 2017 7:39 am

Or the bootloader identification and version.
I had thought of that, but I'd need to put some magic number marker into the bootloader source, so that the sketch can search and find the version etc

In which case I'd also put the LED port and Pin, so the sketch could read those values and then flash the LED

Post Reply