I have a few M4 CAN boards and they all give me intermittent issues uploading. I notice this happens if the sketch has some bug in it that causes it to not run properly, maybe a segmentation fault or some memory issue. I don't have a debugger attached.
This is the output I get after uploading a buggy sketch:
Code: Select all
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {}
...
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {}
Uploading using selected port: /dev/ttyACM0
/home/pateco/.arduino15/packages/adafruit/tools/bossac/1.8.0-48-gb176eee/bossac -i -d --port=ttyACM0 -U -i --offset=0x4000 -w -v /tmp/arduino_build_162252/sketch_sep20a.ino.bin -R
The only way I can fix it is by holding down the reset button on the board while pressing upload in arduino and then releasing the reset button. I'm not 100% of the right timing so it often takes a few tries. Uploads after this fix work fine until the next time I add a bug to the code.
Is there anything I can do to make uploading fool proof?