Author Topic: cannot program samd4s after going into sleep mode  (Read 1389 times)

0 Members and 1 Guest are viewing this topic.

Offline calvinglosterTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: za
cannot program samd4s after going into sleep mode
« on: August 30, 2026, 06:17:10 am »
Once my program goes into deep sleep and i need to reprogram it, I normally have to physically pull PB12 (erase pin) to vcc and do a power cycle to completely clear the flash and then i can reprogram the micro. IS there any other way to do this? I asked claude and chat gpt but they are as smart as the watered down population.


I did notice under the project settings there are some programming settings where you can selects how to erase the chip then boot selection then reset strategy. Under reset strategy are:


Normal

Core only

HW Reset and Halt

breakpoint at VTOR(1)

DWT breakpoint on flash


Would any of these help me program my board once it falls into a deep sleep?


Im using an atmel ice and atmel studio 7. When i click apply in the programming window the ice doesnt even identify the sam4sd32C micro as if its not connected. I suspect its because all clocks are off etc due to deep sleep.


What strategy should you use to develop low power programs where you are required to deep sleep. Its so annoying having to pull erase pin high, power cycle, set fuses then program and test again just to do it all again because the micro goes into deep sleep.

 

Offline abstractsig

  • Newbie
  • Posts: 2
  • Country: nz
Re: cannot program samd4s after going into sleep mode
« Reply #1 on: September 02, 2026, 12:52:26 am »
On some of microchips other CPUs, samd2x,samd5x, the debugger must use "CPU Reset Extension" to connect to a device that has gone into sleep mode.

I am not familiar with the samd4s but might be worth a look to see if it also has the reset extension function.

 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1725
  • Country: de
    • Renate's Android Page
Re: cannot program samd4s after going into sleep mode
« Reply #2 on: September 02, 2026, 04:10:37 am »
I have an Atmel ICE and I wrote my own programmer for SAMD21, among others.
I don't know the SAMD4.

For some STM32F you can just pull reset down, get your IDR, put your DHCSR in debug/halt and release reset.

The SAMD21 won't even tell you the IDR if the reset is held.
You need to electrically release reset.
If you reset with SWDCLK low that is a "cold reset", with it high it is a "warm reset".
I do a cold reset first, program, then a warm reset to finish off.
I'm not saying that I understand this all, but it works for me.

Then there is the "release reset" that you can send to the DSU too.
I'm not using that right now.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf