platformio / platform-atmelsam

Atmel SAM: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelsam
Apache License 2.0
78 stars 105 forks source link

Upload to Adafruit Feather M4 CAN board does not work #160

Closed maxgerhardt closed 3 years ago

maxgerhardt commented 3 years ago

Per two reports from https://community.platformio.org/t/solved-feather-m4-can-upload-issues/21396, uploading for board = adafruit_feather_m4_can does not work.

and it just hangs like that for around a minute before displaying this:

No device found on COM5
*** [upload] Error 1

The issue occured on Mac and Windows alike.

The only way to make it work was to repoint the upload_command to the bossac executable the Arduino IDE uses along with the exact same flag the Arduino IDE uses.

[env:adafruit_feather_m4_can]
platform = atmelsam
board = adafruit_feather_m4_can
framework = arduino
upload_protocol = custom
upload_command = /Users/<user>/Library/Arduino15/packages/arduino/tools/bossac/1.8.0-48-gb176eee/bossac -i -d --port=/dev/cu.usbmodem14401 -U -i --offset=0x4000 -w -v "/Users/<some path>/PJ PlatformIO Projects/M4 CAN test/.pio/build/adafruit_feather_m4_can/firmware.bin" -R

Please investigate that the used bossac versions and flags match the one of the Arduino IDE.

(I have no board to test, but hopefully the original two people can participate in this issue).