<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to enable debugging on nRF9151 non-secure build?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126115/how-to-enable-debugging-on-nrf9151-non-secure-build</link><description>nRF9151 has access port protection enabled by default. I need to debug firmware for nRF9151 produced by a non-secure build. I am trying to follow Figure 120 (Access port unlocking) from the datasheet, 
 
 interpreting each instruction as following: 0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Dec 2025 15:11:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126115/how-to-enable-debugging-on-nrf9151-non-secure-build" /><item><title>RE: How to enable debugging on nRF9151 non-secure build?</title><link>https://devzone.nordicsemi.com/thread/556893?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2025 15:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53ee4b4d-281b-4157-be5d-11dd2d82b9b3</guid><dc:creator>davidoglu</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried a more modern development environment, VS Code. It really does many fancy things, like colorize my source code. But my hands are too old for this. I was mainly looking for a way to debug with GDB, and I had no luck running &amp;quot;west debug&amp;quot; on SDK v2.7.0 due to &amp;quot;Python dependencies were missing&amp;quot;, even though everything was installed.&lt;br /&gt;&lt;br /&gt;However, thanks to your suggestion to use the VS Code extension, I got some hints. I noticed how VS Code summons JLinkGDBServerCLExe and I recreated the procedure with just the terminal:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ nrfutil device recover
$ JLinkGDBServerCLExe -device nRF9151_xxCA -if SWD -speed 4000 -nogui -singlerun&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then, in a separate terminal,&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ arm-zephyr-eabi-gdb
(gdb) target remote :2331
(gdb) file build/merged.hex 
(gdb) load
(gdb) mon reset
(gdb) file build/app/zephyr/zephyr.elf
(gdb) b main
(gdb) c
Continuing.
Breakpoint 1, main () at src/main.c:437
437        ...
(gdb) &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Just works!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable debugging on nRF9151 non-secure build?</title><link>https://devzone.nordicsemi.com/thread/556850?ContentTypeID=1</link><pubDate>Fri, 12 Dec 2025 10:19:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6040422-ca07-4159-a027-83fbabc2eb2d</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi Denis,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you are doing is a super manual way of debugging. I would recommend you looking into this &amp;quot;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/"&gt;Dev Academy - Debugging&lt;/a&gt;&amp;quot;. This is an easier way to debug.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is also some documentation on debugging a non-secure project (&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/test_and_optimize/debugging.html#debugging_secure_and_non-secure_firmware"&gt;link&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;By default, you can only debug the non-secure part of the application. If you want to debug the secure part, you have to enable&amp;nbsp;the Trusted Firmware-M debug symbols.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you are using VS Code with the nRF Connect for VS Code extension, This will be done automatically for you when you debug through the extension.&lt;/p&gt;
&lt;p&gt;Also, if you want to debug the program with ozone, the VS Code extension should detect that zone is installed and should show the action &amp;quot;Debug with Ozone&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope I was able to help you.&lt;/p&gt;
&lt;p&gt;If you need more information, fell free to ask!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>