SAM3X8E gpnvm bit 1 not cleared after flash erase

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


Hi,

 

I have a question regarding the SAM3X boot strategies.

 

The datasheet says "Asserting ERASE clears GPNVM bit 1 and thus selects the boot from the ROM by default".

But when I erase the flash with JLink tool, the GPNVM bit 1 is not cleared.

Furthermore if I clear the GPNVM bit 1 manually and then erase the flash, the GPNVM bit 1 is set !

 

With JLink tool,

read GPNVM bits : w4 0x400E0A04, 0x5A00000D

read result : mem8 0x400E0A0C, 1

-> GPNVM bit 1 is 1

reset GPNVM bit 1 : w4 0x400E0A04, 0x5A00010C

read GPNVM bits : w4 0x400E0A04, 0x5A00000D

read result : mem8 0x400E0A0C, 1

-> GPNVM bit 1 is 0

erase : erase 0x00080000 0x000BFFFF

read GPNVM bits : w4 0x400E0A04, 0x5A00000D

read result : mem8 0x400E0A0C, 1

-> GPNVM bit 1 is 1 (should be 0)

 

Here is the datasheet saying ERASE clears the GPNVM bit 1.

 

Any help is appreciated to understand this behavior.

 

Thanks.

 

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

Did you tried erasing by asserting the erase pin to 3,3V? I don’t which pin but this worked for me. 

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

Hi,

 

Thanks to your comment I think I have a better understanding of what is happening.

 

I use the JLink tool to erase the flash. I though the ERASE pin was used to perform the operation but it is not.

 

I am wondering if the JLink tool set the GPNVM bit 1 itself ...

 

see :

 

J-Link>w4 0x400E0A04, 0x5A00010C // reset GPNVM bit 1
Writing 5A00010C -> 400E0A04
J-Link>w4 0x400E0A04, 0x5A00000D // read GPNVM bits
Writing 5A00000D -> 400E0A04
J-Link>mem8 0x400E0A0C, 1 // read result
400E0A0C = 00 // GPNVM bit 1 is 0
J-Link>erase 0x00080000 0x000BFFFF // erase flash 0
Erasing selected range...
J-Link: Flash download: Total time needed: 4.552s (Prepare: 0.185s, Compare: 0.000s, Erase: 4.362s, Program: 0.000s, Verify: 0.000s, Restore: 0.004s)
J-Link: Flash download:
Flash sectors within Range [0x00080000 - 0x000BFFFF] deleted.
Erasing done.
J-Link>w4 0x400E0A04, 0x5A00000D // read GPNVM bits
Writing 5A00000D -> 400E0A04
J-Link>mem8 0x400E0A0C, 1 // read result
400E0A0C = 02 // GPNVM bit 1 is 1
J-Link>

 

Why GPNVM bit 1 is 1 after flash erase with JLink command line tool ?