<?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/"><channel><title>Multiple channels in RTT</title><link>/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><description>Segger RTT (Real-Time Terminal) supports multiple data channels.
RTT Viewer uses channel 0 only, and implements multiple virtual terminals on top of this. The terminal can be switched by SEGGER_RTT_SetTerminal(). Channel 0 is used by NRF_LOG. NRF_LO</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Thu, 29 Nov 2018 10:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>Rorisang</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Great solution&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Wed, 20 Dec 2017 14:13:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>Krzysztof Zaraska</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;You are right of course! It should be:&lt;/p&gt;
&lt;pre&gt; uint8_t data1Buffer[128];
 uint8_t data2Buffer[128];
&lt;/pre&gt;
&lt;p&gt;(post updated).&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Sat, 21 Oct 2017 13:38:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>SEGGER - Paul Curtis</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You use:&lt;/p&gt;
&lt;pre&gt;uint8_t *data1Buffer[128];
uint8_t *data2Buffer[128];
&lt;/pre&gt;
&lt;p&gt;...and state that this is on the heap.  This allocates 128 pointers to uint8_t twice, so 1 KB of memory.  You either need a plain pointer (kill the array) and use the equivalent of &amp;quot;malloc&amp;quot; or just remove the * and use a plain array.&lt;/p&gt;
&lt;p&gt;Short: this is not a pointer to an array of 128 bytes.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Thu, 12 Oct 2017 18:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>koczis</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Yes, I call SEGGER_RTT_Init. I do everything exactly as you, except I have 2 additional channels - 3 in all. I wonder whether the buffers shouldn&amp;#39;t be placed like they are for channel 0 in &amp;quot;SEGGER_RTT.h&amp;quot;:&lt;/p&gt;
&lt;pre&gt;SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acUpBuffer  [BUFFER_SIZE_UP]));
SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acDownBuffer[BUFFER_SIZE_DOWN]));
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Thu, 12 Oct 2017 12:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>Krzysztof Zaraska</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;No, the RTT libs are from clean SDK14. Did you call SEGGER_RTT_Init()?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how I use it now, for reference. (You need to provide _ASSERT macro).&lt;/p&gt;
&lt;pre&gt;#include &amp;lt;string.h&amp;gt;
#include &amp;quot;SEGGER_RTT.h&amp;quot;
#include &amp;quot;RTT_data.h&amp;quot;
#include &amp;quot;sdk_config.h&amp;quot;

#define RTT_DATA_BUFFER_SIZE 			128					// FIFO size
#define RTT_DATA_CHANNEL 				1					// RTT channel number (RTT Viewer and NRF_LOG use 0)
#define RTT_DATA_USE_BLOCKING_MODE 		1					// Block if not enough space in FIFO
#define RTT_DATA_ASSERT_ON_OVERFLOW 	0					// If RTT_DATA_USE_BLOCKING_MODE is 0, assert if not enough space in the FIFO


uint8_t RTT_buffer[RTT_DATA_BUFFER_SIZE];

bool RTT_initialized = false;

void RTT_data_init(void)
{
#if (RTT_DATA_CHANNEL &amp;gt; SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS-1)
#error &amp;quot;Please increase SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS in sdk_config.h&amp;quot;
#endif

#if NRF_LOG_BACKEND_RTT_ENABLED
	// NRF_LOG will initialize RTT for us
#else
	SEGGER_RTT_Init();
#endif
	
#if RTT_DATA_USE_BLOCKING_MODE
	int mode = SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL;
#else
	int mode = SEGGER_RTT_MODE_NO_BLOCK_SKIP;
#endif
		
	int ret = SEGGER_RTT_ConfigUpBuffer(RTT_DATA_CHANNEL, &amp;quot;RTT_DATA&amp;quot;, RTT_buffer, RTT_DATA_BUFFER_SIZE, mode);
	_ASSERT(ret&amp;gt;=0);
	RTT_initialized = true;
}

void RTT_data_send(uint8_t *data, int size)
{
	_ASSERT(RTT_initialized);
	int ret = SEGGER_RTT_Write(RTT_DATA_CHANNEL, data, size);
#if RTT_DATA_ASSERT_ON_OVERFLOW
	_ASSERT(ret == size);
#endif
}

void RTT_data_send_string(char *string)
{
	_ASSERT(RTT_initialized);
	int ret = SEGGER_RTT_WriteString(RTT_DATA_CHANNEL, string);
#if RTT_DATA_ASSERT_ON_OVERFLOW
	_ASSERT(ret == strlen(string));
#endif
}
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Multiple channels in RTT</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt</link><pubDate>Tue, 10 Oct 2017 13:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643eb01-fe79-40d4-806f-754ed5b2ca98</guid><dc:creator>koczis</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I did it exactly as you, but I&amp;#39;m having problems with data reception. It appears that I can&amp;#39;t use more than one RTT listening application (no matter: Viewer, Client, Logger) to save proper data. When I try, either only one channel is actually receiving anything or data get corrupted. So, I can&amp;#39;t seem to achieve what you present on your screenshot.
Have you perhaps changed anything else in your RTT lib config?&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1135&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>