Ok, I fixed it. The Digispark boards now work properly from within Visual Micro's upload process, no external tool needed. First, I DO NOT recommend installing the Digistump IDE. Use the standard Arduino IDE. Don't modify it.
Their IDE is old. The latest one, 1.5.8, is found here:
https://github.com/digistump/DigistumpArduino/releases/download/v1.5.8C/Digistum... Get that zip file. Unzip it. Install the drivers if you haven't already (found in "DigistumpIDE1.5.8C\drivers"). Don't install the IDE.
Take all of the files from the "DigistumpIDE1.5.8C\hardware" folder and copy them to your sketch folder's "hardware" sub-folder (create one if you don't have it).
Now you will have a Digistump file named platform.txt located in your sketch folder under "hardware\digistump\avr"
The Digistump platform.txt file for Digispark is the problem. It's missing the program.pattern element. We need to fix it to make it work with Visual Micro.
To fix this, open up the Digistump platform.txt file and copy the code below into the Digistump platform.txt file and save it.
This changes the platform.txt file to have the missing program.pattern element. It also bypasses their hacked AVRDUDE because it doesn't work. It makes Visual Micro call micronucleus directly for Digispark.
Note the path in the code below for micronucleus is within the Arduino sketch folder:
tools.micronucleus.cmd.path={
location.sketchbook}/hardware/digistump/avr/tools/micronucleus
tools.micronucleus.cmd.path.linux={
location.sketchbook}/hardware/digistump/avr/tools/micronucleus
If you put their stuff in the Arduino IDE program's hardware folder, which I do not recommend, then you would change that to be
tools.micronucleus.cmd.path={
runtime.ide.path}/hardware/digistump/avr/tools/micronucleus
tools.micronucleus.cmd.path.linux={
runtime.ide.path}/hardware/digistump/avr/tools/micronucleus
With this working, when the compile is done and it says "
Uploading to I/O board using 'Micronucleus", then plug in the Digispark and it should work. The Digispark should not be plugged in before that. If it is, unplug it and plug it in again.
# Arduino AVR Core and platform.
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Digistump AVR Boards
version=1.5.4
# AVR compile variables
# ---------------------
# Default "compiler.path" is correct, change only if you want to overidde the initial value
compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
compiler.c.cmd=avr-gcc
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
compiler.c.elf.flags=-Os -Wl,--gc-sections
compiler.c.elf.cmd=avr-gcc
compiler.S.flags=-c -g -x assembler-with-cpp
compiler.cpp.cmd=avr-g++
compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
compiler.ar.cmd=avr-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=avr-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O ihex -R .eeprom
compiler.elf2hex.cmd=avr-objcopy
compiler.ldflags=
compiler.size.cmd=avr-size
# this can be overriden in boards.txt
build.extra_flags=
# AVR compile patterns
# --------------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
## Create eeprom
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
## Create hex
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
# AVR Uploader/Programmers tools
# ------------------------------
######################################################################
# Original settings which did not work with Visual Micro
#
dude
ls/avrdude
#tools.micronucleus.upload.params.verbose=-v
#tools.micronucleus.upload.params.quiet=-q
#tools.micronucleus.upload.pattern="{cmd.path}" -cdigispark --timeout 60 -Uflash:w:{build.path}/{build.project_name}.hex:i
######################################################################
######################################################################
# Working settings modification by Baron Williams
#
# We bypass the hacked AVRDUDE and call micronucleus directly.
# We add the missing tools.micronucleus.program.pattern element.
#
# Note the path is looking for the Digispark hardware files inside the sketchbook folder.
# I recommend adding all non Arduino hardware files to your sketchbook folder instead of modifying
# your Arduino IDE.
#
# If you instead put the Digispark hardware files in your Arduino IDE's hardware folder then you
# need to use {runtime.ide.path} instead of {location.sketchbook} for the first two lines like this:
#
# onucleus
# s/micronucleus
######################################################################
icronucleus
ools/micronucleus
tools.micronucleus.upload.params.verbose=
tools.micronucleus.upload.params.quiet=
tools.micronucleus.upload.pattern="{cmd.path}" --run --timeout 60 "{build.path}/{build.project_name}.hex"
tools.micronucleus.program.pattern="{cmd.path}" --run --timeout 60 "{build.path}/{build.project_name}.hex"
# USB Default Flags
# Default blank usb manufacturer will be filled it at compile time
# - from numeric vendor ID, set to Unknown otherwise
build.usb_manufacturer=
build.usb_flags=