2
votes

I'm testing the new MKR1000 in Windows. I'm having an annoying issue that causes Windows to re-install the Arduino drivers in another port every time I upload new code into the board. E.g.:

If the Arduino is installed on COM4, when I upload code into the board Windows decides to install Arduino on COM5. This causes the IDE to tell me that the upload procedure failed (as there is no Arduino connected on COM5), but strangely enough, the code actually uploads correctly.

If I want to open the Serial monitor I need to go in the IDE and change the Arduino port back to COM4. It's super annoying to have Windows go through the driver installation procedure every time I upload new code into Arduino.

Some generic information:

  • This happens in both Windows 7 & 8
  • I'm troubleshooting with the Blink example (pin 6)
  • The problems happens with both the Arduino IDE (1.6.11) & Arduino Create (1.0.38)
  • The MKR1000 is correctly installed in Windows, showing up in the Device Manager as 'Arduino MKR1000 (COM4)'
  • SAMD Board 1.6.6 is installed
  • Tried multiple USB cables

The error in the Arduino IDE is:

Arduino: 1.6.11 (Windows 7), Board: "Arduino/Genuino MKR1000"
Sketch uses 7,972 bytes (3%) of program storage space. Maximum is 262,144 bytes.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM3, COM4, } / {COM3, } => {}
PORTS {COM3, } / {COM3, } => {}
PORTS {COM3, } / {COM3, } => {}
PORTS {COM3, } / {COM3, COM5, } => {COM5, }
Found upload port: COM5
C:\Users\40009929\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino/bossac.exe -i -d --port=COM5 -U true -i -e -w -v C:\Users\40009929\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.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:35:16
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:35:16
Version      : v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16
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.823 seconds

Write 8124 bytes to flash (127 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

[===============               ] 50% (64/127 pages)write(addr=0x20005000,size=0xfc0)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0xfc0)

[==============================] 100% (127/127 pages)
done in 0.051 seconds

Verify 8124 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 7923
checksumBuffer(start_addr=0x3000, size=0xfbc) = b6c0
Verify successful
done in 0.010 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

In Arduino Create the problem is the same:

Atmel SMART device 0x10010005 found

Device : ATSAMD21G18A

Chip ID : 10010005

Version : v2.0 [Arduino:XYZ] Nov 24 2015 11:35:16

Address : 8192

Pages : 3968

Page Size : 64 bytes

Total Size : 248KB

Planes : 1

Lock Regions : 16

Locked : none

Security : false

Boot Flash : true

BOD : true

BOR : true

Arduino : FAST_CHIP_ERASE

Arduino : FAST_MULTI_PAGE_WRITE

Arduino : CAN_CHECKSUM_MEMORY_BUFFER

Erase flash

done in 0.822 seconds

Write 8116 bytes to flash (127 pages)


[=============== ] 50% (64/127 pages)
[==============================] 100% (127/127 pages)

done in 0.052 seconds

Verify 8116 bytes of flash with checksum.

Verify successful

done in 0.010 seconds

CPU reset.

SAM-BA operation failed

Could not program the board
3

3 Answers

2
votes

Hi based on your output there might be a reason why its doing that. Other developers can correct me if I am wrong.

When you upload a code to the ATSAMD21,

-->The IDE/development environment used will put the board into bootloader mode for 5seconds. (At 1200bps) //STEP 1

-->But when it uploads the program to the board the bootloader locks after successful upload and changes its port //STEP 2

-->At STEP 1, the micro works as NATIVE USB Port and calls PROGRAMMING USB Port

-->At STEP 2, the micro finishes programming and after reset it goes back to its default state - NATIVE USB Port (this is where your COM port changes to the next port).

-->If you observe carefully when you open hyperterm and open the connected Arduino port (say COM4 for example) at 1200bps in 5sec, in your device manager you will notice a USB Serial Device in place of your Arduino MKR board.

Hope it helps.

0
votes

Yeah I had the same problem too. Try to download arduino advance ide (enhanced release).

Here

This should help because when it does changes port it will tell you and ask you if you do want to.

Hope it helped!

0
votes

Here is my fix for SAM-BA operation failed. Situation Windows 7 with USB3 port (previously worked on Windows 7 machine with only USB2 ports) Uploading to Sparkfun Redboard Turbo

Put a USB 2 hub between the PC and the board.

SAM-BA error no longer occurres