<?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>Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81533/building-debugging-with-zephyr-sdk-toolchain-in-nrf-connect-vs-code-linux</link><description>Hello, 
 
 I&amp;#39;ve successfully setup a development environment for nRF Connect and Zephyr on windows (VS Code extension) where I can build, debug and flash code to my board, and now I&amp;#39;m attempting to do the same in a Linux environment running on a virtual</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Dec 2021 20:17:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81533/building-debugging-with-zephyr-sdk-toolchain-in-nrf-connect-vs-code-linux" /><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/343758?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2021 20:17:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f471884b-4eaf-4e44-8189-f70de0940270</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;Ok I found a fix!&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the problem with Debugging not starting in Linux (VS Code, nRF Connect) is because I hadn&amp;#39;t properly setup the Cortex-Debug extension settings.json.&amp;nbsp; The settings.json contains information on where the debugger gdb toolchains are located.&amp;nbsp; In my case, I&amp;#39;m using the Zephyr SDK to do all the work so I had to point to &lt;strong&gt;arm-zephyr-eabi-gdb&lt;/strong&gt;, which for me is located in &lt;strong&gt;&amp;quot;~/zephyr-sdk-0.13.2/arm-zephyr-eadi/bin&amp;quot;&lt;/strong&gt;.&amp;nbsp; To configure Cortex-Debug to this I added the following lines to settings.json:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
    &amp;quot;cortex-debug.JLinkGDBServerPath&amp;quot;: &amp;quot;/opt/SEGGER/JLink/JLinkGDBServerCLExe&amp;quot;,
    &amp;quot;cortex-debug.armToolchainPrefix&amp;quot;: &amp;quot;arm-zephyr-eabi&amp;quot;,
    &amp;quot;cortex-debug.armToolchainPath&amp;quot;: &amp;quot;~/zephyr-sdk-0.13.2/arm-zephyr-eabi/bin&amp;quot;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Note:&amp;nbsp; ~ needs to be replaced with your home directory.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;After that I simply hit the debug button from within nRF Connect and the debug session started up correctly!&amp;nbsp; I&amp;#39;m sure I could also add arm-zephyr-eabi and JLinkGDBServerCLIExe to the system path etc. to remove the need for including those two lines above.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;Parker&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/343742?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2021 17:03:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f693086-b0b6-422c-ac54-0842e0798d2f</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I fixed my JLink probe issues and now I can flash code from VS Code nRF Connect.&amp;nbsp; So I&amp;#39;m back to where I was before...still unable to start a debug session.&amp;nbsp;&amp;nbsp;I added &lt;span&gt;export PATH=$PATH:$GNUARMEMB_TOOLCHAIN_PATH/bin to my ~/.bashrc file.&amp;nbsp; But still nothing is working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can start a debug session using west if I navigate to the ~/zephyrproject/zephyr folder and run &amp;quot;west debug&amp;quot;.&amp;nbsp; Now I want to configure VS Code so it will use the Zephyr SDK toolchain to start a debug session.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m guessing it&amp;#39;s something really simple, like having to configure my launch.json file to point to the Zephyr SDK toolchain, or adding the toolchain to the path somehow.&amp;nbsp; Any advice?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Parker&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/343276?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 22:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f627cb8-8984-44c8-b138-bb440c8ef9a2</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;Sorry for the delay, my VM had a meltdown and then I got super busy with school.&amp;nbsp; I&amp;#39;m getting the same environment setup in WSL2 running Ubuntu.&amp;nbsp; I ended up adding&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;export ZEPHYR_TOOLCHAIN_VARIANT=zephyr&lt;/p&gt;
&lt;p&gt;export PATH=$PATH:$GNUARMEMB_TOOLCHAIN_PATH/bin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;to my ~/.bashrc.&amp;nbsp; Currently I can build my project no problem (nRF Connect now uses the Zephyr toolchain for building by default), but I&amp;#39;m having trouble with getting the JLink debugger to connect to WSL (a completely separate problem).&amp;nbsp; Once I get that fixed I should be able to retest debugging.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Parker&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/338416?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 15:03:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b038db2-b912-403a-b36c-c0d3ad7ed82c</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;Yes I will give that a try shortly!&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/338237?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 15:17:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:308b707b-39fb-455e-b7b7-766f857ce951</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Ok thanks for the clarification,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;could you try to add&amp;nbsp;&lt;span&gt;rm-none-eabi to path&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/home/$USER/.bashrc&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;export PATH=$PATH:$GNUARMEMB_TOOLCHAIN_PATH/bin&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;And important&amp;nbsp;to start VS code from terminal.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/338193?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 13:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3834c21-1055-483e-acea-e6e080cb040f</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes I used the toolchain manager and those tutorials to setup my nRF connect toolchain in Windows, but as far as I know the Linux installation is predominantly a manual process.&amp;nbsp; Also the tutorials above only really apply for Mac OS and Windows.&lt;/p&gt;
&lt;p&gt;On Linux, It seems like installing the Zephyr SDK&amp;nbsp;(&lt;a href="https://docs.zephyrproject.org/latest/getting_started/index.html"&gt;following these directions&lt;/a&gt;) is the easiest and most foolproof method of getting a working environment to build, flash and debug Zephyr applications.&amp;nbsp; Then installing VS Code, the nRF Connect extension and setting the toolchain variables to use zephyr and not gnuarmemb allows nRF Connect to make use of the existing toolchains without having to install a second /ncs repository with redundant toolchains.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Parker&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/338162?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 12:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:beb3f088-c390-4451-8286-65c833f2d4c4</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi, Have you tried the nrf connect for desktop Toolchain manager?&lt;br /&gt;&lt;br /&gt;We do have a video guide on how to set it up, it should be the same for all OS&amp;#39;s.&lt;br /&gt;&lt;a href="https://www.youtube.com/watch?v=2cv_jjqk5hg"&gt;nRF Connect for VS Code, 1: Installation - YouTube&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.youtube.com/watch?v=MGsZJpdLtco&amp;amp;list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl&amp;amp;index=5"&gt;nRF Connect for VS Code, 5: Debugging - YouTube&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a good introduction to nRF Connect SDK&lt;br /&gt;&lt;a href="https://www.nordicsemi.com/Events/2021/Webinar-Introducing-nRF-Connect-for-VS-Code"&gt;Introducing nRF Connect for VS Code - nordicsemi.com&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building/Debugging with Zephyr SDK Toolchain in nRF  Connect VS Code (Linux)</title><link>https://devzone.nordicsemi.com/thread/338039?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 03:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00827422-b207-46cd-b58b-eca70c177ed6</guid><dc:creator>ParkerMcD</dc:creator><description>&lt;p&gt;I found a workaround that allows me to build my project from within nRF Connect for VS Code.&amp;nbsp; After adding an application to my workspace I added a build configuration and tried compiling my project.&amp;nbsp; Once the build system failed and threw out the error previously posted above, I opened the CMakeCache.txt file in my projects generated build directory and changed the toolchain variant from gnuarmemb to zephyr.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//Zephyr toolchain variant
ZEPHYR_TOOLCHAIN_VARIANT:STRING=zephyr  // previously gnuarmemb&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now when I build no errors are thrown and I can flash my board with the resulting image.&amp;nbsp; Now I&amp;#39;m working on getting the debug environment running as it is throwing the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1636427168027v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Assuming I just need to update some environment variables so nRF Connect can find the appropriate debugger executables and connect to my j-link pod.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Parker&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>