arduino / ArduinoCore-avr

The Official Arduino AVR core
https://www.arduino.cc
1.24k stars 1.05k forks source link

Rebuilding everything #11

Open iglosiggio opened 6 years ago

iglosiggio commented 6 years ago

Hi, i'm currently making a package for a debian based distribution (and hoping to make that package go to debian itself) and when possible packaging binaries is a no-no.

Under the bootloaders folder there are a lot of .hex files that i don't know how to rebuild (missing USB_ID variable on the makefile).

Is documented anywhere how to rebuild all the core? I've downloaded the old versions of lufa and rebuilt most of the things that are here.

Related question. Is everything in the core needed? For example the bootloader Leonardo-prod-firmware-2012-04-26.hex

iglosiggio commented 6 years ago

Related question, how can i rebuild the wifishield firmwares w/o a visual studio license?

facchinm commented 6 years ago

Hi @iglosiggio , first of all, thanks for your effort! The bootloader folder needs a huge cleanup. The only compulsory files are the ones referenced in boards.txt; rebuilding some of them will require Atmel Studio (which is based on Visual Studio, to answer the second question) which is freely available (but not free software). Some other were built with ancient versions of avr-gcc and were not updated to the latest toolchains so it could be quite difficult to build them. Also, functionality would be affected by the rebuild, so they should be tested on every board (also the retired ones).

As a first step, you could only rebuild the ones targeting boards which still have traction (UNO, Mega2560, Leonardo, Micro, Nano, Yun).

I stated to port some of them to the latest LUFA some years ago (https://github.com/facchinm/Arduino_avrusb_firmware), if you need a starting point for the Makefile issues.

iglosiggio commented 6 years ago

If i upload builds with recent gcc versions do you have the necessary hardware to test the firmwares and bootloaders?

facchinm commented 6 years ago

We have the hardware but the time available for these kind of tasks is very limited; normally the rebuilder should take care of testing the builds, or you could release a beta version of the deb and let the community test it and report if the firmwares are ok.

iglosiggio commented 6 years ago

On my side i have the time but not the hardware, it seems like community testing is the way to go.

iglosiggio commented 6 years ago

Update! :smiley: I've managed to build the following bootloaders:

A lot of these builds were done by make <board> and hoping that the makefile didn't mess up with the parameters.

I'm now wanting to make the COMBINED firmware (usbdfu+usbserial) and i will not focus on the wifishield firmware (i don't have time to port the project to a Makefile :disappointed:)

Can you give me any guidance on how the original 8U2 and 16U2 firmwares were built? How do you combine usbdfu and usbserial?

Thanks a lot for your previous responses!

facchinm commented 6 years ago

Great! The combined hex are nothing more than two binaries (in hex format) merged together (as simple as a cat fw2.hex >> fw1.hex). So the procedure is:

And you should obtain something similar to the provided combined hex

iglosiggio commented 6 years ago

hahaha i thought that it was a more involved task :sweat_smile: