<?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>RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20708/rtt-logging-from-application-started-by-bootloader</link><description>Hello,
Is it possible to get logs (RTT) from an application started by a bootloader? As of now I don&amp;#39;t get anything after the bootloader has jumped to the application start address. 
 If I run the application separately it works. 
 Thanks, Jacob</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Jan 2026 08:49:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20708/rtt-logging-from-application-started-by-bootloader" /><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/557986?ContentTypeID=1</link><pubDate>Tue, 06 Jan 2026 08:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8bc0b91-08cc-47c2-a3cd-ca296f301210</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/khalid-syed"&gt;Khalid Syed&lt;/a&gt;&amp;nbsp;This is a very old ticket, please create a new ticket for your question&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/557793?ContentTypeID=1</link><pubDate>Thu, 01 Jan 2026 22:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a389018-d6e4-46f3-b47c-7ee0f3f8a377</guid><dc:creator>Khalid Syed</dc:creator><description>&lt;p&gt;Where can I find &lt;span&gt;SEGGER_RTT.c&amp;nbsp;and the .Id files?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/307557?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 18:30:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c817c13-a2f5-42fe-bcaa-d36b219bb47f</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;I also have these macros defined, with the above RTT macros, but I don&amp;#39;t remember exactly why:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 4096
#define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2
#define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16
#define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2
#define SEGGER_RTT_ALIGNMENT 4
#define SEGGER_RTT_BUFFER_ALIGNMENT 4
#define SEGGER_RTT_SECTION &amp;quot;.rtt_cb&amp;quot;
#define SEGGER_RTT_BUFFER_SECTION &amp;quot;.rtt_buffers&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also added NOLOAD directives to my linker script (again, don&amp;#39;t remember exactly why):&lt;/p&gt;
&lt;p&gt;&lt;span&gt;.rtt_buffers(NOLOAD) :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;.rtt_cb(NOLOAD) :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know if one of those works and I&amp;#39;ll update my previous post.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/307413?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 10:00:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f786b7a6-b8a2-478c-aaf3-784320cbfa0f</guid><dc:creator>swisst</dc:creator><description>&lt;p&gt;Thanks for quick reply but no result for now&lt;/p&gt;
&lt;p&gt;BTW SDK v17.0.2, JLink toolset 6.88&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/307292?ContentTypeID=1</link><pubDate>Wed, 28 Apr 2021 14:41:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9a0feec-db6f-44dc-8243-1cc18323fe6c</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;I discovered a couple of things: &lt;br /&gt;&lt;br /&gt;The RTT control block must be&amp;nbsp;zeroed out before RTT&amp;#39;s init is called (it doesn&amp;#39;t zero it&amp;#39;s special memory block, but the RTT tools expect it to be zeroed aside from its special bytes).&lt;/p&gt;
&lt;p&gt;Sometimes the RTT tools can take a while to find the memory block, but you can create a jlink script to help them:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* set_RTT_location.jlinkscript */
/* Command-line options: -nogui -select USB -device nRF52840_xxAA -if SWD -endian little -speed 4000 -jlinkscriptfile path/to/set_RTT_location.jlinkscript */
/* Alternatively, run command from gdb CLI: eval &amp;quot;monitor exec SetRTTAddr %p&amp;quot;, &amp;amp;_SEGGER_RTT */
int SetupTarget(void) {
    JLINK_ExecCommand(&amp;quot;SetRTTAddr 0x2003EF78&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/307268?ContentTypeID=1</link><pubDate>Wed, 28 Apr 2021 13:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63562b4b-7a16-4c9d-85ac-862722670ff5</guid><dc:creator>swisst</dc:creator><description>&lt;p&gt;I&amp;#39;ve implemented implemented in such way but my RTT does not starts&lt;/p&gt;
&lt;p&gt;As I see differences from original implementation - a load address is not specified for both sections ( top part )&lt;/p&gt;
&lt;p&gt;- top part is original rtt location&lt;/p&gt;
&lt;p&gt;-&lt;span&gt;&amp;nbsp;bottom part is custom rtt location&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;.igot.plt       0x00000000200051f4        0x0 load address 0x0000000000041528
 .igot.plt      0x00000000200051f4        0x0 toolchain/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/thumb/v7e-m+fp/hard/crtbegin.o

.rtt_buffers    0x00000000200051f4      0x210 load address 0x0000000000041528
 .rtt_buffers   0x00000000200051f4      0x210 /tmp/nrf52840_xxaa.out.22h15i.ltrans0.ltrans.o

.rtt_control_block
                0x0000000020005404       0x78 load address 0x0000000000041738
 .rtt_control_block
                0x0000000020005404       0x78 /tmp/nrf52840_xxaa.out.22h15i.ltrans0.ltrans.o
                0x000000002000547c                . = ALIGN (0x4)


.igot.plt       0x00000000200051f4        0x0 load address 0x0000000000041528
 .igot.plt      0x00000000200051f4        0x0 toolchain/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/thumb/v7e-m+fp/hard/crtbegin.o

.rtt_buffers    0x000000002003fd78      0x210
 *(.rtt_buffers)
 .rtt_buffers   0x000000002003fd78      0x210 /tmp/nrf52840_xxaa.out.SzFaPv.ltrans0.ltrans.o

.rtt_control_block
                0x000000002003ff88       0x78
 *(.rtt_control_block)
 .rtt_control_block
                0x000000002003ff88       0x78 /tmp/nrf52840_xxaa.out.SzFaPv.ltrans0.ltrans.o
                0x0000000020040000                . = ALIGN (0x4)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;please advise&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/275238?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 03:55:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8cdba30-1f28-42c6-9a8c-4fa34e042200</guid><dc:creator>Benjamin</dc:creator><description>&lt;p&gt;For anyone encountering this problem now, since at least SDK 16 (haven&amp;#39;t looked back further), you can simply define a few macros in your app/sdk_config.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SEGGER_RTT_ALIGNMENT 4
#define SEGGER_RTT_BUFFER_ALIGNMENT 4
#define SEGGER_RTT_SECTION &amp;quot;.rtt_cb&amp;quot;
#define SEGGER_RTT_BUFFER_SECTION &amp;quot;.rtt_buffers&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and add the corresponding sections to your linker files:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  ...
  /* Put RTT data at top of RAM. */
  /* RTT_CB LENGTH = 24 + SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS * 24
                        + SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS * 24 */
  RTT_CB (rw) : ORIGIN = 0x2003ff88, LENGTH = 0x78
  /* RTT_BUFFERS LENGTH = + SEGGER_RTT_CONFIG_BUFFER_SIZE_UP
                          + SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN */
  /* RTT_BUFFERS ORIGIN = 0x20040000 - CB LENGTH - BUFFERS LENGTH */
  RTT_BUFFERS (rw) : ORIGIN = 0x2003ef78, LENGTH = 0x1010
}

SECTIONS
{
  .rtt_buffers :
  {
    KEEP(*(.rtt_buffers))
  } &amp;gt; RTT_BUFFERS
  .rtt_cb :
  {
    KEEP(*(.rtt_cb))
  } &amp;gt; RTT_CB
}

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/122802?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 10:48:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb8ed994-6e80-4309-889d-e6f059d35c9a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please state what exactly you did to assign the address of the segger rtt buffer. I would suggest you to create a new case with the link to this case.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/122607?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 12:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f832992e-6fd0-42e6-820b-a52fdaa984df</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Ok here is what i have found in `sdk_config.h`:&lt;/p&gt;
&lt;p&gt;`#define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 1024`&lt;br /&gt;`#define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16`&lt;/p&gt;
&lt;p&gt;which is used for `BUFFER_SIZE_UP` and `BUFFER_SIZE_DOWN`.&lt;/p&gt;
&lt;p&gt;so if start location is `0x20006000` then:&lt;/p&gt;
&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; hex(int(&amp;#39;20006000&amp;#39;, 16) + 1024)&lt;br /&gt;&amp;#39;0x20006400&amp;#39;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; hex(int(&amp;#39;20006000&amp;#39;, 16) + 1024 + 16)&lt;br /&gt;&amp;#39;0x20006410&amp;#39;&lt;/p&gt;
&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;would be the next two.&lt;/p&gt;
&lt;p&gt;But then i get the error:&lt;/p&gt;
&lt;p&gt;`/home/work/software/arm/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: section .rtt_ac_down loaded at [20006400,2000640f] overlaps section .rtt_ac_up loaded at [20006000,20006fff]`&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The i have moved to:&lt;/p&gt;
&lt;p&gt;`0x20006000`, `0x20007000`, `0x20007010`.&lt;/p&gt;
&lt;p&gt;It compiles but the issue is not fixed. I still have to use connect in jlinkexe to see the application code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/122602?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 12:09:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc67deb5-42d8-4fbd-96f0-dc29f2d2aa63</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;What is recomended place for RAM and what are the sizes needed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80815?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 08:06:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90b0f092-efb9-44bd-8017-a69e5f23a507</guid><dc:creator>Jacob</dc:creator><description>&lt;p&gt;Cool - got it working now with GCC like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static char __attribute__((section(&amp;quot;.rtt_ac_up&amp;quot;))) _acUpBuffer  [BUFFER_SIZE_UP];
static char __attribute__((section(&amp;quot;.rtt_ac_down&amp;quot;))) _acDownBuffer[BUFFER_SIZE_DOWN];
SEGGER_RTT_CB __attribute__((section(&amp;quot;.rtt_segger&amp;quot;))) _SEGGER_RTT;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and corresponding .ld file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SECTIONS
{
  .rtt_ac_up 0x20003000 :
  {
    KEEP(*(.rtt_ac_up))
  } &amp;gt; RAM
  .rtt_ac_down 0x20003800 :
  {
    KEEP(*(.rtt_ac_down))
  } &amp;gt; RAM
  .rtt_segger 0x20003880 :
  {
    KEEP(*(.rtt_segger))
  } &amp;gt; RAM
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thank you so much for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80814?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 11:42:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1be8abb0-5d36-41bd-be15-46566ea60a58</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jacob,&lt;/p&gt;
&lt;p&gt;If you have a look &lt;a href="https://www.segger.com/jlink-rtt.html"&gt;here&lt;/a&gt;  at the section on how RTT work. You can find that it was not the different channel caused the problem, it&amp;#39;s the different allocation of RAM area for the RTT Control Block and the RTT buffer location caused the problem.&lt;/p&gt;
&lt;p&gt;If we match the Control Block address and the RTT buffers location the same on the bootloader and the application, then everything works.&lt;/p&gt;
&lt;p&gt;This is the modification I did to SEGGER_RTT.c  from line 135:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static char _acUpBuffer  [BUFFER_SIZE_UP] __attribute__((at(0x20003C00)));
static char _acDownBuffer[BUFFER_SIZE_DOWN]__attribute__((at(0x20003F00))); ;
//
// Initialize SEGGER Real-time-Terminal control block (CB)
//
SEGGER_RTT_CB _SEGGER_RTT __attribute__((at(0x20002C00))); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I used &lt;strong&gt;attribute&lt;/strong&gt; to force the linker to put the buffer is defined location. You don&amp;#39;t have to use the same addresses, it can be any where in RAM (of course in the application RAM range).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80813?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 12:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88159d96-a7f0-40d4-9db3-27d1c21f1ced</guid><dc:creator>Jacob</dc:creator><description>&lt;p&gt;Hello, When developing boot issues it is very helpful to get output from both the bootloader and the application. Can I get the output from the second RTT channel then?&lt;/p&gt;
&lt;p&gt;Thanks, Jacob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80812?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 16:55:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02463976-0045-41d3-ac44-30f272de1ce7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jacob,&lt;/p&gt;
&lt;p&gt;When I tested here (SDKv13), it seems that when we reinit the log module we will actually open another RTT channel.&lt;/p&gt;
&lt;p&gt;So if I open RTT client when the application running, I can only capture the RTT log from the application, even if I reset the device and the device enter the bootloader before it get to the application.&lt;/p&gt;
&lt;p&gt;If I open RTT client when the bootloader is running and enterred bootloader mode, then I can follow the RTT client of the bootloader.&lt;/p&gt;
&lt;p&gt;Do you really need RTT to be ON on the bootloader ? If you turn it off can you get RTT log on the application ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80811?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 10:28:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:592d7f5e-4bf0-4af4-8818-58da8e3f6cd0</guid><dc:creator>Jacob</dc:creator><description>&lt;p&gt;RTT logging from the bootloader works (and is apparently turned on). RTT logging from the application works if I run it standalone, but if I start it from the bootloader I don&amp;#39;t get any output.&lt;/p&gt;
&lt;p&gt;Will try SEGGER_RTT_Init(). Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80810?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 10:26:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b362a29-6b4c-4d43-852c-36b49c9c07da</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Did you also turn on RTT logging in the bootloader ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT logging from application started by bootloader</title><link>https://devzone.nordicsemi.com/thread/80809?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 15:21:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78fc0013-90a3-4125-91ba-ceaf69c34424</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;Can you provide more information about what you tried?  Did you call SEGGER_RTT_Init() in your code and did you start the GDB server and the JLinkClient?  I don&amp;#39;t have any experience with boot loaded code, just with RTT using the debugger to load code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>