arduino / arduino/ArduinoCore-samd

Fail to upload to MKR1000 on Windows 7

Open
#198 11 comments 0 reactions 0 assignees View on GitHub
waiting for feedback
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

The MKR1000 board I've been working with for months failed upload consistently on several Windows 7 computers(all have the exact same image and configuration) with the following error,

```
Sketch uses 8944 bytes (3%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM1, COM3, COM7, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, COM12, } => {COM12, }
Found upload port: COM12
C:\Temp\arduino-1.8.0\portable\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM12 -U true -i -e -w -v C:\Users\msguest\AppData\Local\Temp\arduino_build_272849/sketch_jan04a.ino.bin -R
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Nov 24 2015 11:34:08
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] Nov 24 2015 11:34:08
Version : v2.0 [Arduino:XYZ] Nov 24 2015 11:34:08
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.802 seconds

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

[============= ] 44% (64/144 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

[========================== ] 88% (128/144 pages)write(addr=0x20005000,size=0x400)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x400)

[==============================] 100% (144/144 pages)
done in 0.065 seconds

Verify 9200 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 7cfc
checksumBuffer(start_addr=0x3000, size=0x1000) = 5acd
checksumBuffer(start_addr=0x4000, size=0x3f0) = 3b88
Verify successful
done in 0.013 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)
```

What I have tried:
1. Tried the same board on my own Win7 PC before and after it failed on those machines --> worked fine
2. Tried other MKR1000 boards on those machines --> no luck
3. Tried changing cables --> no luck
4. Tried both USB2.0 and USB3.0 ports --> no luck
5. Tried same board on a Win10, a Mac(10.11) and a Linux(Debian 8.3)--> worked fine
6. Tried both IDE 1.6.7 SAMD version 1.6.8 and IDE 1.8.0 SAMD version 1.6.11 --> no luck
7. Tried Due board on those machines --> worked fine(Due and MKR1000 seemed to use the same bossac.exe)

What exactly can cause an error of "SAM-BA operation failed"? Without more info about that, I couldn't figure out what's so special about those machines that make them "incompatible" with MKR1000 driver or uploader.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported Arduino IDE bossac upload command and compare the failing Windows 7 path with the successful Win10, macOS, and Debian cases. Reproduce the failure on the affected Windows 7 machines and identify why SAM-BA fails during the second flash write; done means a confirmed cause and a verified upload.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.