User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 28
www.energymicro.com
Figure 6.2. Device Unlock
Unlocked
Cortex
Extended
unlocked
Extended APP
Locked
No access
APP
Program
execution
Reset
150 us
47 us
No access
APP
Cortex
255 x 47 us
No access
Program
execution
Figure 6.3. APP Expansion
swdio
swclk
app_expand
The device is unlocked by writing to the AAP_CMDKEY register and then setting the DEVICEERASE bit
of the AAP_CMD register via the debug interface. This erase operation erases the main block of flash,
all lock bits are reset and debug access through the AHB-AP is enabled. The operation takes 125 ms to
complete. Note that the SRAM contents will also be deleted during a device erase.
The debugger may read the status from the AAP_STATUS register. When the ERASEBUSY bit is set
low after DEVICEERASE of the AAP_CMD register is set, the debugger may set the SYSRESETREQ
bit in the AAP_CMD register. After reset, the debugger may resume a normal debug session through
the AHB-AP.
Note
If the debug pins are reconfigured for other I/O purposes than debug, a device erase may
no longer be executed. The pins are configured for debug in their reset state.