Arduino MKR ZERO blink sketch only works when uploaded from online editor

My new Arduino MKR ZERO arrived two days ago. When I tried to upload a blink example to Arduino from Arduino IDE, after double clicking the reset button, nothing happens. I mean I got the following message:

Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Oct 20 2016 15:20:47
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.607 seconds

Write 10376 bytes to flash (163 pages)

[=========== ] 39% (64/163 pages)
[======================= ] 78% (128/163 pages)
[==============================] 100% (163/163 pages)
done in 0.064 seconds

Verify 10376 bytes of flash with checksum.
Verify successful
done in 0.009 seconds
CPU reset.

This indicates that the upload was successful. However, the LED doesn't blink. When I tried to upload the same blink sketch from Arduino Web Editor the LED blinks properly, as expected. I have the latest version of Arduino IDE 1.8.6 and Arduino library for SAMD boards 1.6.19. My OS is Windows 10. I also tried to upload the blink sketch from Arduino IDE on Windows 7. The result is also unsuccessful, like on Windows 10.

It seems like a software problem as the board works normally when sketch is uploaded from Web Editor.

Please compare the two blink sketches as early example sketches used pin 13 but the MKR series use pin 6.

Newer examples use the "LED_BUILTIN" definition.

On MKR ZERO the onboard LED is connected to a dedicated pin (32). In both sketches (IDE and web editor) LED_BUILTIN was used. When I changed pin number to 32 from LED_BUILTIN, LED blinks after uploading the sketch from Arduino Web editor and doesn't blink when I uploaded it from IDE.

Both CREATE and IDE 1.8.5 work from here under win 7 x64 pro and the standard blink example and blink without delay.

Current core here is 1.6.19 for SAMD.

That makes me think it may be an issue local to your computer in some form.

Have you made any changes to the IDE in any way ?

Ensure a USB 2.0 port is being used and try other USB cables.

Turn off any antivirus or additional security software to test the desktop IDE.

I tested several other USB cables with USB 2.0 and freshly installed IDE on 3 PCs. The result was the same. I just have Windows antivirus software activated. What could be the difference between Arduino Create and IDE that is causing this? Can it be on the hardware side, something wrong with MKR ZERO?

Find it hard that the zero works with one IDE but not another so doubt a zero itself issue.

Both my MKRzero's work fine under win 7 or 10. (two seperate boxes).
Are there any messages in the lower console (turn on VERBOSE for UPLOAD) that may give a clue ?

You can post them back here as attachments if the code tags give you an issue.

Sketch uses 10120 bytes (3%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
PORTS {COM1, COM4, } / {COM1, COM4, } => {}
Uploading using selected port: COM4
C:\Users\macie\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM4 -U true -i -e -w -v C:\Users\macie\AppData\Local\Temp\arduino_build_213938/Blink.ino.bin -R 
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Oct 20 2016 15:20:47
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] Oct 20 2016 15:20:47
Version      : v2.0 [Arduino:XYZ] Oct 20 2016 15:20:47
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.605 seconds

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

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

[=======================       ] 78% (128/163 pages)write(addr=0x20005000,size=0x8c0)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x8c0)

[==============================] 100% (163/163 pages)
done in 0.064 seconds

Verify 10376 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 24fb
checksumBuffer(start_addr=0x3000, size=0x1000) = 2fd9
checksumBuffer(start_addr=0x4000, size=0x888) = 6c6a
Verify successful
done in 0.009 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

That all checks out as the same here apart from the checksums which will be different as I only uploaded BLINK and am not sure what you uploaded as the file size was different.

Have to honestly say I am stumped at this point.

The only thing I would try at this point is using the blink example with your own LED on a different pin and making the changes to BLINK to suit that pin.

If that works then there must be some sort of issue be it board or otherwise ?!

I actually tried to upload a simple sketch that prints to serial:

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  
  Serial.println("abc");
  
}

Again the sketch works only when uploaded from Arduino Create (returns "abc" on Serial) and although successfully uploaded from IDE doesn't return anything on Serial.

That again works on both IDE's

My primary trade is mech eng with I.T. as my second string and I am used to getting to the bottom of a problem and resolving it.
I have a feeling I am missing something quite simple and it is annoying me.

I am uploading sketches from Native USB port on Arduino IDE. I think that there is no distinction between native and programmer USB port on Arduino Create. Can this be a reason of problems? On programmers USB port I get errors

Build options changed, rebuilding all
Sketch uses 10120 bytes (3%) of program storage space. Maximum is 262144 bytes.
Open On-Chip Debugger 0.9.0-g932ec70 (2017-02-15-12:34)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Error: unable to find CMSIS-DAP device
Error: No Valid JTAG Interface Configured.
Error: No Valid JTAG Interface Configured.

I found the reason. I was selecting Arduino/Genuino Zero instead of Arduino MKRZERO in the boards menu. In Arduino Create board type was automatically selected as MKRZERO. Thanks for help.

PHEW LOL

Thanks for the honesty and KARMA for that

Thanks @Estragon12 - had the same problem and you gave me the solution!