Computing stuff tied to the physical world

Which boot loader do I have?

In AVR, Software on Mar 7, 2012 at 00:01

Denisj asked on the forum recently whether it’s easy to find out which boot loader is stored in the ATmega. That would indeed be very useful, now that we have a few different versions floating around.

Here’s a new “bootCheck.ino” sketch which tries to identify the boot loader and reports it on the serial port:

Screen Shot 2012 03 06 at 12 23 06

Here’s some sample output when uploaded to the current JeeNodes and RBBBs:

    [bootCheck.2]
      CRC 2048b @ 0x7800 = CD70
      CRC 512b @ 0x7E00 = FD70
    Boot loader: OptiBoot 4.4

The current version only knows about a few boot loaders so far, but it’s table-driven and can quickly be extended.

So now that it exists, let’s use the power of crowdsourcing and make it really useful, eh?

If you’ve got an ATmega328-based board with a bootloader on it, upload this sketch to find out what it reports. If it says “UNKNOWN” and you happen to know exactly what boot loader is present, please let me know what output you get (i.e. the two CRC values) and the name/type of the boot loader, and I’ll add it to the table.

I’ll update the code for each new boot loader. The sketch is maintained as gist on GitHub, so please be sure to get the latest version before you try this. Your boot loader might already be in there!

Note that this is not limited to JeeNodes or RBBBs. Anything with an ATmega328 that will run this Arduino sketch can be included.

  1. Interesting, but doesn’t the fact that you need to upload the sketch – and thus need to know the boot loader in advance to some extent – defy the purpose of this sketch a bit?

    • Yes… a bit… you’ll need to try Duemilanove and Uno to get anything loaded, of course, but the point is that you can figure out which version of the OptiBoot loader it is, for example.

  2. Thanks a lot for the schetch I have loaded into one of the jeenode and first time the output on serial was:ÿÿ;­ç-ãiæó~=ëä

    Then i change the serial speed from 57600 to 9600 and he output was: [bootCheck.2] CRC 2048b @ 0x7800 = 489C Boot loader: Duemilanove

    So i must charge the optiboot 4.4 ? cause is like i still have the Duemilanove. But this is trange cause i have the Arduino 1 in the Tools/Board on arduino ide 1.

    Thanks a lot again Denis

  3. Hmm, wouldn’t it be possible to identify the bootloader via some sort of commandline utility for windows/linux/mac?

    You do get errors when selecting the wrong type of board, so in theory a “trial and error” testrun of all different board types to detect which board type it really is should be possible (albait probably slow).

  4. Perhaps an off-topic question, but what is the advantage / difference of maintaining it as a ‘gist’ instead of a normal entry on Github?

    • Just wanted to avoid having to download the entire JeeLib, just to try out this sketch. It’s not really JeeNode specific…

  5. I suppose this doesnt work with other atmels? I use atmega1284 often with different bootloaders

    • You could adapt it – main issue is the address and size of the boot loader. And different checksums.

  6. Got this on a Nanode RFX Board selected in arduino 1.0 IDE was : Duemilanove w/atmega328

    [bootCheck.2] CRC 2048b @ 0x7800 = F1A0 CRC 512b @ 0x7E00 = 7F7F Boot loader: (UNKNOWN)

  7. The Nanode’s all use a Duemilanove bootloader with a change to make the LED use the correct pin for Nanode boards.

  8. I tested this sketch with my Jeelink v3, and it tells me that it’s a Duemilanove, which is wrong because I selected UNO in the upload board menu and because I KNOW it has optiboot. Ant thoughts?

Comments are closed.