<?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 can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125532/how-can-i-access-the-stack-and-heap-start-end-memory-addresses-from-the-zephyr-code</link><description>Hello, 
 is there any way to access the Stack and Heap Start/End memory addresses from the zephyr code? 
 I have found the __INITIAL_SP definition that gives the Stack start in cmsis_gcc_m.h. 
 In the same file there is the __StackLimit, but when I include</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Nov 2025 07:52:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125532/how-can-i-access-the-stack-and-heap-start-end-memory-addresses-from-the-zephyr-code" /><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554217?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 07:52:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9337252a-ed2b-4324-8054-0c24c8257982</guid><dc:creator>tmav</dc:creator><description>&lt;p&gt;Thanks you so much.&lt;/p&gt;
&lt;p&gt;This is what I was looking for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554172?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 16:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:786c62d0-2dfc-4f62-8191-7daac070f281</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;You can take a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/117640/check-ram-usage-during-runtime-of-my-application/516668"&gt;this post&lt;/a&gt;. The&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_low_level_heap_allocator.html"&gt;Low Level Heap Allocator&lt;/a&gt;&amp;nbsp;API&amp;nbsp;and this&amp;nbsp;&lt;a title="sys_heap" href="https://github.com/nrfconnect/sdk-zephyr/tree/ncs-v3.1.1/samples/basic/sys_heap"&gt;sys_heap&lt;/a&gt; sample also might help.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554085?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 09:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbf34f72-efab-41a6-ae24-1a9355b6a006</guid><dc:creator>tmav</dc:creator><description>&lt;p&gt;Many thanks for all info.&lt;/p&gt;
&lt;p&gt;Is there any function to get the stack/heap available size in my app?&lt;/p&gt;
&lt;p&gt;I would like to log these statistics in case of a HardFault and help me to trace back the error.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Thanasis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554020?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 18:39:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae6fb08b-9e00-4dfb-96ea-f2c0498d5e59</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use VS Code/&amp;nbsp;&lt;span&gt;Thread Viewer to debug with stack usage.&amp;nbsp;&lt;/span&gt;You can take a look at&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/debug_thread_viewer.html"&gt;How to work with the Thread Viewer&lt;/a&gt;&amp;nbsp;and this DevAcademy course &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/debugging-in-vs-code/"&gt;Debugging in nRF Connect for VS Code&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554008?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 16:40:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b0c1488-3482-4402-8fb0-2c2eb3732457</guid><dc:creator>tmav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;with Keil &amp;amp; nRF52832, my app was calculating the Stack &amp;amp; Heap statistics for debug reasons.&lt;/p&gt;
&lt;p&gt;Now, I am trying to port my nRF52 code to nRF54L15 and the Bare metal SDK and I would like to have something similar.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I access the Stack and Heap Start/End memory addresses from the Zephyr code?</title><link>https://devzone.nordicsemi.com/thread/554005?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 16:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20e7b57e-a88d-446c-b7e5-ef543dce8741</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you elaborate more on what you want to achieve?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the nRF5 SDK, there was typically only one stack, but there is one main stack for handling interrupts in addition to one stack for each thread in Zephy. For the heap, it will also depend on how the heap(s) are &amp;quot;allocated&amp;quot; in a given app.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>