Getting Started with RSL10
www.onsemi.com
34
Besides using GPIOs, UART, and other peripherals as tools to help debug your application, you can reattach the
debugger after the device wakes up from sleep. To do so, you need to make sure that the device stays awake, and start a
new debug session to connect to the running target, making sure a reset is not performed. The following instructions
show an example of how to perform this on the
peripheral_server_sleep
sample application in the ON Semiconductor
IDE, but you can also adapt it for other applications that use sleep mode, and for other IDEs.
1. Copy the
peripheral_server_sleep
application into your workspace and navigate to the
app_process.c
source
file under the
code
folder.
2. Modify the function void
Continue_Application(void)
by adding a
while
loop before the
Main_Loop();
call, to make sure that the device stays awake in the infinite loop after waking up (see
Figure 40). Save and compile your application.
Figure 40. Continue_Application Function Perspective After Adding While Loop
3. Within the Project Explorer, right-click on the
.elf
file and select
Debug As
>
Debug Configurations
.
4. When the
Debug Configurations
dialog appears, create two debug sessions:
a.
Debug session that initiates restart and halts the target:
i.
Right-click on
GDB SEGGER J-Link Debugging
and select
New
. A new configuration appears
under the
GDB SEGGER
heading, with new configuration details in the right panel.
ii. Adjust the displayed values for your configuration and click on
Apply
NOTE: If you are having trouble downloading firmware to the device, in addition to using DIO12, you
can also perform the software recovery by setting the
Reset Type
to 1 in the
Debug
session
configuration (see Figure 41). The default Reset Type is 0, which only resets the Arm Cortex-M3
core while leaving the device/peripherals in a state where J-Link can't reconnect. Setting the
Reset Type to 1 ensures that not only is the Arm Cortex-M3 core reset, but so are all the
peripherals. If this does not work, see Section 6.4.1, “Downloading Firmware in Sleep Mode” on
page 40.