SAMD21E17D programming issue

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi all,

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.

This topic has a solution.
Last Edited: Thu. Jun 24, 2021 - 06:01 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

buneacalin wrote:
I supply from PICKIT the 3v3 to the MCU (VDDID&VDDANA&VDDCORE).

Don't supply VDDCORE! 1µF to GND is what you connect there. Check the datasheet 45.2.1 Power Supply Connections.

And no, there is no EEPROM space at address 0, it's at 0x00400000 when available, check 10.2 Physical Memory Map.

/Lars

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Feeding 3.3V into VDDCORE could have blown the chip.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all for answers. 

I have replaced the chip with a new one, I corrected the power supply as specified in documentation (I missed the fact that VDDCORE should not be connected directly). The new chip worked directly. For the old one, I have changed the fuses to the default values (I think BOD33USERLEVEL had some high value set) and it seems is still working (the chip was not fried although I get an error while programming it from time to time).

Do you guys think I should replace the first chip since it could have something broken inside? I have loaded an USART project using Atmel Board wizard and all the SERCOM 0-3 are working. By the way, the ASF wizard (and Atmel example) for USART did not worked for some reason... 

 

Last Edited: Wed. Jun 23, 2021 - 11:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you should replace the chip. Even for pure hobby work I would not keep a chip that might have issues (just imagine spending time on some problem and finding out it is a bad chip).

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:

I think you should replace the chip. Even for pure hobby work I would not keep a chip that might have issues (just imagine spending time on some problem and finding out it is a bad chip).

/Lars

 

Thank you. I have another question which is not really related to this topic... I want to use USART (with an RS485 transceiver) at ~9600 BAUD rate (maybe I'll go for a higher BAUD though). Do you think I can rely on the internal clock generator of ARM SAMD21 family or should I put an external crystal? The boards will stay inside the house so room temperature... 

With AVR I've read is a good idea to NOT use the internal 8 MHz clock generator because the accuracy can vary a lot with temperature... 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe I would use a crystal in a commercial product design but for me the internal SAMD21 clocking has been 100% reliable for USART (115200 and 9600).

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:

Maybe I would use a crystal in a commercial product design but for me the internal SAMD21 clocking has been 100% reliable for USART (115200 and 9600).

/Lars

 

I guess I will design the board with the external crystal option and I will solder it later if needed.

Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This fixed my issue!

Thanks.

Mac