How to create bin file for 2560 on OTA

Hi

I have successfully put the mcudude bootloaer on my MegaBoard and confirmed that I can compile and upload the Blink, when selecting the megacore->ATMega2560, so that is working.
I've also successfully uploaded the OTASkecthDownload, after altering the servername etc.
I can also see in the terminal that it finds a file at the server, downloads it and tries to apply it.

But then nothing happens :frowning:
I've tried

  1. copying the .hex to .bin and then applying that file
  2. copying the elf file to .bin and applying that file

So my question is, since I know that the download and apply functions work, how do I generate the .bin file.
I simply cannot find anything on google shoing this.
Yes I should use Sketch->Export Compiled Binary

But the only binary I find is the one with the bootloader...

Any help whould be VERY much appreciated.

You create platform.local.txt file next to platform.txt in the avr boards package, and put this line into the file:

## Create output (bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" -O binary {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

Then you can use "Export compiled binary" from Sketch menu in Arduino IDE and you will find the binary file next to your ino file in the sketch folder.

Thanks I will do that.
I found out, by trying around that i could do the objcopy and did this manually.

But your suggestion looks amazing. Thanks again

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.