How to debug domains

nRF Connect for VS Code

tags
nRF Connect for VS Code

You can debug sysbuild domains in the same way as you debug single-image build configurations.

To enable debugging for a domain, edit the sysbuild domain and set its optimization level to Optimize debugging experience. For the full set of debugging options, you can keep the Include debug thread information option enabled.

To start debugging multi-core applications, click Debug in the Actions View. In the quick pick, select the processor sessions to start and the images at whose entry points execution must stop. Images that run on the same processor are loaded into one GDB session. See How to debug applications for a multi-core System on Chip for more information.

Note

If this action is not available, the selected domain does not support debugging.

Take the following rules into account when you want to debug domains:

  • When you debug multiple domains, the entire sysbuild configuration is flashed before the debugger sessions are attached.
  • The extension starts one session for each selected processor and loads the images for that processor as GDB inferiors.
  • Each domain can have its own debug optimizations enabled independently. The top build configuration checks if debugging options are enabled for each specific domain.
  • The debug optimization set in the top build configuration is valid for the main domain, featured at the top of the domain list. Compared with enabling debugging for a build configuration, the main domain sets the CONFIG_DEBUG_OPTIMIZATIONS or the CONFIG_DEBUG_THREAD_INFO Kconfig options (or both), but other domains set <domain_name>_CONFIG_DEBUG_OPTIMIZATIONS or <domain_name>_CONFIG_DEBUG_THREAD_INFO Kconfig options (or both).
  • Some domains can inherit debug optimizations from other domains if this is set in the CMake configuration of the domain. For example, in the Asset Tracker application, the S1 domain gets its optimization settings from the MCUboot domain.
  • When using Debug with Ozone, the extension warns you if no debug optimizations are enabled for the domain you're trying to debug.