Manually Installing the "ArduinoCore-megaavr" Board Package into IDE

i have downloaded the arduino supported megaavr board package .ZIP file from github.

arduino provides a custom core/board package install procedure on their support portion of the website : this doesnt work. pls dont quote it as a solution

Looking for any workaround on how to manually installing the megaavr board package into my IDE. I have admin rights on my computer. the method shud be free of any autodownloads, handshakes, etc with an external server.

Reason : my comp has IT firewalls and cybersecurity and prevents any Network downloads via the manage libraries TAB in the IDE and i cant use that.

ANY HELP IS GR8 HELP

Hi @bbenji74.

Please provide a detailed description of what you mean by "doesnt work" in a reply on this forum thread, including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

Very simple followed all the steps provided in that page. and then after symlinking the Arduinocore -APIs and restarting the IDE, the Nano Every doesnt appear on the boards manager list

ptillisch, u cud also try this, install a fresh IDE version and it will not have the megaavr board package installed by default and try doing that page instrauctions to manually install the megaavr package and pls see if u can succeed, procedure doesnt take more than 5 mins

Can you please post a link to those instructions.

Using IDE 1.8.19 on a personal computer (running Linux) and using the board manager in the IDE did not give me any problems installing the megaavr board package (note that I don't say that you are not experiencing a problem).

1 Like

my IDE is on windows 10

From memory, I did not have a problem with Windows 10 either. Please answer the question that I asked which instructions you are following.

Since I had to go find it myself already, I can answer @sterretje's question. The instructions are here:

@bbenji74 I discovered there is an error in those instructions:

The instructions indicate that the installation should be made under the path <sketchbook location>\Arduino\hardware, resulting in an installation folder structure something like this:

<sketchbook location>/
├── Arduino/
│   └── hardware/
│       ├── arduino-git/
│       │   ├── megaavr/
│       │   │   ├── boards.txt
│       │   │   ...
│       │   ...
│       ...
...

However, this is wrong. The installation must be made under the path <sketchbook location>\hardware (note the hardware folder is directly under the sketchbook folder, not under an Arduino subfolder of the sketchbook folder). The correct installation folder structure is like this:

sketchbook/
├── hardware/
│   ├── arduino-git/
│   │   ├── megaavr/
│   │   │   ├── boards.txt
│   │   │   ...
│   │   ...
│   ...
...

So if your installation has the wrong folder structure, do this:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
  2. Use your file manager to move the hardware folder up a level, so that it is now directly under the root of the sketchbook folder.
  3. Delete the superfluous <sketchbook location>\Arduino folder to avoid any future confusion.
  4. Start Arduino IDE.

Hopefully you will now see an "Arduino megaAVR Boards" item under the IDE's Tools > Board menu.


I have submitted a correction for the error in the Help Center article:

Perfect Ptillisch, no wonder i didnt see the board bcos of wrong folder structure.. let me try with the correct folder structure. hope fully it solves finally...let me feedback soon

Bingo it worked Ptillisch....but compilation threw up this error...

In file included from sketch\2WPUpgradeDemo.ino.cpp:1:0:

C:\Users\bvu3kor\Documents\Arduino\Hardware\arduino-git\megaavr\cores\arduino/Arduino.h:23:10: fatal error: api/ArduinoAPI.h: No such file or directory

#include "api/ArduinoAPI.h"

      ^~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Nano Every.

wondering how to clear this error... is this an error in the symlinking step of the Arduino APIs? how to clear it

Yes, I think so. Please try performing those instructions in the tutorial again:

I just tested them here with a manual installation of the "Arduino megaAVR Boards" platform on my Windows machine and the instructions are correct.

Let us know if you have any problems or questions while following the instructions.

Ptillisch, thanks for the hint. But, i am not so good at cmds ...

i am sure i am doing wrong with this cmd...

can u explain what i really need to do in this cmd example given in the instructions :

will await ur explanative comments and then try the cmd to solve the problem..

What the author of those instructions neglected to explain is that the provided mklink command is not the actual command you must run, but a "template" of the command. The reason they didn't provide the actual command is because the reader might have the files stored at any arbitrary location on their hard drive. So it is necessary for the reader to adapt the command to use the appropriate paths for the files on their computer.

The <core_path> and <ArduinoCore-API_path> in the command are placeholders that indicate where you are expected to fill in information that is specific to your computer before running the real command.

"<core_path>"

From the compilation error message you shared, I can tell that <core_path> placeholder should be replaced with this path:

C:\Users\bvu3kor\Documents\Arduino\Hardware\arduino-git\megaavr

"<ArduinoCore-API_path>"

However, I don't know where you stored the contents of the arduino/ArduinoCore-API repository when you performed these instructions from the tutorial:

Download and extract the API, or clone it, into a directory of your choice.

For the sake of this discussion, let's say you stored it at this path:

C:\Users\bvu3kor\Documents\ArduinoCore-API

Putting it together

Given the two paths mentioned above (keeping in mind that the second one was purely hypothetical), the mklink command you would need to run would then be:

mklink /D "C:\Users\bvu3kor\Documents\Arduino\Hardware\arduino-git\megaavr\cores\arduino\api" "C:\Users\bvu3kor\Documents\ArduinoCore-API\api"

tried the cmd with the right paths... here is the result below snapshot

the compilation error still continues...what do i do? is anything wrong with my core installation?

The "Cannot create a file when that file already exists" error indicates that you already created a symlink during a previous attempt at running the mklink command.

The fact that the compilation error continues indicates there is a problem with the existing symlink. The solution will be to delete the existing symlink.

You can delete the symlink using Windows File Explorer, or by running this command from the cmd terminal:

rmdir "C:\Users\bvu3kor\Documents\Arduino\Hardware\arduino-git\megaavr\cores\arduino\api"

:warning: Please be careful when deleting things from your computer. When in doubt, back up!


After deleting the bad symlink, run that mklink command again. Hopefully this time it will work without any error and you will then be able to compile and upload for the Nano Every board.

thanks ptillisch for the rmdir cmd. i did it and then ran the mklink and the symlink step is now done and the Nano every board project/s compiles and upload w/o any error.

This is a big milestone for installing board packages in the presence of IT firewalls on ur machine manually. It is understandable that cyber security is needed, but for genuine project needs, if a workaround is there then it is gr8. I have reached there finally.

So the "How to install custom core / board packages options in IDE" is the solution and hopefully they correct the folder structure error u pointed out.

You are welcome. I'm glad it is working now.

They accepted the fix I submitted earlier today. Hopefully this will make things a little easier for the next person who follows the tutorial.

Regards,
Per

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