Pickit 4 SAMD mcu

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

Hi

 

I am new in ARM(sam) programming. Is it possible to programm samD21e18A with pickit 4? When i am trying i get this message

Connecting to MPLAB PICkit 4...

Currently loaded versions:
Application version............00.04.15
Boot version...................01.00.00
Script version.................00.02.97
Script build number............117b21ad10
Target voltage detected
Target device ATSAMD21E18A found.
Device Revision Id = 0x3

 

Configuration memory will not be programmed because no configuration bits settings have been defined in your code. To program configuration memory, either define the settings in your code or use the Program Configuration Bits button on the configuration memory window.

 

Erasing...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x9ff

Verify failed. [ Pgm ] at 0x0, expected 0x20002470, got 0xffffffff
You have set the program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again.

Programming did not complete

Last Edited: Mon. May 20, 2019 - 12:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello  thanospr , were you able to get that problem fixed?, I am facing similar issue with MPLAB X 5.30, I am using SAMD51P20 (Metro M4 from Adafruit) and MPLAB SNAP debugger tool.

Ing. Jose Luis Arevalo
Mexico City

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

Those look suspiciously like you're trying to overwrite the bootloader area of the flash (which starts at 0) without turning off the write protection (all the SAMD chips put their bootloader at flash location 0, and I know for sure that the metro m4 comes with a bootloader programmed.  You need to use a different linker script to build your own software to be located AFTER the bootloader.)

 

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

 

I am having this same issue as OP. I am wondering if there is an issue with the configuration bits?

 

As far as I can tell, my bootloader is set to be 16 Kb, and I changed the linker script to start ROM at 0x4000. I'm just trying to program a basic Atmel Start generated FreeRTOS image to start.

 

/* Memory Space Definitions */
MEMORY
{
    rom     (rx)    :   ORIGIN = 0x00004000, LENGTH = 0x00080000 - 0x00004000
    ram     (rwx)   :   ORIGIN = 0x20000000, LENGTH = 0x00030000
    bkupram (rwx)   :   ORIGIN = 0x47000000, LENGTH = 0x00002000
    qspi    (rwx)   :   ORIGIN = 0x04000000, LENGTH = 0x01000000
}

but I am getting the same error as OP

Connecting to MPLAB Snap...

Currently loaded versions:
Application version............00.03.85
Boot version...................01.00.00
Script version.................00.03.77
Script build number............648e375535
Tool pack version .............1.1.178
Target device ATSAMD51J19A found.
Device Id Revision = 0x0

Erasing...

The following memory area(s) will be programmed:
program memory: start address = 0x4000, end address = 0x7ffff
User Id Memory

Verify failed.  [ Pgm ] at 0x4000, expected 0x0f01f1b9, got 0xffffffff
You have set the program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again.
Programming did not complete.

 

 

I lowered the SWD speed on the snap from the default 2.000 MHz to 0.032 MHz ( the minimum ) and double checked the configuration bits (screenshot below). I don't think it is an issue with bootloader protected memory. I'm digging though the datasheet now to see if there is another bit I need to set to program the chip, but if anyone could provide insight I surely would appreciate it.

 

 

 

 

EDIT: I seem to have found my problem. I thought the region lock bits should be 0's to unlock the region. I changed NVMCTRL_REGION_LOCKS to 0xFFFFFFFF and was able to program the board. Hope this helps someone get here faster than I did...

 

Last Edited: Thu. May 21, 2020 - 09:08 PM