west debug does not work and corrupts flash contents in multi-domain-projects (with sysbuild)

Wheh I try to debug a multi-domain-image on an nrf5340 or 52840, I can debug the mcuboot domain just fine. But when I try to debug the app-domain (I tried this with the zephyr/samples/sysbuild/with_mcuboot sample), gdb complains that it cannot find the bounds of the current function.

But what's worse, it corrupts part of the flash, so that when I step though the mcuboot-domain after that (which still works), I can see mcuboot fail to find a bootable image. Clearly this should not happen, right?

This can be reproduced with any nrf5340 or nrf52840 and the aforementioned sample . I used the nrf52840 on an nrf9160dk and a custom nrf5340 board.

Parents Reply
  • Hi Alex,

    Good to hear! Maybe you're thinking of the debug symbols, which are loaded from the ELF file to be used by the debugger. The issue in this case is that 'west debug' is flashing the zephyr.elf file to your target, which does not contain the signature needed by the bootloader to boot the app.

    Note that you can get verbose output from west by prefixing the build target with -vvvv: 'west -vvvv debug' to see what it does.

Children
Related