How to load Arduino sketch on SparkFun Qwiic Pro Micro - USB-C (ATmega32U4) from Apple Silicon Mac

Hi there,

I bought a Qwiic Pro Micro board to develop with my M1 Ultra Mac Studio. The board is directly connected to a front USB C port via an Apple branded USB C to USB C cable.

The board only shows up for a few seconds if I double tap the reset button, then goes away after a few seconds. As a result, I cannot flash even a simple hello world firmware via the Arduino v2.3.4 app onto the board. Curious if anyone has any suggestions?

Here is what I did:

  1. Download Arduino v2.3.4 from https://www.arduino.cc/en/software
  2. Move the app to Applications folder
  3. Allow the app the launch
  4. Launch the app
  5. Go to Settings and register an Additional Board Manager URL via https://raw.githubusercontent.com/sparkfun/Arduino_Boards/main/IDE_Board_Manager/package_sparkfun_index.json
  6. Go to Tools > Board > Board Manager… and click Install SparkFun AVR Boards and got 1.1.13 downloaded
  7. Go to Tools > Boards > SparkFun AVR Boards > SparkFun Pro Micro
  8. Go to Tools > Processor > and change to the 16 MHz option, since the spec sheet on SparkFun Qwiic Pro Micro - USB-C (ATmega32U4) says 16 MHz

If I look at devices without the Pro Micro board plugged in, I see 3 items:

>> ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port	/dev/tty.usbmodemM4AE1A561J6
/dev/tty.debug-console

If I plug the board in, the red LED turns on but nothing changes:

>> ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port	/dev/tty.usbmodemM4AE1A561J6
/dev/tty.debug-console

However, if I double-tap the reset button, I see a new device show up

>> ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port	/dev/tty.usbmodem5101
/dev/tty.debug-console			/dev/tty.usbmodemM4AE1A561J6

But if I wait about 5 seconds, the new board goes away:

>> ls /dev/tty.*

/dev/tty.Bluetooth-Incoming-Port /dev/tty.usbmodemM4AE1A561J6
/dev/tty.debug-console

So I tried to go in the Arduino app, Verify, double tap the button, then click Upload as fast as I can. To make debugging easier, I turned on verbose output. Here is what I see:

FQBN: SparkFun:avr:promicro:cpu=16MHzatmega32U4
Using board 'promicro' from platform in folder: /Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13
Using core 'arduino' from platform in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used...
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /dev/null
Using cached library dependencies for file: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/Wire.cpp
Using cached library dependencies for file: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/utility/twi.c
Generating function prototypes...
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /private/var/folders/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/4070030899/sketch_merged.cpp
/Users/zach/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/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/4070030899/sketch_merged.cpp
Compiling sketch...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"SparkFun Pro Micro\"" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp.o
Compiling libraries...
Compiling library "Wire"
Using previously compiled file: /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/Wire.cpp.o
Using previously compiled file: /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/utility/twi.c.o
Compiling core...
Using precompiled core: /Users/zach/Library/Caches/arduino/cores/SparkFun_avr_promicro_cpu_16MHzatmega32U4_4de124a9f48fe224b0792db58dc95268/core.a
Linking everything together...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega32u4 -o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/Wire.cpp.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/utility/twi.c.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/../../cores/SparkFun_avr_promicro_cpu_16MHzatmega32U4_4de124a9f48fe224b0792db58dc95268/core.a -L/Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1 -lm
/Users/zach/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/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.eep
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.hex

Using library Wire at version 1.0 in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire 
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf
Sketch uses 6052 bytes (21%) of program storage space. Maximum is 28672 bytes.
Global variables use 489 bytes (19%) of dynamic memory, leaving 2071 bytes for local variables. Maximum is 2560 bytes.
Performing 1200-bps touch reset on serial port /dev/cu.usbmodem5101
Waiting for upload port...
No upload port found, using /dev/cu.usbmodem5101 as fallback

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
"/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega32u4 -cavr109 -P/dev/cu.usbmodem5101 -b57600 -D "-Uflash:w:/Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.hex:i"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem5101
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/cu.usbmodem5101": No such file or directory

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

Does anyone have any guidance on how to run a simple Hello World application using Arduino app on Apple Silicon hardware on the SparkFun Qwiic Pro Micro - USB-C (ATmega32U4)?

Thanks,
Zach

It should be 8 seconds before it disappears; can you try selecting the new COM port during that period after pressing reset 2x? Pro Micro & Fio V3 Hookup Guide - SparkFun Learn

IF that doesn’t work maybe try updating the wire and avrdude libraries and re-attempt

Thanks for the tip. Unfortunately none of it seems to work.

I installed the latest avrdude:

>> brew install avrdude
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
Warning: avrdude 8.0 is already installed and up-to-date.
To reinstall 8.0, run:
  brew reinstall avrdude
>> avrdude -v          
Avrdude version 8.0
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /opt/homebrew/etc/avrdude.conf
User configuration file /Users/zach/.avrduderc does not exist

Error: no programmer has been specified on the command line or in the
config file(s); specify one using the -c option and try again

And when I did the sequence you suggested, the board does not program. It starts but doesn’t finish. Any suggestions?


FQBN: SparkFun:avr:promicro:cpu=16MHzatmega32U4
Using board 'promicro' from platform in folder: /Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13
Using core 'arduino' from platform in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used...
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /dev/null
Using cached library dependencies for file: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/Wire.cpp
Using cached library dependencies for file: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/utility/twi.c
Generating function prototypes...
/Users/zach/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 -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="SparkFun Pro Micro" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /private/var/folders/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/3851061416/sketch_merged.cpp
/Users/zach/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/7h/c0sfqmmj3m1ggbpb_9t0zskw0000gn/T/3851061416/sketch_merged.cpp
Compiling sketch...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9206 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"SparkFun Pro Micro\"" -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/zach/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.13/variants/promicro -I/Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp -o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp.o
Compiling libraries...
Compiling library "Wire"
Using previously compiled file: /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/utility/twi.c.o
Using previously compiled file: /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/Wire.cpp.o
Compiling core...
Using precompiled core: /Users/zach/Library/Caches/arduino/cores/SparkFun_avr_promicro_cpu_16MHzatmega32U4_4de124a9f48fe224b0792db58dc95268/core.a
Linking everything together...
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega32u4 -o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/sketch/temperature-sensor.ino.cpp.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/Wire.cpp.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/libraries/Wire/utility/twi.c.o /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/../../cores/SparkFun_avr_promicro_cpu_16MHzatmega32U4_4de124a9f48fe224b0792db58dc95268/core.a -L/Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1 -lm
/Users/zach/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/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.eep
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.hex

Using library Wire at version 1.0 in folder: /Users/zach/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire 
/Users/zach/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.elf
Sketch uses 6052 bytes (21%) of program storage space. Maximum is 28672 bytes.
Global variables use 489 bytes (19%) of dynamic memory, leaving 2071 bytes for local variables. Maximum is 2560 bytes.
Performing 1200-bps touch reset on serial port /dev/cu.usbmodem5101
Waiting for upload port...
No upload port found, using /dev/cu.usbmodem5101 as fallback

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
"/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega32u4 -cavr109 -P/dev/cu.usbmodem5101 -b57600 -D "-Uflash:w:/Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.hex:i"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem5101
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/cu.usbmodem5101": No such file or directory

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

Is the COM port showing during or @ the time of upload?

  1. When I first plug the board into the USB port, it does not show up - ls /dev/tty.usb* does not get any new entries
  2. When I double press the button on the board, it does show up in ls /dev/tty.usb* and I can connect to it in the Arduino UI, but only for a few seconds. The entry I see is /dev/tty.usbmodem5101
  3. If I connect the board via USB, press the button twice and very quickly click the “Upload” button in the Arduino UI to try to flash the build before the board goes away

This is what I see in the Arduino console UI:

Waiting for upload port...
No upload port found, using /dev/cu.usbmodem5101 as fallback
"/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega32u4 -cavr109 -P/dev/cu.usbmodem5101 -b57600 -D "-Uflash:w:/Users/zach/Library/Caches/arduino/sketches/AF10DD65273260E7F1A2375309BCDCA1/temperature-sensor.ino.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/zach/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem5101
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/cu.usbmodem5101": No such file or directory

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

Ok, I have returned with more ideas…First, try this more reliable upload procedure:

  1. In the Arduino IDE, click the “Upload” button first
  2. Wait until you see “Waiting for upload port…” in the console
  3. Only then double-click the reset button on the board
  4. The upload should complete before the bootloader times out

If that doesn’t work, we can try a more aggressive approach:

  1. Open Terminal
  2. Run: ls -l /dev/tty.usb* to confirm no board is present
  3. Create a loop to watch for the device:

bash

while true; do ls /dev/tty.usb*; sleep 0.5; done
  1. In another Terminal window, prepare this command but don’t run it yet:

bash

/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/zach/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/tty.usbmodem5101 -b57600 -D -Uflash:w:[YOUR_HEX_FILE_PATH]:i
  1. Double-press the reset button
  2. As soon as you see the device appear in the first Terminal window, quickly run the avrdude command in the second window

If these methods don’t work, we can try:

  1. If available, trying a different computer to rule out OS-specific issues
  2. Upload Workaround**

bash

# Terminal command to force persistent port recognition
screen /dev/cu.usbmodem5101 1200

Run this immediately after resetting the board to keep the port active

Thank you @TS-Russell! Your suggestion to press Upload first did the trick and now I can flash firmware on the board.

Can you help me get a temperature sensor reading off the DHT20 sensor?

I am trying to connect the USB C SparkFun Qwiic Pro Micro to the DHT20 temperature sensor via the Qwiic connector using a Qwiic cable:

I connected according to the Qwiic documentation:

  • GND: black
  • VCC: red
  • SDA: blue
  • SCL: yellow

There are two conflicting data sheets linked to on the DHT20 page:

  1. The first one mentions the device has an I2C connection and the pinout is 1: VCC, 2: SDA, 3: GND, 4: SCL (page 7)
  2. The second one mentions it’s a one-wire connection and pin 3 is to be disconnected.

I assumed data sheet 1 is correct, and I can use Qwiic connector and software. However, my sample code shows no connection:

#include <Wire.h>

#define SENSOR_ADDR 0x5C

void setup() {
  Serial.begin(115200);
  while (!Serial);
  Wire.begin();
  Serial.println("AM2320 (RHT03) Qwiic Sensor Example");
}

void loop() {
  // Wake the sensor
  Wire.beginTransmission(SENSOR_ADDR);
  Wire.endTransmission();
  delay(2);
  
  // Send read command (function 0x03, start register 0x00, read 4 registers)
  Wire.beginTransmission(SENSOR_ADDR);
  Wire.write(0x03);
  Wire.write(0x00);
  Wire.write(0x04);
  Wire.endTransmission();
  delay(2);
  
  // Request 8 bytes of data from the sensor
  Wire.requestFrom((uint8_t)SENSOR_ADDR, (uint8_t)8);
  if (Wire.available() < 8) {
    Serial.println("Error: Insufficient data from sensor");
    delay(2000);
    return;
  }
  
  uint8_t data[8];
  for (int i = 0; i < 8; i++) {
    data[i] = Wire.read();
  }
  
  // Check response header
  if (data[0] != 0x03 || data[1] != 0x04) {
    Serial.println("Error: Invalid response header");
    delay(2000);
    return;
  }
  
  // Verify checksum
  uint8_t checksum = data[0] + data[1] + data[2] + data[3];
  if (checksum != data[4]) {
    Serial.println("Warning: Checksum mismatch");
  }
  
  // Parse humidity (unsigned, in tenths of %RH)
  uint16_t rawHumidity = ((uint16_t)data[2] << 8) | data[3];
  // Parse temperature (signed, in tenths of °C)
  int16_t rawTemp = ((int16_t)data[4] << 8) | data[5];
  if (rawTemp & 0x8000) {
    rawTemp = -((~rawTemp + 1) & 0x7FFF);
  }
  
  float humidity = rawHumidity / 10.0;
  float temperature = rawTemp / 10.0;
  
  Serial.print("Humidity: ");
  Serial.print(humidity, 1);
  Serial.print(" %    Temperature: ");
  Serial.print(temperature, 1);
  Serial.println(" °C");
  
  delay(2000);
}

Output:

AM2320 (RHT03) Qwiic Sensor Example
Error: Insufficient data from sensor
Error: Insufficient data from sensor
Error: Insufficient data from sensor
...

Nice!

Datasheet 1 does appear to be the correct one; I think you need to edit line 3 to be 0x38 as the i2c address (also per pg 7)…and I’ll get our docs updated