Unable to upload Blink Example

Hi,

I got the Arduino engineers kit and have installed the mkr1000 on a win 7 PC.
Everything seems to be working OK, except when I try to upload I get an error.

I have been trying to upload the blink example and while it gives an upload error it does seem to run the program. I changed the delay values to 5 seconds and the light stays on for 5 seconds but I still get the upload error below.
Thanks for any help.

Arduino: 1.8.9 (Windows 7), Board: “Arduino/Genuino MKR1000”

“C:\Users\Lorna\AppData\Local\Temp\arduino_build_688441/Blink.ino.elf”
Sketch uses 10072 bytes (3%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM5
PORTS {COM1, COM5, } / {COM1, } => {}
PORTS {COM1, } / {COM1, } => {}
PORTS {COM1, } / {COM1, } => {}
PORTS {COM1, } / {COM1, COM6, } => {COM6, }
Found upload port: COM6
C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM6 -U true -i -e -w -v C:\Users\Lorna\AppData\Local\Temp\arduino_build_688441/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:43
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:43
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43
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.880 seconds

Write 10328 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.065 seconds

Verify 10328 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 6c52
checksumBuffer(start_addr=0x3000, size=0x1000) = 6ab3
checksumBuffer(start_addr=0x4000, size=0x858) = a21e
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)