[SOLVED] Getting SAM-BA operation failed

(I've posted this here: https://forum.arduino.cc/index.php?topic=563004.0 but maybe it was the wrong forum?)

I've just got my new shiny Mkr Vidor 4000, but unfortunately I can't upload a sketch to it (it just the old Blink sketch). I've tried to double click the reset button before initializing the upload, setting the board into the boot loader state. The Core is installed as per the instructions.

You can fetch the board information and the board shows up under the ports (of course).

A verbose output from the IDE (1.8.5) is given below:

SAM-BA operation failed

[=========== ] 37% (64/171 pages)write(addr=0x20005000,size=0x1000) writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[====================== ] 74% (128/171 pages)write(addr=0x20005000,size=0xac0) writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0xac0)

[==============================] 100% (171/171 pages) done in 0.078 seconds

Verify 10884 bytes of flash with checksum. checksumBuffer(start_addr=0x2000, size=0x1000) = d618 checksumBuffer(start_addr=0x3000, size=0x1000) = dc9e checksumBuffer(start_addr=0x4000, size=0xa84) = 56b4 Verify successful done in 0.014 seconds CPU reset. readWord(addr=0)=0x20007ffc readWord(addr=0xe000ed00)=0x410cc601 readWord(addr=0x41002018)=0x10010305 writeWord(addr=0xe000ed0c,value=0x5fa0004) An error occurred while uploading the sketch

=====

ed

I've retired it again to post a fuller dump:

Sketch uses 10740 bytes (4%) of program storage space. Maximum is 262144 bytes. Forcing reset using 1200bps open/close on port COM12 PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} PORTS {COM12, } / {COM12, } => {} Uploading using selected port: COM12 C:\Users*\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM12 -I -U true -i -e -w -v C:*\AppData\Local\Temp\arduino_build_416191/Blink.ino.bin -R Set binary mode readWord(addr=0)=0x20007ffc readWord(addr=0xe000ed00)=0x410cc601 readWord(addr=0x41002018)=0x10010305 version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19 chipId=0x10010005 Connected at 921600 baud readWord(addr=0)=0x20007ffc readWord(addr=0xe000ed00)=0x410cc601 readWord(addr=0x41002018)=0x10010305 Atmel SMART device 0x10010005 found write(addr=0x20004000,size=0x34) writeWord(addr=0x20004030,value=0x10) writeWord(addr=0x20004020,value=0x20008000) Device : ATSAMD21G18A readWord(addr=0)=0x20007ffc readWord(addr=0xe000ed00)=0x410cc601 readWord(addr=0x41002018)=0x10010305 Chip ID : 10010005 version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19 Version : v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19 Address : 8192 Pages : -129 Page Size : 64 bytes Total Size : 4194295KB Planes : 1 Lock Regions : 16 Locked : readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff readWord(addr=0x41004020)=0xffff none readWord(addr=0x41004018)=0 Security : false Boot Flash : true readWord(addr=0x40000834)=0x7000a BOD : true readWord(addr=0x40000834)=0x7000a BOR : true Arduino : FAST_CHIP_ERASE Arduino : FAST_MULTI_PAGE_WRITE Arduino : CAN_CHECKSUM_MEMORY_BUFFER Erase flash chipErase(addr=0x2000) done in 0.835 seconds

Write 10884 bytes to flash (171 pages) write(addr=0x20005000,size=0x1000) writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

[=========== ] 37% (64/171 pages)write(addr=0x20005000,size=0x1000) writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

SAM-BA operation failed An error occurred while uploading the sketch

[====================== ] 74% (128/171 pages)write(addr=0x20005000,size=0xac0) writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0xac0)

[==============================] 100% (171/171 pages) done in 0.094 seconds

Verify 10884 bytes of flash with checksum. checksumBuffer(start_addr=0x2000, size=0x1000) = d618 checksumBuffer(start_addr=0x3000, size=0x1000) = dc9e checksumBuffer(start_addr=0x4000, size=0xa84) = 56b4 Verify successful done in 0.014 seconds CPU reset. readWord(addr=0)=0x20007ffc readWord(addr=0xe000ed00)=0x410cc601 readWord(addr=0x41002018)=0x10010305 writeWord(addr=0xe000ed0c,value=0x5fa0004)

Please try the recovery instructions from: http://forum.arduino.cc/index.php?topic=561393.0

Hello, and thank you for your reply!

I did and that didn't solve my problems unfortunately.

Hold on, this worked. After performing the update that's outlined below, I just need to be minfull of setting the board into its bootloader state and away I go.

Thanks!

We have a few new software releases for the MKR Vidor 4000 today:

1) A new SAMD beta core v1.6.23 release, includes bootloader update.

The new beta core update is available via the Arduino IDE's board manager. Release notes:

  • corrected MKR Vidor fqbn from mkrvidor to mkrvidor4000
  • bootloader changes to restart the FPGA on boot, which avoids hanging of sketch uploads in certain scenarios
  • a new SAMD_BootloaderUpdater library to update the bootloader of the SAMD21 via a sketch.

To update you MKR Vidor 4000's bootloader: a) In the IDE: Tools -> Board ... -> Board Manager b) Search for "SAMD beta" c) Select and click update d) Wait for the update to be downloaded and installed e) Click: File -> Examples -> SAMD_BootloaderUpdater -> UpdateBootloader f) Plug in for MKR Vidor 4000 to you PC, upload the sketch, and open the serial monitor g) There will be a check to see if you bootloader needs an update. h) WARNING: DO NOT unplug the USB cable during the update!. If your board needs a bootloader update enter "y" on the serial monitor i) The sketch will update the boot loader and the LED will blink rapidly once successful