Device in question is an Arduino MKR Zero. The issue I believe is that the COM port changes during the upload process. I've seen some similar problems but not quite like this one.
Sketch being used is the Blink sketch. I know the Arduino is at least partially accepting the sketch as I can change the blink value from say the classic 1:1 On:Off, to a 3:1 On:off and the LED responds accordingly. I'll post the error messages below.
Here is what I've done:
- Updated the Board manager
- Tried several USB cables
- Ensured that USB is a 2.0 connector and tried different ports
- Uninstalled and reinstalled drivers through device manger, including double tapping Arduino
- Tried IDE through download and online version
I think the key problem is the change from COM7 to COM8 during its upload process (look at the bottom I put it in bold and underlined). Any suggestions? Also I've seen this SAM-BA error in other forums but none of their solutions help.
Error 1 before changing COM port but knowing that at least the Blink sketch responds with changing the timing. (I deleted some of the error lines due to character limit that focused on the file paths, nothing was deleted after the 'Maximum is 262144 bytes' line.)
Arduino: 1.8.5 (Windows 7), Board: "Arduino MKRZERO"
Compiling sketch...
Compiling libraries...
Compiling core...
Using previously compiled file:
Sketch uses 10080 bytes (3%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM7, } / {} => {}
PORTS {} / {} => {}
PORTS {} / {COM8, } => {COM8, }
Found upload port: COM
C:\Users\Ryan\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM8 -U true -i -e -w -v C:\Users\Ryan\AppData\Local\Temp\arduino_build_595580/Blink.ino.bin -R
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Dec 20 2016 15:36:46
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] Dec 20 2016 15:36:46
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:46
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
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.836 seconds
Write 10336 bytes to flash (162 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)
SAM-BA operation failed
An error occurred while uploading the sketch
[=========== ] 39% (64/162 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)
[======================= ] 79% (128/162 pages)write(addr=0x20005000,size=0x880)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x880)
[==============================] 100% (162/162 pages)
done in 0.069 seconds
Verify 10336 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = cde2
checksumBuffer(start_addr=0x3000, size=0x1000) = bfd5
checksumBuffer(start_addr=0x4000, size=0x860) = 5262
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)