<?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>Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122623/debugging-tfm-application-on-nrf9151</link><description>I&amp;#39;m not able to debug any of example applications that uses non secure build. Non ns versions works fine. I have added CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO =y to my prj.conf. Debugger connects but I&amp;#39;m not able to pause it, place breakpoints or checking</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Nov 2025 12:08:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122623/debugging-tfm-application-on-nrf9151" /><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/555038?ContentTypeID=1</link><pubDate>Fri, 21 Nov 2025 12:08:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8952be-814d-4cda-80e9-239863275b60</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;We can have a look at your schematics if you&amp;#39;d like. Feel free to submit a new private ticket.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/554971?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 23:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5840d62d-5852-42d3-9724-61874568328e</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Similar behaviour in both cases - although debugger gets stuck more often with TF-M enabled.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked at teh DK schematics and the debugger should work the same for my board as for DK? The only difference is the SWO is connected to pin 0.22 on the DK, which I have not done on my custom board. But&amp;nbsp;it&amp;#39;s not being allocated to a UART TX pin (for example) in the DK device tree so&amp;nbsp;I can&amp;#39;t see any relevance there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Developing without logging is a real limitation. Do I need to buy a different piece of kit, or am I missing something here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/554938?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 15:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5fcca77-5b57-4e4f-a117-88dcce4dbec7</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Thanks for the additional details and a&lt;span&gt;pologies for the slow reply&lt;/span&gt;. Just to confirm, does everything work as expected&amp;nbsp;if you do these tests without building with TF-M?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Benjamin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/554327?ContentTypeID=1</link><pubDate>Fri, 14 Nov 2025 06:14:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7837b982-c63b-416c-9b25-3fa2f233d2de</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Good question! I did an experiment to explore.&amp;nbsp;I created a blinky application as a sandpit. Then I created a build configuration for the nRF9151_DK and one for my custom board (adding in SPI, PWM, I2C nodes).&lt;/p&gt;
&lt;p&gt;1. Everything worked perfectly on the DK - debugging logs and stepping through code.&lt;/p&gt;
&lt;p&gt;2. With the exact same setup, I could step through the debugger on the Custom board (external debugger from DK) but I could not get any console logs of any sort, either through COM port or RTT. I tried printk &amp;amp; logger. Nothing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. Custom board, but with custom board files = random behaviour! Including exactly what OP describes. I isolated the problem to my SPI flash memory device tree node, which is (apparently) malformed. So, even though I&amp;#39;m only running a blinky app, nRF Connect is clearly compiling and running some initialisation code for the SPI peripheral. And getting stuck. Why this only takes effect with debugging enabled - No idea! But I need to fix the device tree code!&amp;nbsp;It&amp;#39;s a pity there isn&amp;#39;t some sort of tree-shaking in place to avoid this - if only because it&amp;#39;s so counterintuitive to fault find...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TLDR -&lt;/p&gt;
&lt;p&gt;1. External debugging doesn&amp;#39;t appear capable of console logging. &lt;strong&gt;&lt;em&gt;Do I need to get a dedicated debugging dongle???&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Errors in device tree can break debugging sessions even if peripheral isn&amp;#39;t used!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/554033?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 22:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a5ce90d-8230-4cbb-b076-240b14aadb00</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Do you experience the same on a DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/553910?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 07:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:040b9b65-4d24-4904-b04c-2c4f9f1aa64d</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Hi, just to bump this thread, because my experience is the same as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/osmo-kieksi"&gt;odik&lt;/a&gt;&amp;nbsp;With an _ns application, I don&amp;#39;t seem to be able to debug anything at all. When I run the debugger, it gets stuck either inside cmsis_gcc_m.h or at reset_handler(). If I continue, it never triggers again, and never reaches my main (which has breakpoints waiting for it). I&amp;#39;ve tried all the suggestions I could unearth from this forum (CONFIG settings; -exec mon reset ... ) , but nothing appears to work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m working on a recent install of the nRF Connect environment in VS Code. My application is running on an nRF9151 on a custom board, and I&amp;#39;m using my 9151 DK as a programmer with the DEBUG OUT port (if that is relevant).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I just flash the code, it seems to work fine by the way. I can capture I2C transfers on my oscilloscope and fiddle with PWM outputs.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging TFM application on nrf9151</title><link>https://devzone.nordicsemi.com/thread/541019?ContentTypeID=1</link><pubDate>Tue, 01 Jul 2025 11:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e034e4c-973d-425e-99a2-2e5a277d4111</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;There was someone with a &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/111616/multi-image-build-with-selective-optimization-level"&gt;similar issue&lt;/a&gt; you could check out. In short you could try to set debug level in the &lt;code&gt;.config&lt;/code&gt; file under &lt;code&gt;build/{app_name}/zephyr/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-1-zephyr-rtos-advanced/topic/exercise-1-exploring-threads-and-isrs/"&gt;This&lt;/a&gt; exercise is also great to check if you are new to debugging in NCS on VSCode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The&lt;code&gt; CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO &lt;/code&gt;symbol is for debugging the code in the Secure Processing Environment. Applications are running in the Non-secure Processing Environment and this Kconfig symbol should not matter. &lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/readme_5F00_tfm_5F00_v81.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>