error message:
Failed programming: cannot execute upload tool: fork/exec /Users/james.annear/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude: bad CPU type in executable
Hey, welcome to the forum!
A couple of reminders first, IDE 2 is a better category in this case. Also post code, logs and messages as code;
like this:
Failed programming: cannot execute upload tool:
Now what Mac do you have; Intel or Arm?
Your topic has been moved to a more suitable location on the forum. Please don't post in "Uncategorized".
Did you install the Adafruit library?
Did you press reset just before clicking upload?
Trinkets can be finicky
Hi @jamieannear73. I'm going to ask you to provide the full verbose output from an upload attempt.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to Show verbose output during: ☐ compile in the "Preferences" dialog.
- Check the box next to Show verbose output during: ☐ upload.
- Click the "OK" button.
The "Preferences" dialog will close. - Attempt an upload, as you did before.
- Wait for the upload to fail.
- You will see an "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
- Open a forum reply here by clicking the "Reply" button.
- Click the
<CODE/>icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
- Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the error output from the upload into the code block. - Move the cursor outside of the code block markup before you add any additional text to your reply.
- Click the "Reply" button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.
Click here for attachment instructions
- Open any text editor program.
- Paste the copied output into the text editor.
- Save the file in
.txtformat. - Open a forum reply here by clicking the "Reply" button.
- Click the "Upload" icon (
) on the post composer toolbar:
The "Open" dialog will open. - Select the
.txtfile you saved from the "Open" dialog. - Click the "Open" button.
The dialog will close. - Click the "Reply" button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
FQBN: adafruit:avr:protrinket5
Using board 'protrinket5' from platform in folder: /Users/james.annear/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15
Using core 'arduino' from platform in folder: /Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Detecting libraries used...
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROTRINKET5 -DARDUINO_ARCH_AVR -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp -o /dev/null
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROTRINKET5 -DARDUINO_ARCH_AVR -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/SPI/src /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp -o /dev/null
Using cached library dependencies for file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/code.cpp
Using cached library dependencies for file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/images.cpp
Using cached library dependencies for file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/support.cpp
Using cached library dependencies for file: /Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/SPI/src/SPI.cpp
Generating function prototypes...
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROTRINKET5 -DARDUINO_ARCH_AVR -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/SPI/src /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp -o /private/var/folders/z2/8y_hysxn6w7d7hyfblxx0nf9w93s_3/T/821534485/sketch_merged.cpp
/Users/james.annear/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /private/var/folders/z2/8y_hysxn6w7d7hyfblxx0nf9w93s_3/T/821534485/sketch_merged.cpp
Compiling sketch...
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROTRINKET5 -DARDUINO_ARCH_AVR -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs -I/Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/SPI/src /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp -o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp.o
Using previously compiled file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/images.cpp.o
Using previously compiled file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/support.cpp.o
Using previously compiled file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/code.cpp.o
Compiling libraries...
Compiling library "SPI"
Using previously compiled file: /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/libraries/SPI/SPI.cpp.o
Compiling core...
Using precompiled core: /Users/james.annear/Library/Caches/arduino/cores/adafruit_avr_protrinket5_ef0873da34d5d3a073ff41c1d25f52e7/core.a
Linking everything together...
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.elf /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/code.cpp.o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/images.cpp.o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/protrinket5v_bootloader.ino.cpp.o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/sketch/support.cpp.o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/libraries/SPI/SPI.cpp.o /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/../../cores/adafruit_avr_protrinket5_ef0873da34d5d3a073ff41c1d25f52e7/core.a -L/Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B -lm
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.elf /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.eep
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.elf /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.hex
Using library SPI at version 1.0 in folder: /Users/james.annear/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/SPI
/Users/james.annear/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.elf
Sketch uses 24784 bytes (86%) of program storage space. Maximum is 28672 bytes.
Global variables use 1007 bytes of dynamic memory.
"/Users/james.annear/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude" "-C/Users/james.annear/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf" -v -patmega328p -cusbtiny "-Uflash:w:/Users/james.annear/Library/Caches/arduino/sketches/14D81254A51D47A61787CBD2255BCA2B/protrinket5v_bootloader.ino.hex:i"
Failed programming: cannot execute upload tool: fork/exec /Users/james.annear/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude: bad CPU type in executable```
Yes
it is a M1 so I guess it is arm
Sounds like you downloaded and installed the Intel package, could that be the case?
When you upload a an Arduino sketch to your board, Arduino IDE executes a helper tool which actually performs the upload. The tool used to upload to the Pro Trinket board is named "AVRDUDE".
Each of the boards platforms (which add support to Arduino IDE for various boards) can specify exactly which upload tool should be installed for use by the platform. This includes the specific version of the tool. So when you install various platforms on your computer, you will end up an array of different tool versions.
Some boards platforms do not explicitly define the specific version of a tool that should be installed and used when uploading to the boards of the platform. This is the case for the "Adafruit AVR Boards" platform which adds support to Arduino IDE for the Pro Trinket board. In this case, Arduino IDE uses a sophisticated algorithm to try to guess which of the multiple installed tool versions is most appropriate to use. This algorithm usually can pick an appropriate tool, but it is not guaranteed to do so.
This is a case where the algorithm did not choose an appropriate tool. The problem is that it chose a very old version 6.3.0-arduino9 of the AVRDUDE tool. That version was released at a time before Apple dropped macOS support for 32-bit applications. So Arduino made a 32-bit macOS build of the tool so that a single tool could be used by users of 32-bit systems and 64-bit systems alike. After Apple dropped support for 32-bit applications, Arduino started producing 64-bit builds of AVRDUDE. However, that was not done retroactively for the outdated versions of AVRDUDE. This means that, if for some reason the old versions of AVRDUDE are used on a modern macOS computer, it will fail with this "bad CPU type in executable" error.
The solution will be to adjust the configuration of the "Adafruit AVR Boards" platform to specify the use of a modern version of AVRDUDE that is compatible with your computer. I'll provide instructions you can follow to do that:
- Select Arduino IDE > Quit Arduino IDE from the Arduino IDE menus if it is running.
All Arduino IDE windows will close. - Start any text editor application.
- Use the text editor to open the file at the following path on your hard drive:
/Users/james.annear/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/platform.txt - Change line 13-14 in the file from this:
to this:tools.avrdude.cmd.path={path}/bin/avrdude tools.avrdude.config.path={path}/etc/avrdude.conftools.avrdude.cmd.path={runtime.tools.avrdude-6.3.0-arduino17.path}/bin/avrdude tools.avrdude.config.path={runtime.tools.avrdude-6.3.0-arduino17.path}/etc/avrdude.conf - Save the file.
- Start Arduino IDE.
Now try uploading to the board again, just as you did before when you encountered the error. Hopefully everything will work correctly this time.

