<?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>nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81157/nrfconnect-sdk-vscode-not-thread-aware</link><description>I&amp;#39;m using the latest nRFConnect SDK w/ VSCode with a custom board connected to via a J-LINK. When I look at the call stack it only shows the current thread. I can see thread info manually from the debug terminal (via &amp;quot;p *_kernel.threads&amp;quot;, etc). I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Nov 2021 23:48:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81157/nrfconnect-sdk-vscode-not-thread-aware" /><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/337161?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 23:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbf6e157-d044-425c-b8af-356a413f22d0</guid><dc:creator>denis</dc:creator><description>&lt;p&gt;I found the answer to enabling VSCode thread awareness with J-Link. &amp;nbsp;The following prj.conf option is required by the J-Link:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_DEBUG_THREAD_INFO&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/336917?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 15:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91f789b3-124d-4816-a8bf-92d8b019c5f9</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Denis Bohm,&lt;/p&gt;
&lt;p&gt;1) PlatformIO for VScode is not a Nordic delivery, and as such is not supported by us.&amp;nbsp;The main forum for PlatformIO support seems to be this one unless you&amp;nbsp;can justify using their paid system:&amp;nbsp;&lt;a href="https://community.platformio.org/"&gt;https://community.platformio.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2) No mether which&amp;nbsp;&lt;span&gt;IDE you are using. The debug options in your codes decide which kind of debugging information will print out. For thread analyzer enabling, I follow the official document and tested zephyr\samples\basic\threads and&amp;nbsp;zephyr\samples\samples/synchronization/ which use multiple threads, with the following configurations, both of them can print out thread inforamtions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thread Analyzer Configurations:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_THREAD_ANALYZER=y 
CONFIG_THREAD_ANALYZER_USE_PRINTK=y
CONFIG_THREAD_ANALYZER_AUTO=y 
CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5  &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;threads sample log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.6.99-ncs1  ***

Toggled led0; counter=0

Toggled led1; counter=0

Thread analyze:

 0x20000340          : STACK: unused 752 usage 272 / 1024 (26 %); CPU: 46 %

 0x200003e0          : STACK: unused 624 usage 400 / 1024 (39 %); CPU: 0 %

 0x200002a0          : STACK: unused 776 usage 248 / 1024 (24 %); CPU: 0 %

 0x20000200          : STACK: unused 776 usage 248 / 1024 (24 %); CPU: 0 %

 0x20000480          : STACK: unused 288 usage 32 / 320 (10 %); CPU: 0 %

Toggled led0; counter=1

Toggled led0; counter=2

Toggled led0; counter=3

Toggled led0; counter=4

Toggled led0; counter=5

Toggled led0; counter=6

Toggled led0; counter=7

Toggled led0; counter=8

Toggled led0; counter=9

Toggled led1; counter=1

Toggled led0; counter=10

Toggled led0; counter=11

Toggled led0; counter=12

Toggled led0; counter=13

Toggled led0; counter=14

Toggled led0; counter=15

Toggled led0; counter=16

Toggled led0; counter=17

Toggled led0; counter=18

Toggled led0; counter=19

Toggled led1; counter=2

Toggled led0; counter=20

Toggled led0; counter=21

Toggled led0; counter=22

Toggled led0; counter=23

Toggled led0; counter=24

Toggled led0; counter=25

Toggled led0; counter=26

Toggled led0; counter=27

Toggled led0; counter=28

Toggled led0; counter=29

Toggled led1; counter=3

Toggled led0; counter=30

Toggled led0; counter=31

Toggled led0; counter=32

Toggled led0; counter=33

Toggled led0; counter=34

Toggled led0; counter=35

Toggled led0; counter=36

Toggled led0; counter=37

Toggled led0; counter=38

Toggled led0; counter=39

Toggled led1; counter=4

Toggled led0; counter=40

Toggled led0; counter=41

Toggled led0; counter=42

Toggled led0; counter=43

Toggled led0; counter=44

Toggled led0; counter=45

Toggled led0; counter=46

Toggled led0; counter=47

Toggled led0; counter=48

Toggled led0; counter=49

Toggled led1; counter=5

Toggled led0; counter=50

Thread analyze:

 0x20000340          : STACK: unused 752 usage 272 / 1024 (26 %); CPU: 2 %

 0x200003e0          : STACK: unused 624 usage 400 / 1024 (39 %); CPU: 0 %

 0x200002a0          : STACK: unused 776 usage 248 / 1024 (24 %); CPU: 0 %

 0x20000200          : STACK: unused 776 usage 248 / 1024 (24 %); CPU: 0 %

 0x20000480          : STACK: unused 248 usage 72 / 320 (22 %); CPU: 96 %

Toggled led0; counter=51

Toggled led0; counter=52

Toggled led0; counter=53
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/336724?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 15:13:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69a24dc4-46c5-474f-9b31-e5cba2cda5c7</guid><dc:creator>denis</dc:creator><description>&lt;p&gt;I checked into Thread Analyzer. &amp;nbsp;It doesn&amp;#39;t seem to be what I&amp;#39;m looking for. &amp;nbsp;I added the following and still do not see thread info in the VSCode debugger:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER_AUTO&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;VSCode does support thread awareness. &amp;nbsp;I have set it up before when using Zephyr, VSCode, PlatformIO, and JLink. &amp;nbsp;In that case my platformio.ini had:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;debug_server =&lt;br /&gt; JLinkGDBServer&lt;br /&gt; -singlerun&lt;br /&gt; -if&lt;br /&gt; SWD&lt;br /&gt; -select&lt;br /&gt; USB&lt;br /&gt; -device&lt;br /&gt; nRF52840_xxAA&lt;br /&gt; -port&lt;br /&gt; 2331&lt;br /&gt; -rtos&lt;br /&gt; GDBServer/RTOSPlugin_Zephyr&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Is there somewhere to put this for the NCS setup in VSCode so&amp;nbsp;that thread aware debugging is configured in VSCode?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/336599?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 07:56:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e03aa75-1dd0-40b4-826b-e5ded3de139c</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Denis,&lt;/p&gt;
&lt;p&gt;SES and nRF Connect for VS Code Extensions are just &lt;span&gt;Integrated Development Environment(&lt;/span&gt;IDE) for editing, compiling, flashing firmware, debugging, and so on.&lt;/p&gt;
&lt;p&gt;The debug options in your codes decide which kind of debugging information will print out. I did not find similar configurations from any Zephyr or NCS documents. Please turn to use the thread analyzer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/336571?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 01:50:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84bb2342-ecb2-467c-bdc7-157d510fb3f3</guid><dc:creator>denis</dc:creator><description>&lt;p&gt;I found those options when I was trying to setup SES to be thread aware a while back, before it was released by Segger. &amp;nbsp;I assumed that VSCode would be setup for thread awareness by the Nordic extensions. &amp;nbsp;But that doesn&amp;#39;t seem to be the case. &amp;nbsp;What I am looking for is to be able to browse all the threads in VSCode. &amp;nbsp;Not just see the call stack of the current thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK VSCode not thread aware?</title><link>https://devzone.nordicsemi.com/thread/336533?ContentTypeID=1</link><pubDate>Thu, 28 Oct 2021 14:34:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b418f4c-6644-433c-a548-28f69d23af4b</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Denis,&lt;/p&gt;
&lt;p&gt;Did you refer to any document or tutorial to set those configurations?&lt;/p&gt;
&lt;p&gt;I assume you want to analyze stack usage and&amp;nbsp;runtime statistics in each thread of your application. &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/debug_tools/thread-analyzer.html"&gt;Thread analyzer&lt;/a&gt;&amp;nbsp;seems to be the correct choice for the current NCS1.7.0 samples.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>