<?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 control block not found when using pylink</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124346/rtt-control-block-not-found-when-using-pylink</link><description>I am updating our automation software for programming Thingy 91 and trying to communicate to ModemShellRtt using python. In my test program attached, I would only like to see &amp;quot;Button 1 pressed - raising a kill signal&amp;quot; when I press the T91 button. I do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Sep 2025 12:48:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124346/rtt-control-block-not-found-when-using-pylink" /><item><title>RE: RTT control block not found when using pylink</title><link>https://devzone.nordicsemi.com/thread/549032?ContentTypeID=1</link><pubDate>Wed, 17 Sep 2025 12:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91965eea-4199-429c-a3dc-e18927c0528a</guid><dc:creator>RichM</dc:creator><description>&lt;p&gt;Wow, that&amp;#39;s great. I guess the use of the if statement was misguided.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks much, that will get me going.&lt;/p&gt;
&lt;p&gt;Rich&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT control block not found when using pylink</title><link>https://devzone.nordicsemi.com/thread/548991?ContentTypeID=1</link><pubDate>Wed, 17 Sep 2025 09:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d74a0e1-c7a0-4690-b672-d95e6bab09c3</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Seems like the issue was with the python script itself. I did some changes and now it works fine;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;import pylink
import time
import sys

# The serial number of your J-Link probe. 
# This is useful if you have multiple J-Link devices connected.
# You can find the serial number using the &amp;#39;pylink.jlink_list()&amp;#39; function or the J-Link Commander.
JLINK_SERIAL_NO = None # Or provide your serial number here


# Define the device name. For the Thingy:91&amp;#39;s nRF9160 SiP, this is &amp;#39;nRF9160_xxAA&amp;#39;.
TARGET_DEVICE = &amp;#39;nRF9160_xxAA&amp;#39;

# Initialize and open a connection to the J-Link
try:
    jlink = pylink.JLink()
    # Open a connection to the J-Link. 
    # The serial number is optional but recommended for clarity.
    if JLINK_SERIAL_NO:
        print(f&amp;quot;Connecting to J-Link probe with serial number {JLINK_SERIAL_NO}...&amp;quot;)
        jlink.open(serial_no=JLINK_SERIAL_NO)
    else:
        print(&amp;quot;Connecting to the first available J-Link probe...&amp;quot;)
        jlink.open()
    
    # Connect to the target device (Thingy:91&amp;#39;s nRF9160)
    print(f&amp;quot;Connecting to target device: {TARGET_DEVICE}...&amp;quot;)
    jlink.connect(TARGET_DEVICE, verbose=True)



    # Wait for RTT to be initialized by the target firmware
    print(&amp;quot;Waiting for RTT control block...&amp;quot;)
    time.sleep(2)  # Wait for a moment to let RTT initialize on the target

    # Search for and start the RTT control block
    jlink.rtt_start()
    print(&amp;quot;RTT started. Reading RTT data. Press Ctrl+C to exit.&amp;quot;)


    while True:
        # Read from RTT buffer 0. Timeout is in milliseconds.
        data = jlink.rtt_read(0, 1024)
        if data:
            # Decode and print the received data
            print(bytes(data).decode(&amp;#39;utf-8&amp;#39;), end=&amp;#39;&amp;#39;)
        time.sleep(0.1)  # Poll every 100ms

except KeyboardInterrupt:
    print(&amp;quot;User interrupted. Exiting.&amp;quot;)
finally:
    jlink.close()
&lt;/pre&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/pastedimage1758100408255v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT control block not found when using pylink</title><link>https://devzone.nordicsemi.com/thread/548781?ContentTypeID=1</link><pubDate>Mon, 15 Sep 2025 15:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fa556ff-a29c-4871-8daa-301c4ef7e589</guid><dc:creator>RichM</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried both 0 and&amp;nbsp;0x0000000020010100 (found in the map file) with the same results.&lt;/p&gt;
&lt;p&gt;I am not certain what you mean by &amp;quot;Set the RTT control Block address to 0&amp;quot;. Do you mean to do this in the python script?&lt;/p&gt;
&lt;p&gt;I am also not clear by exactly what you mean by the &amp;quot;viewer/logger&amp;quot;&lt;/p&gt;
&lt;p&gt;R&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/modem_5F00_shell.zip"&gt;devzone.nordicsemi.com/.../modem_5F00_shell.zip&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4213.Test100.py"&gt;devzone.nordicsemi.com/.../4213.Test100.py&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT control block not found when using pylink</title><link>https://devzone.nordicsemi.com/thread/548769?ContentTypeID=1</link><pubDate>Mon, 15 Sep 2025 14:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6bcfe9b-b335-44e0-9c09-5e2a55a445d2</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;can you try the advice &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/releases/release-notes-1.2.0.html#d2068e2833"&gt;here&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;&amp;quot;The SEGGER Control Block cannot be found by automatic search by the RTT Viewer/Logger. As a workaround, set the RTT Control Block address to 0 and it will try to search from address 0 and upwards. If this does not work, look in the &lt;code&gt;&lt;span&gt;builddir/zephyr/zephyr.map&lt;/span&gt;&lt;/code&gt; file to find the address of the &lt;code&gt;&lt;span&gt;_SEGGER_RTT&lt;/span&gt;&lt;/code&gt; symbol in the map file and use that as input to the viewer/logger.&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTT control block not found when using pylink</title><link>https://devzone.nordicsemi.com/thread/548625?ContentTypeID=1</link><pubDate>Fri, 12 Sep 2025 15:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d5ecc15-9895-4a5e-bc09-9c64582e9e1f</guid><dc:creator>RichM</dc:creator><description>&lt;p&gt;FYI, here is the RTT modem shell which seems to work very nicely and have plenty of good features.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ModemShellRtt.hex"&gt;devzone.nordicsemi.com/.../ModemShellRtt.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>