Mac Arduino IDE location of AVR Tools

Hello,

I am trying to figure out where AVR tools are located on a Mac Intel (running macOS Catalina and Arduino IDE version 2.0.4).

Online I have found the following location:

/Applications/Arduino.app/Contents/Java/hardware/tools/avr

When I check in Arduino.app I can find the Contents folder but there is no Java folder. Many of the posts online regarding this mention that the Arduino IDE is pre-version 2. I am wondering if AVR tools have been moved since version 2.

I would appreciate any assistance in locating the AVR tools. Thank you for your help.

You can search for a directory called Arduino15; all board packages are in there. I'm not a Mac user, in Windows it would be C:\Users\yourUsername\AppData\Local\Arduino15\packages\arduino\hardware\avr.

1 Like

Thank you @sterretje for your reply, yes on Macs I can find it here:

~/Library/Arduino15/packages/arduino/hardware/avr

However, I am still unable to setup my Digispark ATTINY85 on macOS. This is my first time with Arduino and so I am trying to follow this setup guide:

Digispark ATTINY85 Initial Setup on macOS + Hello World

Everything is going well and I am at the final stage where I need to verify the 'Hello World' script but I get the following error message:

fork/exec /Users/XXXXX/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable
Error compiling for board Digispark (Default - 16.5mhz).

The guide explains that the solution is to "substitute (link) the built-in, outdated AVR tools that Digistump config looks for, with the new, updated one included in the Arduino IDE" by doing the following:

$ cd ~/Library/Arduino15/packages/arduino/tools/avr-gcc
$ mv 4.8.1-arduino5 orig.4.8.1
$ ln -s /Applications/Arduino.app/Contents/Java/hardware/tools/avr 4.8.1-arduino5

After doing the above, I still get an error message:

Compilation error: fork/exec /bin/avr-g++ no such file or directory.

This folder /Applications/Arduino.app/Contents/Java/hardware/tools/avr no longer exists as far as I can tell.

Any help would be greatly appreciated. Thank you.

The bad CPU type means that the software that does the compilation is not written for your Mac's processor; it's probably written as a 32 bit application and you Mac requires a 64 bit application.

I think that this has been covered a couple of times in the many questions on the forum but you have to do a search. The two applicable categories where to search are IDE 2.0 (the category where you posted your problem) and Installation and Troubleshooting. If you go to those categories, the search box in the right top allows you to search the complete forum or just the specific category.

You can search for answers by ptillish, he's (more than) quite good in this.

1 Like

That is correct. The equivalent path when using Arduino IDE 2.x:

~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7

You you must update the path in your ln command.


Alternatively, you can use this community made boards platform with support for the Digispark board:

This one should work fine on your Mac without the need for performing any workarounds. Unlike the Digistump boards platform, which has been abandoned by the manufacturer, ATTinyCore is actively maintained.

1 Like

Thank you @sterretje for your advice and for recommending @ptillisch. :smiley:

Thank you ptillisch for joining this thread and for your awesome advice. Thanks especially for the link to the community made boards supporting the Digispark board. I am very excited to try this out.

Thanks again for the great help and support. :pray:

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

Just a little update. I tried updating the patch in my ln command with the path you mentioned, but unfortunately I was still unable to make it work.

However, that's okay for now because I was able to get the ATTinyCore SpenceKonde board to work. I verified and uploaded a small LED flashing script and it was a magical moment for me to see the tiny Digispark light it's LED light. :smiley: Thanks again @ptillisch for helping me with this.

I did try to do the "Hello World" Script but was unable to make it work. The original script calls for the importing of the DigiKeyboard.h library. However, I get a compilation error: DigiKeyboard.h: No such file or directory.

I assume this is because the DigiKeyboard library is only included in the Digistump board? I then tried to figure out which Keyboard library I needed to import for the SpenceKonde/ATTiny Core (Micronucleus / DigiSpark) board. I was not able to find out in the GitHub (I also tried #include DKeyboard.h but that did not work) so I tried to import the regular Keyboard.h.

However this also resulted in a compilation error "exit status 1":

In file included from /private/var/folders/b3/rwyfs47d3lsbm_31yl2cqhv80000gn/T/.arduinoIDE-unsaved202333-4244-1n4619w.va8d/sketch_apr3c/sketch_apr3c.ino:1:0:
/Users/user/Library/Arduino15/libraries/Keyboard/src/Keyboard.h:25:10: fatal error: HID.h: No such file or directory
 #include "HID.h"
          ^~~~~~~
compilation terminated.
exit status 1

Any help regarding this would be greatly appreciated. Thank you...

There is some information about support for using the USB capability of the Digispark in your sketch with ATTinyCore here:

https://github.com/SpenceKonde/ATTinyCore/blob/v2.0.0-devThis-is-the-head-submit-PRs-against-this/avr/extras/Ref_Micronucleus.md#warning-this-doesnt-get-you-usb-from-within-your-sketch

Thank you @ptillisch for the link. If I am understading the link correctly there is no support for the USB capability?

I apologize for these basic questions, this is my first few days learning about Arduino. Thank you for your help.

That is correct.

You might be interested in this 3rd party fork of the Digistump boards platform:

It is no longer maintained because the developer recommends using ATTinyCore instead, but it was actively maintained fairly recently so it is in much better shape than the original Digistump boards platform.

Nothing to apologize for. We're always happy to help here on the forum.

1 Like

Thank you for the 3rd party fork of the Digistump boards platform, it looks interesting and I will definitely check it out.

I have also just tried out the DigiCombo library and it seems to work well. So far my original goal of having "Hello World" typed out in Mac's Spotlight search works. :smiley: I will also do more testing with DigiCombo.

Thank you @ptillisch for your kindness and help, I greatly appreciate it. :pray:

Hi @ptillisch, I finally got a chance to try out ArminJo's Digistump fork that you provided the link for. It took a while because my little ATtiny85 Digspark broke (a part popped off) so I had to get another one.

When I try and upload a simple Sketch that only #include <DigiKeyboard.h>, I get the following error messages:

In file included from /Users/user/Library/Arduino15/packages/digistump/hardware/avr/1.7.5/libraries/DigisparkKeyboard/DigiKeyboard.h:17:0,
                 from /private/var/folders/_b/cgrnslln7x34bxgt4h5sbhv40000gn/T/.arduinoIDE-unsaved2023312-23542-r3pftm.zg2kh/sketch_apr12d/sketch_apr12d.ino:1:
/Users/user/Library/Arduino15/packages/digistump/hardware/avr/1.7.5/libraries/DigisparkKeyboard/keylayouts.h:5229:2: warning: #warning "Using default layout (LAYOUT_US_ENGLISH)" [-Wcpp]
 #warning "Using default layout (LAYOUT_US_ENGLISH)"
  ^~~~~~~

Sketch uses 2418 bytes (36%) of program storage space. Maximum is 6650 bytes.
Global variables use 82 bytes (16%) of dynamic memory, leaving 430 bytes for local variables. Maximum is 512 bytes.

dyld[31922]: Library not loaded: /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib
  Referenced from: <7ECB5785-E8FD-3291-B541-5FFC8372A898> /Users/user/Library/Arduino15/packages/digistump/tools/micronucleus/2.6/micronucleus
  Reason: tried: '/usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib' (no such file), '/usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib' (no such file), '/usr/local/lib/libusb-0.1.4.dylib' (no such file), '/usr/lib/libusb-0.1.4.dylib' (no such file, not in dyld cache)
Failed uploading: uploading error: signal: abort trap

I am trying to understand the error message. Does the first part just a warn that the default keyboard layout is US English?

Then it seems successfully verify and compile the code?

Before finally explaining that it is looking for a file (the library?) that it is expecting to find in a certain location but is unable to do so?

Thank you for your help in deciphering this error message and any guidance on how to remedy this issue.

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