BIN FILES

Dear all, Is it possible to create a bin file, which includes everything and then flash the .bin file on the board? (From what I’ve seen RIOT OS doesn’t support this, right???)

Thank you in advance!

Best, Ilias

Hi Ilias!

Hi,

I guess you need glasses :wink:

If you have your target exported, then 'make' creates a binary image. 'make flash' flashes this image onto your board.

Cheers, Ludwig

If you want a binary file which is an exact byte-for-byte copy of the microcontroller ROM you can use objcopy to convert from ELF to raw binary. The RIOT build system also produces a HEX file for flashing, which is a plain-text variant of the raw binary.

arm-none-eabi-objcopy -O binary myprog.elf myprog.bin

You will not, however, need any of this manual handling for flashing the supported boards, make flash is all you need.

Best regards, Joakim

Thank you all for your replies! @Ludwig I do wear glasses :slight_smile:

The problem is that I have a board based on samr21 but there is no edbg usb port, on the datasheet it mentions only reprogramming using a usb pen drive and a .bin file, I know nothing about the bootloader.

Hi Ilias!

Hi again, I was given an Atmel Ice device, has anyone used it? Thank you in advance!

Your Faithfully, Ilias Seitanidis

The blue one? It’s basically the same hardware as a SEGGER JLink but the firmware locks it to Atmel only devices. You can use JLinkExe to interact with it.

Yes, I have one, and I use it to burn and to debug. I'm using openocd.

What do you want to know?

Thank you very much for your reply! I’m starting from scratch on using an external debugger. Everything is valuable :slight_smile:

To burn a program you only need the ELF file. No need to convert it to BIN. Notice that I'm using a SODAQ Autonomo, with an Atmel SAMD21J18A. The openocd command is:

   $ MYELF=tests/driver_bme280/bin/sodaq-autonomo/driver_bme280.elf    $ openocd -d2 -f boards/sodaq-autonomo/dist/openocd.cfg -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{$MYELF}} verify reset; shutdown"

To be able to debug you must start openocd as a daemon waiting for GDB to connect. (You are using GNU I hope. :slight_smile:

   $ openocd -d2 -f boards/sodaq-autonomo/dist/openocd.cfg -c "init; halt; at91samd bootloader 0"

Then start gdb with the ELF file.

   $ arm-none-eabi-gdb -i=mi tests/driver_bmp180/bin/sodaq-autonomo/driver_bmp180.elf

In gdb you first connect to the target, give it a reset, set breakpoints and give it a go.

   (gdb) target remote localhost:3333    (gdb) monitor reset halt    (gdb) b main    (gdb) c

And of course, YMMV