Flashing an Arduino Leonardo without USB (Custom Arduino Core)

I'd like to make some major changes to the Arduino Core, specifically to the USB code. Basically I want to replace most of the USB descriptors with my own. This means the Arduino will not provide a Serial interface on the USB port anymore when I'm done. (Remember, the Arduino Leonardo doesn't have a USB-to-Serial chip. Everything is done in software.)

When I say Arduino Core, I'm talking about this: GitHub - arduino/ArduinoCore-avr: The Official Arduino AVR core

Now I have a couple of questions:

  • How do you build/flash the Arduino Core in general?
    If I clone that git repository is there some sort of build and flash command that I run? Do I have to tell the Arduinio IDE to use the code from the folder into which I cloned the repo?
  • Is the Arduino Core the firmware?
  • Do I need a special hardware programmer to flash it?
  • Do I have to make changes to the bootloader or use a different one or something like that?

Download the Data sheet on the processor, it has the answers to most of your questions. Several of your questions would be dependent on your software. Try reading the Arduino Cookbook, it will answer the remaining questions.;

How do you build/flash the Arduino Core in general?

You use a second Arduino ( any type ) and program it to be a programmer. Menu Tools -> Programmer -> Arduino as ISP.
Connect this second Arduino to the programming pins on your Leonardo and use that to flash it.

Basic info here
https://www.arduino.cc/en/pmwiki.php?n=Tutorial/ArduinoISP
Plus lots of videos on line.

@gilshultz - what have we told you about replying to posts you know nothing about?

Sorry for the late response. Flashing via ISP seems pretty trivial, thank you.
Is my understanding correct, that flashing via ISP using the Arduino IDE will always rebuild the Arduino Core in addition to my sketch and and flash the whole thing to the Arduino?

Is there a recommended way for working with a modified Arduino Core? The only way I see right now is to modify the contents of /usr/share/arduino/hardware/arduino/avr/ on my machine. But this directory is managed by my system and will be overwritten when I install an update. It would be much easier for me if I could point the Arduino IDE to a different path that I can safely work in.

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