ERASE pin deletes running firmware

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

Hello,

We have a custom board based on ATSAM4E16E processor and we have ERASE pin connected to a pull down resistor to GND of 10k and also a push button that connects to 3.3V (as seen in attachment). We noticed that if we press the push button after firmware started then the firmware running stops and if we read with Device Tool from Atmel Studio (v6.2 build 1563), flash is empty, filled with 0xFF . 

 

Another issue is that if we reprogram with command line our firmware we can see it was correctly programmed in the flash but would not start running (not even after Power-cycle) until we reprogram it by entering Debug mode via Atmel Studio.

Command line:

atprogram.exe -t atmelice -i JTAG -xr -d ATSAM4E16E reset

atprogram.exe -t atmelice -i JTAG -xr -d ATSAM4E16E erase

atprogram.exe -t atmelice -i JTAG -xr -d ATSAM4E16E -v program --verify --format hex -f firmware.hex

atprogram.exe -t atmelice -i JTAG -xr -d ATSAM4E16E reset

 

When we read the GPNVM bit is set to BOOT_MODE=0 for booting from flash.

Any idea what's wrong? Datasheet says the Erase full flash happens only during a power-cycle if the pin is high for 220ms but that's not the behavior we see, we wouldn't expect an erase (and firmware stop) during normal firmware operation. Also Errata (Atmel-11157F-ATARM-SAM4E16-SAM4E8-Datasheet_27-Apr-15.pdf) doesn't mention anything related to this problem, is this the latest revision of the datasheet?

 

Thank you and best regards,

David.

 

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Jan 20, 2016 - 12:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you servicing the watchdog as it is enabled by default.
 

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

Yes, first thing I do is to disable it.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bit CCFG_SYSIO.12 needs to be set so that ERASE pin is actual input and to boot from flash needed to add:

atprogram -t atmelice –i JTAG -d ATSAM4E16E write --fuses --values 0x02