mcgeorge wrote:currently I have a board with a SAM9G45 and want to put into a sleep mode (triggered via button).
The problem is, afterwards I can't reconnect the target via J-Link debugger. Probably because the µC is still in sleep mode.
The AT91SAM9G45 has an ARM926EJ-S processor, and Atmel classifies it as a microprocessor (MPU) rather than a microcontroller (MCU).
mcgeorge wrote:Do I need to take additional steps to wake-up device before downloading/debugging firmware?
The ARM926EJ-S Technical Reference Manual mentions that if you want a debugger to force an exit from wait for interrupt mode (e.g. idle mode), then either issue an external debug request EDBGRQ, or a debug request made by writing to the DBGRQ bit of the ARM9EJ-S debug control register using scan chain 2.
The latter requires access to the ARM9EJ-S debug control register which needs to be enabled by asserting the DBGTCKEN input.
There's also reference to the ARM9EJ-S Technical Reference Manual for details of how DBGTCKEN is generated and used.
BTW you interchangeably use the (ambiguous) terms "LowPowerMode" and "sleep mode" with the use of PMC_CPUInIdleMode().
The SoC has five operating modes: normal mode, idle mode, slow-clock mode, standby mode, and backup mode.