Try this
[env:attiny85]
platform = atmelavr
framework = arduino
board = attiny85
board_mcu = t85
board_f_cpu = 1000000
upload_flags = -P$UPLOAD_PORT
upload_protocol = linuxspi
upload_speed = 10000
upload_port = /dev/spidev0.0
extra_script = extra_script.py
However, that is not enough. You need to make software reset. See
sudo gpio -g mode 22 out
sudo gpio -g write 22 0
We have this software reset on other pins for raspduino
and emonpi
. Nevertheless, you can write custom extra_script and 2 hooks. Do you familiar with Python?
See my answer here
extra_script.py
Place it on the same level as platformio.ini
Import("env")
def _rpi_sysgpio(path, value):
with open(path, "w") as f:
f.write(str(value))
def before_upload(source, target, env):
_rpi_sysgpio("/sys/class/gpio/export", 22)
_rpi_sysgpio("/sys/class/gpio/gpio22/direction", "out")
_rpi_sysgpio("/sys/class/gpio/gpio22value", 0)
def after_upload(source, target, env):
_rpi_sysgpio("/sys/class/gpio/gpio22/direction", "out")
_rpi_sysgpio("/sys/class/gpio/gpio22value", 1)
env.AddPreAction("program", before_upload)
env.AddPostAction("program", after_upload)
P.S: Need to run with sudo
. RPi requires it.