<?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 check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119788/how-to-check-if-hw-stack-protection-is-enabled</link><description>Hi, 
 I have added &amp;quot; config HW_STACK_PROTECTION&amp;quot; in KConfig file of the board. 
 Is there a way I can check during runtime if the Stack Protection is enabled? Is there any register to check this?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Mar 2025 09:23:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119788/how-to-check-if-hw-stack-protection-is-enabled" /><item><title>RE: How to check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/thread/527552?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 09:23:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63ca4690-8551-4cc3-8863-411028712948</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="VinothBrose"]Where can I see these log messages? I&amp;#39;m debugging with nrf Connect on VS Code.[/quote]
&lt;p&gt;I see the logs on UART. See &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/test_and_optimize/logging.html"&gt;Logging&lt;/a&gt;. Also, getting logs from an application is among the first steps to get started with the nRF Connect SDK in &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;DevAcademy fundamentals&lt;/a&gt;. Follow this course to learn how to see the logs in the VS Code extension. (Using the nRF Serial Terminal)&lt;/p&gt;
[quote user="VinothBrose"]A small observation. Stack Overflow error works only with MPU?[/quote]
&lt;p&gt;See &lt;a href="https://github.com/zephyrproject-rtos/zephyr/discussions/28866"&gt;https://github.com/zephyrproject-rtos/zephyr/discussions/28866&lt;/a&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/thread/527542?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 08:46:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f008e69-9d0c-4ba4-a5ab-221bb75b1238</guid><dc:creator>AlphaBeta</dc:creator><description>&lt;p&gt;A small observation. Stack Overflow error works only with MPU?&lt;/p&gt;
&lt;p&gt;Where can I see these log messages? I&amp;#39;m debugging with nrf Connect on VS Code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/thread/527520?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 08:01:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f487e691-743d-45de-b5ec-fbdb6f5147ce</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;&lt;span&gt;CONFIG_HW_STACK_PROTECTION&lt;/span&gt; seems to be enabled by default for me, so I tried to explicitly set it to &amp;quot;n&amp;quot;.&lt;br /&gt;Here are logs from a test I did with (first) and without (last) CONFIG_&lt;span&gt;HW_STACK_PROTECTION&lt;/span&gt;: &lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1742198464633v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/thread/527390?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 13:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4cdc663-25eb-408e-96a0-3e25882c12a1</guid><dc:creator>AlphaBeta</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741959441709v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In both cases, I get usage fault exception. There is NO indication that a stack overflow error has been caught.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if HW Stack Protection is enabled?</title><link>https://devzone.nordicsemi.com/thread/527352?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 11:34:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:102ed667-cc4a-4338-abbb-c055f768f41d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest trying to create a stack overflow in a test project. Then run the stack overflow both with and without this config and observe the difference.&lt;/p&gt;
&lt;p&gt;See for example &lt;a href="https://stackoverflow.com/questions/392859/generate-a-stack-overflow"&gt;https://stackoverflow.com/questions/392859/generate-a-stack-overflow&lt;/a&gt; on how to do this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>