<?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>Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55034/test-development-using-cli-python-rtt</link><description>Hi, 
 I&amp;#39;d like to start developing automated tests for my custom NRF52840 board. 
 Currently I use the CLI library (with RTT backend) for communicating with the board. 
 Any ideas for how I could communicate with my board via a python script? 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jan 2020 10:59:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55034/test-development-using-cli-python-rtt" /><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/232056?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 10:59:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18ab46c7-81d7-4263-a131-4a48d2a8c5fe</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Great! I igot it working with python 3.x. Need to tweak the script for my own tests, but the basic read and write from both ends works! I have enough to get me running. Thanks J&amp;oslash;rgen!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/232025?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 09:12:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:848ff055-e092-441a-b2a1-3ffb69079482</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, I tested with Python 2.7.15. I see from the release notes that pynrfjprog should support Python 3.6 at least, but you may have to modify the example to use it with Python 3.x.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/231959?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 16:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c029c070-eb4f-4d9c-8b86-218f1bdd2e25</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Looks like it&amp;#39;s working. I just have one issue with&amp;nbsp; the python environment (I use python 3.x). Did you test the scripts with python 2.x?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/231860?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 11:50:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6b678f5-806d-4862-b3c8-f229c5a0d589</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I started out with the UART peripheral example. However, I do not think that any part of that example is used in the project I uploaded, so it should not really matter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/231839?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 10:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b8632cc-167b-4b71-a791-e07e7c077523</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Thanks J&amp;oslash;rgen, and apologies for the late response. I&amp;#39;ve been sidetracked by other tasks. Now I finally have time for this.&lt;/p&gt;
&lt;p&gt;I currently use SDK 15.2.0. What peripheral example did you start with? (I&amp;#39;d like to have as close to your setup as possible to avoid nasty surprises).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223632?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 14:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6452d7fd-8e45-4fec-9af6-6c5a69bd1a70</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, that should work similarly. I updated the examples with read in application and write in Python script:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cb08f5eb88724234be813d2e896c350c/rtt_5F00_reader_5F00_writer_5F00_sdk_5F00_16.0.0.zip"&gt;devzone.nordicsemi.com/.../rtt_5F00_reader_5F00_writer_5F00_sdk_5F00_16.0.0.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cb08f5eb88724234be813d2e896c350c/rtt_5F00_writer.py"&gt;devzone.nordicsemi.com/.../rtt_5F00_writer.py&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223380?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 14:58:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c326427-797c-4d1e-92c6-f6f0b56c81ab</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;ll give this a try.&lt;/p&gt;
&lt;p&gt;In the meantime I noticed that the script you sent primarily does RTT reading, and the firmware does RTT write. Is the reverse possible (writing using the script, and reading using the firmware)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223370?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 14:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0143e9ef-bdee-4736-8af3-6d0d141e309a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I have not experienced this. I did a test with a modified peripheral example, and a custom pynrfjprog sample. This seems to work as expected.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cb08f5eb88724234be813d2e896c350c/rtt_5F00_writer_5F00_sdk_5F00_16.0.0.zip"&gt;devzone.nordicsemi.com/.../rtt_5F00_writer_5F00_sdk_5F00_16.0.0.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cb08f5eb88724234be813d2e896c350c/rtt_5F00_reader.py"&gt;devzone.nordicsemi.com/.../rtt_5F00_reader.py&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Did you&amp;nbsp;SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS/SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS in your sdk_config.h file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223282?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 10:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4a8d22f-3581-4112-989d-7213dcfff759</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Okay, so I tried using Channel 1 (both in my python script and firmware), Everytime I run the script, I hit a breakpoint in the code. Specifically, this breakpoint (in &lt;strong&gt;cmsis_gcc.h&lt;/strong&gt;) is hit everytime I send a string from the script:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__attribute__((always_inline)) __STATIC_INLINE void __SEV(void)
{
  __ASM volatile (&amp;quot;sev&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the program halts. Is this expected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223111?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 15:11:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfe7334a-94fd-4617-9c36-9a6617454b99</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;What does it take to use a different channel? I just read this post: &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/multiple-channels-in-rtt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Does it paint the full picture?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223063?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 13:24:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3157635f-131e-4fcc-916e-527c620c061d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;ol&gt;
&lt;li&gt;RTT supports mulitple channels. If you want to keep logging, use another channel than 0 for the test communications.&lt;/li&gt;
&lt;li&gt;Yes, this makes sense to me.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223040?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 12:36:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69776742-fc46-40d4-bb6e-481aa60a92a2</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;I would like to avoid the middleman (CLI) and just use pynrfjprog directly.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I plan to use the pynrfjprog read and write functions directly as you suggested. However, on the firmware side, I&amp;#39;m considering one potential issue: my logger uses the RTT backend. Would I have to disable&amp;nbsp; the logger?&lt;/li&gt;
&lt;li&gt;As for implmentation, would it make sense to use a repeating timer to call SEGGER_RTTRead() and have a task (I&amp;#39;m using FreeRTOS) decode the command, since there is no interrupt to tell when data is received in the RTT buffer?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Test development using CLI/python/RTT</title><link>https://devzone.nordicsemi.com/thread/223026?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 12:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:067a38dd-eefd-4999-b64d-45cff2e0f789</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi Tim,&lt;/p&gt;
&lt;p&gt;If you want to continue using CLI over RTT for your communication with the board, you can look into our &lt;a href="https://github.com/NordicSemiconductor/pynrfjprog"&gt;pynrfjprog library&lt;/a&gt;. This&amp;nbsp;enables&amp;nbsp;you to &lt;a href="https://github.com/NordicSemiconductor/pynrfjprog/blob/master/pynrfjprog/LowLevel.py#L1044"&gt;read&lt;/a&gt; and &lt;a href="https://github.com/NordicSemiconductor/pynrfjprog/blob/master/pynrfjprog/LowLevel.py#L1073"&gt;write&lt;/a&gt; RTT channels from a python script.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>