4. Hotplug (Attach) the GDB debugger

Hotplugging a GDB debugger refers to the ability to connect a GDB debugger to a running target system (such as a microcontroller or embedded system) without needing to reset or interrupt the system’s execution. Essentially, it means attaching the debugger to a system that is already powered on and actively running its code.

Hotplugging allows for attaching the debugger dynamically while the system is running, which can be particularly useful in certain real-time or embedded scenarios where you cannot afford to pause or restart the system.

Note

Since the DA1459x family of SOC’s will not go into sleep-mode when the debugger is connected, the only way to debug a system when sleep mode is enabled, is using hotplug (attach).

Hotplugging the GDB debugger has several advantages:

  1. Non-Disruptive: Hotplugging allows you to attach a debugger to a running process without stopping or restarting it. This means you can investigate issues in real-time without interrupting the application’s workflow or causing downtime.

  2. Real-Time Debugging: You can start debugging a system at the moment an issue occurs, rather than relying on logs or waiting for the problem to reproduce. This is particularly valuable for intermittent or hard-to-reproduce bugs.

  3. Performance and Resource Efficiency: Since the system isn’t paused or restarted, you don’t lose any of the runtime context or state, which could otherwise be important for diagnosing the problem.

  4. Avoiding Overhead from Debugging Tools: Some debuggers can introduce overhead when enabled. With hotplugging, you can avoid the constant overhead by only enabling the debugger when necessary, and disabling it afterward.

  5. Better for Long-Running Systems: For systems that need to run continuously (like certain ble applications), hotplugging allows debugging without taking the system offline or losing important session data.

4.1. Adding the Hotplug launcher in e²studio

In order to use Hotplug debugging in e²studio a ‘Hotplug’ debug launcher needs to be added in the Debug Configuration section of e²studio.

Run the Debug Configurator by clicking Run->Debug Configurations:

_images/run_debug_configurations.png

Figure 4 Start GDB debugger Configurator

Select the xxx DA1459X-00-Debug_eFLASH launcher in the Renesas GDB Hardware Debugging section and click Duplicate:

_images/duplicate.png

Figure 5 Duplicate xxx DA1459X-00-Debug_eFLASH launcher

The launcher, including all the settings, are duplicated and the name is extended with a number (1):

_images/duplicated.png

Figure 6 Duplicated xxx DA1459X-00-Debug_eFLASH launcher

  1. Change the name to xxx DA1459x-00-Attach

  2. Click on the Debugger tab and

  3. Go to the Connection Settings

  4. Set all the Reset related items to No

  5. Remove the Script File (DA1459x.JLinkScript) (If this has been added in previous steps)

  6. Set the Hotplug item to Yes

  7. Click Apply

_images/connection_settings.png

Figure 7 Connection Settings

  1. Next click on the the Startup Tab

  2. Set the Load type to Symbols only

  3. Uncheck both Set breakpoint at: and Resume

  4. Press Apply and

  5. Start Debug

_images/startup.png

Figure 8 Startup Settings

If you follow the above steps carefully, the new Attach launcher should have been created and you can attach the GDB debugger to a running system without disturbing the running application.