Arduboy code not compiling using arduino-cli.exe

Here’s what I’m trying to do: In Windows (11), use arduino-cli rather than the arduino IDE to compile programs for the Arduboy. Mostly because I prefer using VS Code over the Arduino IDE.

I can of course just install the IDE and still use VS Code to write code, and when VS Code uses the IDE’s tools then everything seems to work fine. But that means having the IDE installed without using it, which I feel is… unnecessary. Especially as there is a CLI program available, which seems to work for most Arduino projects…

This is my code:

#include <Arduboy2.h>
Arduboy2 arduboy;

void setup()
{
  arduboy.begin();
  arduboy.clear();
  arduboy.print("Hello");
  arduboy.display();
}

void loop()
{
}

And this is what I get:

PS C:\Users\krank\Desktop\ArduboyTesting> arduino-cli.exe compile --fqbn "arduboy:avr:arduboy"
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.
cc1.exe: error: -fno-fat-lto-objects are supported only with linker plugin.


Error during build: exit status 1PS C:\Users\krank\Desktop\ArduboyTesting>

The closest thing I’ve found to someone sharing my problem is this:

but since that relates to the Sanguino rather than the Arduboy, I’m not sure if their solution is applicable and I lack the knowledge necessary to try it myself.

What happens if you try to compile as Leonardo instead of Arduboy?

The ‘Arduboy’ board isn’t actually anything special as far as I’m aware, so if compiling for normal Arduino boards works then compiling for Leonardo ought to work.


If I read that issue properly, the problem is probably here:

I’m not sure if we even have access to that repo to provide a fix though.

If we did, it looks like the fix would be (I think) to add another object to the packages array that uses "version": "5.4.0-atmel3.6.1-arduino2" instead. Though I have no clue if that would break anything else.


I could be wrong, but I suspect the new FX plugin won’t work with Arduino CLI.

Try running the commands:

arduino-cli.exe core update-index
arduino-cli core upgrade arduino:avr

If that doesn’t help I recommend using the Homemade package. The below zip contains an install and update batch file. Extract these into the same directory as the arduino-cli.exe. The install creates a config file in the same folder as the arduino-cli.exe So you can make the hole thing portable if you want

To compile a sketch for arduboy use:

arduino-cli compile --fqbn "arduboy-homemade:avr:arduboy" <path to sketch folder>

arduino-cli-install-update-batchfiles.zip (738 Bytes)

Yes the plugin if for the GUI version only. But when using the command line one can use the fxdata-build.py and fxdata-upload.py python scripts (these are also used by the Arduino IDE plugin)

1 Like

Thanks!

Updating the core index didn’t work (not surprising, as they were freshly installed/downloaded anyway) but the Homemade package did work.

As I installed arduino-cli through Chocolatey through, the batch files didn’t work. So here’s what I did (in case someone else has the same problem and stumbles upon this thread in the future:

  • Went to the Arduino Board Manager in VS Code, clicked “Additional URLs”.
  • Added “https://raw.githubusercontent.com/MrBlinky/Arduboy-homemade-package/master/package_arduboy_homemade_index.json” as a new item.
  • Went back to the board manager, updated indexes.
  • Searched for “homemade”, installed the homemade-arduboy board package.
  • Used the “Arduino: Initialize” to generate a new .vscode/arduino.json file. Chose the Homemade board.
  • Just to be sure that it will also work 100% outside of VS Code: Edited %LocalAppData%\Arduino15\arduino-cli.yaml to add the homemade json-url to the list of additional_urls for the board_manager

Now both the commandline way of compiling and the Arduino:Verify command in VS Code work.

Your tip, looking into the Homemade core, was what allowed me to find this solution, so once again – thanks!

2 Likes