<?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 configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10381/how-to-configure-rtt-with-a-fixed-address-in-iar</link><description>Hello.
I am using RTT successfully with nrf52 and IAR. But the start address for the RTT control block is a moving target: it changes whenever my code changes. I want to assign this block a specific memory section starting at 0x20000000 in ram and placing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Jul 2016 05:46:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10381/how-to-configure-rtt-with-a-fixed-address-in-iar" /><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38539?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 05:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c3a8595-3c60-4c40-acd1-3c1c3201fbbc</guid><dc:creator>R. Kawajiri</dc:creator><description>&lt;p&gt;Could you show liker script example for gcc?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38537?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 15:54:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58e1a31f-d68d-40d6-a625-3fb688cbb65c</guid><dc:creator>stephan</dc:creator><description>&lt;p&gt;Alex, good idea. I did not try it because I just found a solution, but it might be helpful for others ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38538?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 15:53:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a3f52ac-dc7a-44a1-99e6-503cd23d4181</guid><dc:creator>stephan</dc:creator><description>&lt;p&gt;&lt;em&gt;Looks like I found a solution myself:&lt;/em&gt;
In ICF one must define the section RTT_section:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;define block RTT with alignment = 8, size = Size_RTT { section RTT_section };
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and the block can just be put first into RAM:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;place in RAM_region   { first block RTT, readwrite, block CSTACK, block HEAP };
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In SEGGER_RTT.c, the definition of  _SEGGER_RTT can be rewritten with &amp;quot;@&amp;quot; directive in order to place it in the previously introduced section:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SEGGER_RTT_CB _SEGGER_RTT @ &amp;quot;RTT_section&amp;quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Start of RTT block is at 0x20000000 as expected and other stuff will be placed thereafter.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Comple ICF:&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/*###ICF### Section handled by ICF editor, don&amp;#39;t touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile=&amp;quot;$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml&amp;quot; */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__   = 0x0007FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x2000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__   = 0x2000;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

define symbol Size_RTT = 0x1000;
define block RTT       with alignment = 8, size = Size_RTT                  { section RTT_section };

initialize by copy { readwrite };
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region   { readonly };
place in RAM_region   { first block RTT,
                        readwrite,
                        block CSTACK, block HEAP };
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38536?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 09:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7540a6e3-a2a6-42df-89c1-c71766b2e01e</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Stephan, does search fail because it doesn&amp;#39;t know with what device it works? I managed to fix it by executing on PC J-Link command &lt;code&gt;exec SetRTTSearchRanges 0x20000000 0x3000&lt;/code&gt;. Not sure it it will help you though. You may need to increase 0x3000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38535?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 08:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78888d79-3480-4567-981b-1bbdeeb1d260</guid><dc:creator>stephan</dc:creator><description>&lt;p&gt;Eirik, thx for your questions. The main reason for a fixed address is that on some PC the search from SEGGER software fails. Second, we want to put the SEGGER control block in its own RAM block, so its power can be switch off in production while we are not debugging.
The SEGGER software declares _SEGGER_RTT as an automatic variable, i.e. on the stack. The heap is used for dynamic variables (malloc() and free()) and is not used by the SEGGER code. I did not change CSTACK or HEAP definitions in the icf-file. I only added an RTT block and introduced the container block FIXED_ORDER_RAM to force fixed ordering of the blocks inside the RAM region (c.f. &lt;code&gt;&lt;a href="http://supp.iar.com/Support/?note=92924"&gt;supp.iar.com/.../&lt;/a&gt;&lt;/code&gt;). The RTT block is intended to be placed outside CSTACK and HEAP, not controlled by any stack or heap mechanism at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure RTT with a fixed address in IAR</title><link>https://devzone.nordicsemi.com/thread/38534?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 02:04:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:848d10ba-01bf-4607-b220-148810b62e4c</guid><dc:creator>Eirik Midttun</dc:creator><description>&lt;p&gt;Just to understand: what is the problem of having the RTT Control Block moving in RAM? By design the location isn&amp;#39;t known, so the SEGGER software will search for it.&lt;/p&gt;
&lt;p&gt;My first guess is that you define the RTT CB outside the heap, but the software expect the CB to be in the heap. Is &amp;#39;heap&amp;#39; meaning the RAM that is not the stack, or is it a special region for using malloc() and free()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>