<?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>View Global variable Address in Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109675/view-global-variable-address-in-segger-embedded-studio</link><description>Hi, 
 I want to view the Address of the Global variable In Segger Embedded Studio. I want to check this when debugger is not connected and not during runtime. Is there is any way to view that? 
 Thank you, Shreya JB</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Apr 2024 06:00:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109675/view-global-variable-address-in-segger-embedded-studio" /><item><title>RE: View Global variable Address in Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/478855?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2024 06:00:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3841be6d-c1ea-40bc-abec-1251a2bf330c</guid><dc:creator>Shreya J B</dc:creator><description>&lt;p&gt;Hi Terje,&lt;/p&gt;
&lt;p&gt;Thank you for providing the information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: View Global variable Address in Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/476784?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 09:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89160af1-f9d0-4e42-98ef-5682f87e4297</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The structure members will be layed out according to the specification of the C language and/or the toolchain implementation, accounting for any packing/aligning of data and so on, with the struct itself (typically the first member of the struct) at the address found in the map file.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: View Global variable Address in Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/476045?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 06:29:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ef2096f-edb9-4ae2-a4de-dcd0bf294bb1</guid><dc:creator>Shreya J B</dc:creator><description>&lt;p&gt;Hi Terje,&lt;/p&gt;
&lt;p&gt;Thank you for the information. can we find the Globally defined structure members in that file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: View Global variable Address in Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/475942?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 13:49:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5171a1d9-a2d7-4413-8a45-de52e102890b</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;All static variables (this includes global variables) are listed with their address in the &lt;em&gt;.map&lt;/em&gt; file, which is among the output files when you build the project. Static variables are placed in the &lt;em&gt;data segment&lt;/em&gt;, so in the map file they will be listed on the form &lt;code&gt;.data.VARIABLE_NAME&lt;/code&gt;, where &lt;code&gt;VARIABLE_NAME&lt;/code&gt; is the name of the variable.&lt;/p&gt;
&lt;p&gt;For example, in the ble_app_hrs_pca10040_s132 example of nRF5 SDK v.17.1.0, in &lt;em&gt;main.c&lt;/em&gt; there is a global variable &lt;code&gt;m_conn_handle&lt;/code&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/pastedimage1711460378001v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Building the project and opening the .map file...&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/pastedimage1711460222260v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;...reveals that the memory address used by the global variable &lt;code&gt;m_conn_handle&lt;/code&gt; is &lt;code&gt;0x20002cc0&lt;/code&gt;, for this particular build:&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/pastedimage1711460439969v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Please note that the address may be different when built on a different computer, or with a different toolchain or version of the toolchain, or at a different folder location, or at a different point in time, etc.&lt;/p&gt;
&lt;p&gt;The same generally applies for all c projects and for all SDKs: If you have a look in the map file, then you should find the memory locations given to static variables in the data section.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>