Programming the Pro Micro without the Arduino Ide

I recently received one of the Pro Micro Boogieboards and am having issues when trying to build the code directly using avr-gcc. It looks like this issue is being caused by the fact that the modified Caterina bootloader expects code to be compiled differently for 8 or 16 mhz systems (https://cdn.sparkfun.com/datasheets/Dev … U4Note.pdf). The issue I am running into is after compiling and burning the code using avr-gcc and avrdude, the board is no longer recognized by my laptop (Linux) and needs to be explicitly put into bootloader mode before the device shows up (/dev/ttyACM0).

I am trying to figure out how to get this workflow to work similarly to the arduino workflow where you build/upload the code based on the board and processor speed and the board is always recognized by the system even when not in bootloader mode. I have done some digging and it looks like this issue is related to the avr-gcc compilation phase and not when burning the code to the MCU.

So, with all that out of the way, is there any general recommendation or documentation available for compiling and building software for this modified bootloader outside of the arduino framework? Or is my best bet to just replace the modified bootloader with the original Caterina bootloader?

Unfortunately we don’t have a guide for anything like this, but there’s more to a code upload to the Pro Micro than just sending the sketch. Somewhere in the upload process, the boards USB PID and VID get sent as well and I’m not exactly sure where or how that’s done. The boards.txt file for the Pro Micro might lead you down the right path.

Hi @EvolutionXJ,

I’ve just posted viewtopic.php?f=96&t=53770 which is similar to what your are asking, but on Windows not Linux. You could possibly translate it to bash script. For Raspberry Pi+Arduino I push the hex file from PC and then the Pi loads it into the Ard with the script below. You’ll have to edit it for file locations etc. and it deletes the hex file after good load, you might not want that.

Richard.

#
#  ard_load2.sh - the file to load to Ard is given as a parameter.
#  given as just the filename without .ino.hex
#
#
str1="$1"
str2=""

if [ "$str1" == "$str2" ]; then
  echo "P1 should be Arduino filename."
  exit
else
  echo "Arduino filename is $1"
fi



date "+%d/%m/%Y %R:%S"  >> ard_load.log
prg=/home/pi/arduino-1.8.5/hardware/tools/avr/bin/avrdude
cnf=/home/pi/arduino-1.8.5/hardware/tools/avr/etc/avrdude.conf
prt=/dev/ttyUSB0
afl="$1.ino.hex"
afd=ard_loaded.dat
#
# remove the 'finished' file
rm $afd
#
# Nano:
$prg -C$cnf  -v -patmega328p -carduino -P$prt -b57600 -D -Uflash:w:$afl:i
# Mega:
# $prg -C$cnf  -v -patmega2560 -cwiring -P$prt -b115200 -D -Uflash:w:$afl:i
#
if [ $? == 0 ]
then
   echo "good"
   #rm $afl
else
   echo "bad"
fi
# create a file to show we've finished.
# doesn't indicate success/fail.
date "+%d/%m/%Y %R:%S"  > $afd
#