[SOLVED] Feather M4 Can Upload Issues

Hello Everyone,

I have recently attempted to use the Feather M4 Can from Adafruit to replace a Teensy microcontroller on one of my projects. Before I designed a board around it I bought a breakout and began testing it at home. I started by using arduino ide to test various things, spi flash, neopixel and others. When I tried to move over to platformio I was unable to make it past the upload command. Here is the output of platformio when I try to upload:

Linking .pio\build\adafruit_feather_m4_can\firmware.elf
Checking size .pio\build\adafruit_feather_m4_can\firmware.elf
Building .pio\build\adafruit_feather_m4_can\firmware.bin
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.1% (used 4224 bytes from 196608 bytes) 
Flash: [=         ]   8.0% (used 40792 bytes from 507904 bytes)
Configuring upload protocol...     
AVAILABLE: atmel-ice, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...       
Auto-detected: COM4
Forcing reset using 1200bps open/close on port COM4
Waiting for the new upload port...
Uploading .pio\build\adafruit_feather_m4_can\firmware.bin

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

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

I have gone through a similar thread about the same issue and was unable to fix the problem.

Here is the verbose output:

Building in release mode
MethodWrapper(["checkprogsize"], [".pio\build\adafruit_feather_m4_can\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.1% (used 4224 bytes from 196608 bytes)
Flash: [=         ]   8.0% (used 40792 bytes from 507904 bytes)
.pio\build\adafruit_feather_m4_can\firmware.elf  :

section            size        addr

.text             40520       16384

.canram               0   536870912

.data               272   536870912

.hsram             1024   536871184

.bss               3952   536872208

.ARM.attributes      48           0

.comment             67           0

.debug_frame       2940           0

.stab               204           0

.stabstr            441           0

Total             49468
<lambda>(["upload"], [".pio\build\adafruit_feather_m4_can\firmware.bin"])
AVAILABLE: atmel-ice, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
BeforeUpload(["upload"], [".pio\build\adafruit_feather_m4_can\firmware.bin"])
Auto-detected: COM4
Forcing reset using 1200bps open/close on port COM4
Waiting for the new upload port...
bossac --info --debug --port "COM5" --write --verify --reset --erase -U true .pio\build\adafruit_feather_m4_can\firmware.bin

and here is the verbose arduino output (however arduino actually uploads properly):

Sketch uses 11136 bytes (2%) of program storage space. Maximum is 507904 bytes.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM4, } / {} => {}
PORTS {} / {COM5, } => {COM5, }
Found upload port: COM5
C:\Users\Bowen Everitt\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.8.0-48-gb176eee/bossac -i -d --port=COM5 -U -i --offset=0x4000 -w -v C:\Users\BOWENE~1\AppData\Local\Temp\arduino_build_401573/upload-fixing.ino.bin -R 
Set binary mode
version()=v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
Connected at 921600 baud
readWord(addr=0)=0x2000d6a0
readWord(addr=0xe000ed00)=0x410fc241
readWord(addr=0x4)=0x575
readWord(addr=0x41002018)=0x61810302
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x80)
writeWord(addr=0x20004020,value=0x20008000)
version()=v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
readByte(addr=0x804000)=0x39
readByte(addr=0x804001)=0x92
readByte(addr=0x804008)=0xff
readByte(addr=0x804009)=0xff
readByte(addr=0x80400a)=0xff
readByte(addr=0x80400b)=0xff
Device       : ATSAME51x19
Version      : v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
Address      : 0x0
Pages        : 1024
Page Size    : 512 bytes
Total Size   : 512KB
Planes       : 1
Lock Regions : 32
Locked       : none
Security     : false
BOD          : false
BOR          : true
Write 11392 bytes to flash (23 pages)
[                              ] 0% (0/23 pages)write(addr=0x20004034,size=0x1000)
writeWord(addr=0x41004014,value=0x4000)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
writeWord(addr=0x41004004,value=0xa501)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
readByte(addr=0x41004010)=0x1
readByte(addr=0x41004011)=0
writeBuffer(scr_addr=0x20004034, dst_addr=0x4000, size=0x1000)
[==========                    ] 34% (8/23 pages)write(addr=0x20004034,size=0x1000)
writeBuffer(scr_addr=0x20004034, dst_addr=0x5000, size=0x1000)
[====================          ] 69% (16/23 pages)write(addr=0x20004034,size=0xe00)
writeWord(addr=0x41004014,value=0x6000)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
writeWord(addr=0x41004004,value=0xa501)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
readByte(addr=0x41004010)=0x1
readByte(addr=0x41004011)=0
writeBuffer(scr_addr=0x20004034, dst_addr=0x6000, size=0xe00)
[==============================] 100% (23/23 pages)
Done in 0.240 seconds
Verify 11392 bytes of flash
checksumBuffer(start_addr=0x4000, size=0x200) = 243e
[=                             ] 4% (1/23 pages)checksumBuffer(start_addr=0x4200, size=0x200) = c4ea
read(addr=0x4200,size=0x200)
[==                            ] 8% (2/23 pages)checksumBuffer(start_addr=0x4400, size=0x200) = ed8c
read(addr=0x4400,size=0x200)
[===                           ] 13% (3/23 pages)checksumBuffer(start_addr=0x4600, size=0x200) = da38
read(addr=0x4600,size=0x200)
[=====                         ] 17% (4/23 pages)checksumBuffer(start_addr=0x4800, size=0x200) = cc75
read(addr=0x4800,size=0x200)
[======                        ] 21% (5/23 pages)checksumBuffer(start_addr=0x4a00, size=0x200) = 106d
read(addr=0x4a00,size=0x200)
[=======                       ] 26% (6/23 pages)checksumBuffer(start_addr=0x4c00, size=0x200) = d4ae
read(addr=0x4c00,size=0x200)
[=========                     ] 30% (7/23 pages)checksumBuffer(start_addr=0x4e00, size=0x200) = 2a2
read(addr=0x4e00,size=0x200)
[==========                    ] 34% (8/23 pages)checksumBuffer(start_addr=0x5000, size=0x200) = a042
read(addr=0x5000,size=0x200)
[===========                   ] 39% (9/23 pages)checksumBuffer(start_addr=0x5200, size=0x200) = 6701
read(addr=0x5200,size=0x200)
[=============                 ] 43% (10/23 pages)checksumBuffer(start_addr=0x5400, size=0x200) = fa5d
read(addr=0x5400,size=0x200)
[==============                ] 47% (11/23 pages)checksumBuffer(start_addr=0x5600, size=0x200) = 4602
read(addr=0x5600,size=0x200)
[===============               ] 52% (12/23 pages)checksumBuffer(start_addr=0x5800, size=0x200) = 943e
read(addr=0x5800,size=0x200)
[================              ] 56% (13/23 pages)checksumBuffer(start_addr=0x5a00, size=0x200) = 7e1d
read(addr=0x5a00,size=0x200)
[==================            ] 60% (14/23 pages)checksumBuffer(start_addr=0x5c00, size=0x200) = 3207
read(addr=0x5c00,size=0x200)
[===================           ] 65% (15/23 pages)checksumBuffer(start_addr=0x5e00, size=0x200) = 9b7c
read(addr=0x5e00,size=0x200)
[====================          ] 69% (16/23 pages)checksumBuffer(start_addr=0x6000, size=0x200) = 10a2
read(addr=0x6000,size=0x200)
[======================        ] 73% (17/23 pages)checksumBuffer(start_addr=0x6200, size=0x200) = 337f
read(addr=0x6200,size=0x200)
[=======================       ] 78% (18/23 pages)checksumBuffer(start_addr=0x6400, size=0x200) = 8bd7
read(addr=0x6400,size=0x200)
[========================      ] 82% (19/23 pages)checksumBuffer(start_addr=0x6600, size=0x200) = b410
read(addr=0x6600,size=0x200)
[==========================    ] 86% (20/23 pages)checksumBuffer(start_addr=0x6800, size=0x200) = 2df1
read(addr=0x6800,size=0x200)
[===========================   ] 91% (21/23 pages)checksumBuffer(start_addr=0x6a00, size=0x200) = c2ed
read(addr=0x6a00,size=0x200)
[============================  ] 95% (22/23 pages)checksumBuffer(start_addr=0x6c00, size=0x80) = 352f
read(addr=0x6c00,size=0x200)
[==============================] 100% (23/23 pages)
Verify successful
Done in 0.067 seconds

Any help is appreciated, I am also happy to answer any questions or provide any information or data I missed.

New development, this comes right after the failed upload message

No device found on COM5
*** [upload] Error 1
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\dev\\software-testing\\more-tests\\.pio\\build\\adafruit_feather_m4_can\\.sconsign39.tmp':
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\Main.py", line 1380:
    _exec_main(parser, values)
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\Main.py", line 1344:
    _main(parser)
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\Main.py", line 1113:
    nodes = _build_targets(fs, options, targets, target_top)
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\Main.py", line 1319:
    jobs.run(postfunc = jobs_postfunc)
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Job.py", line 109:
    postfunc()
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\Main.py", line 1316:
    SCons.SConsign.write()
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\SConsign.py", line 111:
    syncmethod()
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\dblite.py", line 148:
    with self._open(self._tmp_name, "wb", self._mode) as f:
Exception ignored in: <function dblite.__del__ at 0x000002C70B214670>
Traceback (most recent call last):
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\dblite.py", line 144, in __del__
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\dblite.py", line 141, in close
  File "C:\Users\Bowen Everitt\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\dblite.py", line 148, in sync
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\dev\\software-testing\\more-tests\\.pio\\build\\adafruit_feather_m4_can\\.sconsign39.tmp'

After lots of research I’m trying to do it with a custom upload command, this is the command that the arduino ide uses to upload the bin file, so I replaced the arduino bin with the bin created by platformio this is the platformio.ini:

platformio.ini:

[env:adafruit_feather_m4_can]
platform = atmelsam
board = adafruit_feather_m4_can
framework = arduino
upload_protocol = custom
upload_command = "C:\Users\Bowen Everitt\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.8.0-48-gb176eee/bossac -i -d --port=COM5 -U -i --offset=0x4000 -w -v C:\dev\software-testing\more-tests\.pio\build\adafruit_feather_m4_can/firmware.bin -R"

and this is the error I get:

The filename, directory name, or volume label syntax is incorrect.

I feel like I am getting close now.

Mhm I don’t think you can enclose the entire command in quotes like that. Try to do it per docs, e.g.

upload_protocol = custom
upload_flags = 
   -i
   -d
   -U
   --offset=0x4000
   -w
   -v
   -R
upload_command = "C:\Users\Bowen Everitt\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.8.0-48-gb176eee/bossac" $UPLOAD_FLAGS --port=$UPLOAD_PORT $SOURCE

However I’d first advise other things: Update everything. That is, open a CLI and execute pio upgrade --dev and pio platform update atmelsam to get the latest core & platform. Then retry.

If it still does not work, try replacing PlatformIO’s bossac library with what Arduino uses. PlatformIO one’s is at C:\Users\<user>\.platformio\packages\tool-bossac.

If that still does not work, it must be due to the given bossac flags, but they look very equivalent…

I tried all of those things, none of them worked for various reasons, the one I’m trying to focus on right now is replacing the platformio bossac with the arduino bossac, I did this and I get a new error

So during the platformio upload procecss the command is made:

bossac --info --debug --port “COM5” --write --verify --reset --erase -U true .pio\build\adafruit_feather_m4_can\firmware.bin
bossac: extra arguments found
Try ‘bossac -h’ or ‘bossac --help’ for more information
*** [upload] Error 1

and thats the error I get. I have no idea why or how I can fix it.

Alright to anyone following, I fixed the issue. I added this to the platformio.ini and put the board into bootloader mode (by pressing the reset button twice) then hitting upload

upload_protocol = custom

upload_command = “C:\Users\Bowen Everitt\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.8.0-48-gb176eee/bossac” -i -d --port=COM5 -U -i --offset=0x4000 -w -v C:\dev\software-testing\more-tests.pio\build\adafruit_feather_m4_can\firmware.bin -R

Thanks maxgerhardt for the help.

Does this also work with no modified upload_protocol and PlatformIO’s default bossac?

Nope it only works with the modified platformio.ini, replacing platformios bossac with the arduino bossac did not work. So its just stock platformio stuff with the custom upload bit in the .ini file.

Maybe the developers at Issues · platformio/platform-atmelsam · GitHub can help you debug this further on why it doesn’t work with PlatformIO by default, this would be very interesting for us.

Hi @drbeeps and @maxgerhardt,
For what it’s worth I thought I would test this out as I have a couple of Adafruit Feather M4 CAN’s and a couple of Adafruit Feather M4 Express’.
I created a new project in PIO, did not make any changes to platformio.ini and these are the results.
Feather M4 Express - worked fine.
Feather M4 CAN - it failed just like yours @drbeeps

Here is the last of the PIO terminal for the failure

AVAILABLE: atmel-ice, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: /dev/cu.usbmodem14401
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem14401
Waiting for the new upload port...
Uploading .pio/build/adafruit_feather_m4_can/firmware.bin
No device found on cu.usbmodem14401
*** [upload] Error 1
==================================

Heres the working one

AVAILABLE: atmel-ice, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: /dev/cu.usbmodem14301
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem14301
Waiting for the new upload port...
Uploading .pio/build/adafruit_feather_m4/firmware.bin
Write 11140 bytes to flash (22 pages)

[                              ] 0% (0/22 pages)
[==========                    ] 36% (8/22 pages)
[=====================         ] 72% (16/22 pages)
[==============================] 100% (22/22 pages)
Done in 0.166 seconds
Verify 11140 bytes of flash

[=                             ] 4% (1/22 pages)
[==                            ] 9% (2/22 pages)
[====                          ] 13% (3/22 pages)
[=====                         ] 18% (4/22 pages)
[======                        ] 22% (5/22 pages)
[========                      ] 27% (6/22 pages)
[=========                     ] 31% (7/22 pages)
[==========                    ] 36% (8/22 pages)
[============                  ] 40% (9/22 pages)
[=============                 ] 45% (10/22 pages)
[===============               ] 50% (11/22 pages)
[================              ] 54% (12/22 pages)
[=================             ] 59% (13/22 pages)
[===================           ] 63% (14/22 pages)
[====================          ] 68% (15/22 pages)
[=====================         ] 72% (16/22 pages)
[=======================       ] 77% (17/22 pages)
[========================      ] 81% (18/22 pages)
[=========================     ] 86% (19/22 pages)
[===========================   ] 90% (20/22 pages)
[============================  ] 95% (21/22 pages)
[==============================] 100% (22/22 pages)
Verify successful
Done in 0.263 seconds

Not sure if that helps you narrow down the problem?
I’m happy to do some more testing if you tell me what you need :slight_smile:
Cheers,
Paul

Oh and I checked, the M4 CAN was definitely on /dev/cu.usbmodem14401
and the Arduino IDE programmed it on that port correctly.
Cheers.

Does it also work for you with the CAN board if you add a manual upload_command pointing to your Arduino IDE’s bossac tool?

Hi,
Yes that worked when I added the new lines to my platformio.ini so it now looks like

[env:adafruit_feather_m4_can]
platform = atmelsam
board = adafruit_feather_m4_can
framework = arduino
upload_protocol = custom
upload_command = /Users/ladmin/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/ladmin/Dropbox/Electronics/Arduino/PJ PlatformIO Projects/M4 CAN test/.pio/build/adafruit_feather_m4_can/firmware.bin" -R

here is the output

> Executing task: platformio run --target upload <

Processing adafruit_feather_m4_can (platform: atmelsam; board: adafruit_feather_m4_can; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_feather_m4_can.html
PLATFORM: Atmel SAM (6.0.1) > Adafruit Feather M4 CAN
HARDWARE: SAME51J19A 120MHz, 192KB RAM, 496KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, jlink)
PACKAGES: 
 - framework-arduino-samd-adafruit 1.6.5 
 - framework-cmsis 2.50400.181126 (5.4.0) 
 - framework-cmsis-atmel 1.2.0 
 - tool-openocd 2.1000.200630 (10.0) 
 - toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/adafruit_feather_m4_can/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.4% (used 2664 bytes from 196608 bytes)
Flash: [          ]   2.2% (used 11264 bytes from 507904 bytes)
Configuring upload protocol...
AVAILABLE: atmel-ice, custom, jlink, sam-ba
CURRENT: upload_protocol = custom
Uploading .pio/build/adafruit_feather_m4_can/firmware.bin
Set binary mode
version()=v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
Connected at 921600 baud
readWord(addr=0)=0x2000d6a0
readWord(addr=0xe000ed00)=0x410fc241
readWord(addr=0x4)=0x575
readWord(addr=0x41002018)=0x61810002
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x80)
writeWord(addr=0x20004020,value=0x20008000)
version()=v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
readByte(addr=0x804000)=0x39
readByte(addr=0x804001)=0x92
readByte(addr=0x804008)=0xff
readByte(addr=0x804009)=0xff
readByte(addr=0x80400a)=0xff
readByte(addr=0x80400b)=0xff
Device       : ATSAME51x19
Version      : v1.1 [Arduino:XYZ] Dec  1 2020 23:34:37
Address      : 0x0
Pages        : 1024
Page Size    : 512 bytes
Total Size   : 512KB
Planes       : 1
Lock Regions : 32
Locked       : none
Security     : false
BOD          : false
BOR          : true
Write 11264 bytes to flash (22 pages)

[                              ] 0% (0/22 pages)write(addr=0x20004034,size=0x1000)
writeWord(addr=0x41004014,value=0x4000)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
writeWord(addr=0x41004004,value=0xa501)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
readByte(addr=0x41004010)=0x1
readByte(addr=0x41004011)=0
writeBuffer(scr_addr=0x20004034, dst_addr=0x4000, size=0x1000)

[==========                    ] 36% (8/22 pages)write(addr=0x20004034,size=0x1000)
writeBuffer(scr_addr=0x20004034, dst_addr=0x5000, size=0x1000)

[=====================         ] 72% (16/22 pages)write(addr=0x20004034,size=0xc00)
writeWord(addr=0x41004014,value=0x6000)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
writeWord(addr=0x41004004,value=0xa501)
readByte(addr=0x41004012)=0x11
readByte(addr=0x41004013)=0xd
readByte(addr=0x41004010)=0x1
readByte(addr=0x41004011)=0
writeBuffer(scr_addr=0x20004034, dst_addr=0x6000, size=0xc00)

[==============================] 100% (22/22 pages)
Done in 0.173 seconds
Verify 11264 bytes of flash
checksumBuffer(start_addr=0x4000, size=0x200) = e72e

[=                             ] 4% (1/22 pages)checksumBuffer(start_addr=0x4200, size=0x200) = 6317
read(addr=0x4200,size=0x200)

[==                            ] 9% (2/22 pages)checksumBuffer(start_addr=0x4400, size=0x200) = 1eb1
read(addr=0x4400,size=0x200)

[====                          ] 13% (3/22 pages)checksumBuffer(start_addr=0x4600, size=0x200) = 5ff9
read(addr=0x4600,size=0x200)

[=====                         ] 18% (4/22 pages)checksumBuffer(start_addr=0x4800, size=0x200) = 6f87
read(addr=0x4800,size=0x200)

[======                        ] 22% (5/22 pages)checksumBuffer(start_addr=0x4a00, size=0x200) = 5327
read(addr=0x4a00,size=0x200)

[========                      ] 27% (6/22 pages)checksumBuffer(start_addr=0x4c00, size=0x200) = 6cf3
read(addr=0x4c00,size=0x200)

[=========                     ] 31% (7/22 pages)checksumBuffer(start_addr=0x4e00, size=0x200) = 10d1
read(addr=0x4e00,size=0x200)

[==========                    ] 36% (8/22 pages)checksumBuffer(start_addr=0x5000, size=0x200) = 521c
read(addr=0x5000,size=0x200)

[============                  ] 40% (9/22 pages)checksumBuffer(start_addr=0x5200, size=0x200) = 3cd0
read(addr=0x5200,size=0x200)

[=============                 ] 45% (10/22 pages)checksumBuffer(start_addr=0x5400, size=0x200) = d1ec
read(addr=0x5400,size=0x200)

[===============               ] 50% (11/22 pages)checksumBuffer(start_addr=0x5600, size=0x200) = 52e4
read(addr=0x5600,size=0x200)

[================              ] 54% (12/22 pages)checksumBuffer(start_addr=0x5800, size=0x200) = fdcd
read(addr=0x5800,size=0x200)

[=================             ] 59% (13/22 pages)checksumBuffer(start_addr=0x5a00, size=0x200) = e279
read(addr=0x5a00,size=0x200)

[===================           ] 63% (14/22 pages)checksumBuffer(start_addr=0x5c00, size=0x200) = 634c
read(addr=0x5c00,size=0x200)

[====================          ] 68% (15/22 pages)checksumBuffer(start_addr=0x5e00, size=0x200) = b1c
read(addr=0x5e00,size=0x200)

[=====================         ] 72% (16/22 pages)checksumBuffer(start_addr=0x6000, size=0x200) = 4ade
read(addr=0x6000,size=0x200)

[=======================       ] 77% (17/22 pages)checksumBuffer(start_addr=0x6200, size=0x200) = 10a1
read(addr=0x6200,size=0x200)

[========================      ] 81% (18/22 pages)checksumBuffer(start_addr=0x6400, size=0x200) = f241
read(addr=0x6400,size=0x200)

[=========================     ] 86% (19/22 pages)checksumBuffer(start_addr=0x6600, size=0x200) = 3003
read(addr=0x6600,size=0x200)

[===========================   ] 90% (20/22 pages)checksumBuffer(start_addr=0x6800, size=0x200) = de8d
read(addr=0x6800,size=0x200)

[============================  ] 95% (21/22 pages)checksumBuffer(start_addr=0x6a00, size=0x200) = 473d
read(addr=0x6a00,size=0x200)

[==============================] 100% (22/22 pages)
Verify successful
Done in 0.326 seconds
writeWord(addr=0xe000ed0c,value=0x5fa0004)
============================================================================== [SUCCESS] Took 4.88 seconds ==============================================================================

Terminal will be reused by tasks, press any key to close it.

I’m on a Mac obviously :slight_smile:

Since I don’t see that the original poster or anyone has opened an issue yet, I’ve opened one at Upload to Adafruit Feather M4 CAN board does not work · Issue #160 · platformio/platform-atmelsam · GitHub. Please participate in there if the PlatformIO have further questions / request for tests, that would be great for PlatformIO.

Thanks @maxgerhardt , will do cheers.

Hi guys, thanks for reporting. Should be fixed in the dev branch. Please retest your projects with the upstream version of the atmelsam platform:

[env:adafruit_feather_m4_can]
platform = https://github.com/platformio/platform-atmelsam.git
board = adafruit_feather_m4_can
framework = arduino

Hi, I finally got my project ready to use these CAN boards and the issue still seems to be in PlatformIO, such that I have to customise my platformio.ini with the same two additional lines we were all discussing earlier in the thread. i.e.

[env:adafruit_feather_m4_can]

platform = atmelsam

;platform = https://github.com/platformio/platform-atmelsam.git

board = adafruit_feather_m4_can

framework = arduino

lib_deps =

adafruit/Adafruit HX8357 Library@^1.1.11

adafruit/Adafruit GFX Library@^1.10.10

upload_protocol = custom

upload_command = /Users/ladmin/Library/Arduino15/packages/arduino/tools/bossac/1.8.0-48-gb176eee/bossac -i -d --port=/dev/cu.usbmodem14201 -U -i --offset=0x4000 -w -v "/Users/ladmin/Dropbox/Electronics/Arduino/PJ PlatformIO Projects/Pulsar M4 CAN remote display/.pio/build/adafruit_feather_m4_can/firmware.bin" -R

I have also executed
pio upgrade --dev and pio platform update atmelsam

as suggested by @maxgerhardt to ensure my system is up to date.

I’m not sure if its something I am doing or not doing, I’m not a gun on PlatformIO.
Thanks again,
Paul

The fix was pushed in the stable 6.1.0 release per Releases · platformio/platform-atmelsam · GitHub, so using platform = atmelsam with the most up-to-date version of it (pio platform update atmelsam) is correct.

Is the error still the same “No device found…”?