I've started some personal projects and I decided to evolve from AVR 8-bit MCU to 32 bit ARM MCU. I have bought a PICKIT 4 programmer and I was able to successfully create a small wireless thermostat with SAMD11 MCU. With my current SAMD21E17D I'm struggling to program it. I always get the error
Since all the time the bytes that are read back are the same, my assumption is that the code is not even uploaded. The command line that I use to program the device is "c:\Program Files\Microchip\MPLABX\v5.50\mplab_platform\mplab_ipe\ipecmd.exe" /PATSAMD21E17D /FC:\Work\Personal\Embeded\TestSerCommSAM21E\GccBoardProject11\GccBoardProject11\Release\GccBoardProject11.hex /OAS0 /M /TPPK4 /W3.3. Basically I supply from PICKIT the 3v3 to the MCU (VDDID&VDDANA&VDDCORE). I have connected also both GND pins of MCU to the PICKIT GND MCU. I have a 10k pullup resistor for MCLR and a 1k pullup resistor for SCK (according to Microchip documentation). I've also put 3x100 nF capacitors on the breadboard thinking they might help but they don't. I have used the slow programming speed option ("/OAS0").
Strange thing is that if I replace the "/M" parameter with like "/MP0x1000-0x20ffff" the program is uploaded without any errors but the simple LED blink code does not work.
My thought is that this MCU has 132KByte flash instead of 128Kbytes so maybe first 4 KBytes are emulated EEPROM or something?
I've also played with the "NVMCTRL_REGION_LOCKS" fuse value alternating it between FFFF and 0000 but didn't helped.
My fuses look like this:
Thank you all in advance.