Hi,
I am using a modified HTTPS Client demo code [Let's say Version A] and sometimes when trying to debug with Segger Embedded Studio for ARM (Nordic Edition v 5.34a/Jlink 6.94a) [NRF Connect SDK V1.5.1/Windows 10], the code is unable to set breakpoints and ends up with the FIH_PANIC code section of the zephyr/main.c file and does not execute the program. It seems that a bootable images is not found. However, when debugging is not performed, the code executes correctly (as evidenced from my serial output). Interestingly, if I change the code slightly to Version B, the program after flashing to the MCU can be debugged. Then, if I revert the changes back to Version A and re-compile/re-flash, sometimes, the code is able to be debugged (even though previously it wasn't working).
What is causing this behavior? Of course, since debugging isn't working it is hard to see what's going on. My guess is this may be related to where the bootloader is looking to start executing from and somehow a pointer is getting corrupted.
Thanks