<?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>Trouble Connecting to nRF5340 via nRFConnect Extension (WSL Environment)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117699/trouble-connecting-to-nrf5340-via-nrfconnect-extension-wsl-environment</link><description>Hi all, 
 I&amp;#39;ve been using the nRFConnect extension without any issues, successfully connecting to my nRF5340 board via JLink, flashing firmware, and receiving printed messages using the RTT extension. However, I encountered a problem today: I can no longer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jan 2025 17:14:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117699/trouble-connecting-to-nrf5340-via-nrfconnect-extension-wsl-environment" /><item><title>RE: Trouble Connecting to nRF5340 via nRFConnect Extension (WSL Environment)</title><link>https://devzone.nordicsemi.com/thread/517316?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 17:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a826bcc-a78c-4dd2-9a05-a8e32c48e5e3</guid><dc:creator>Valentin Otte</dc:creator><description>&lt;p&gt;&lt;span style="font-weight:400;"&gt;I also tested downgrading the Jlink Software/Driver version&amp;nbsp; (8.12, 8.10l, 8.10k) just in case this affects the interaction with the microcontroller, and I have the same issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble Connecting to nRF5340 via nRFConnect Extension (WSL Environment)</title><link>https://devzone.nordicsemi.com/thread/517243?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 13:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a1dd7f4-fa8a-4a97-a1e5-d5fc6551d07f</guid><dc:creator>Valentin Otte</dc:creator><description>&lt;p&gt;Hi Bendik,&lt;/p&gt;
&lt;p&gt;Thank you for your quick response!&lt;/p&gt;
&lt;p&gt;Before changing the WSL configuration, I tested the Windows version of the SEGGER JLink and nRF Command Line Tools to check if the connection with the device was possible.&lt;/p&gt;
&lt;p&gt;I tested JLink separately, and similar to WSL, I couldn&amp;rsquo;t connect to the device using either JTAG or SWD. (See attached images.)&lt;br /&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/pastedimage1736256736901v1.png" alt=" " /&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/pastedimage1736256763722v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;To rule out potential configuration issues, I attempted to upload firmware to the board using the command line tools but encountered the same problem.&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/pastedimage1736257281751v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The respective log file is attached here.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3487.log.log"&gt;devzone.nordicsemi.com/.../3487.log.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I re-checked the USB cable, tag-connect cable, and other hardware components. Everything appears to be in working order. Interestingly, the board restarts after a failed connection, suggesting a connection attempt is being made.&lt;/p&gt;
&lt;p&gt;Are there any additional tests or debugging steps you&amp;rsquo;d recommend to identify the issue?&lt;/p&gt;
&lt;p&gt;I appreciate your support!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Valentin.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble Connecting to nRF5340 via nRFConnect Extension (WSL Environment)</title><link>https://devzone.nordicsemi.com/thread/516835?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2025 15:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22e216f2-4632-4b7c-adf3-9b94cefd6d6c</guid><dc:creator>Bendik Heiskel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tested using the linux version of nrfjprog, jlinkexe etc. in WSL with USBPID. Instead when using WSL I have replaced the executables for nrfjprog and JLinkExe in /usr/bin with scripts that instead use the windows versions of the tools from within WSL. This has the benefit of not needing to pass the USB device over to the linux environment to connect to them.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the scripts for replacing nrfjprog and JLinkExe with the windows tools:&lt;/p&gt;
&lt;p&gt;/usr/bin/JLinkExe:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/bash
 
ARGS=(&amp;quot;$@&amp;quot;)
JLINKEXE=&amp;#39;/mnt/c/Program Files/SEGGER/JLink/JLink.exe&amp;#39;
WSLROOT=&amp;#39;\\wsl$\Ubuntu&amp;#39;
 
for IDX in ${!ARGS[*]}; do
        ARG=${ARGS[$IDX]}
        case &amp;quot;$ARG&amp;quot; in
        -*)
                ;;
        *)
                if [ -e &amp;quot;$ARG&amp;quot; ]; then
                        NEW=$(wslpath -aw &amp;quot;$ARG&amp;quot; 2&amp;gt;/dev/null) || \
                        NEW=&amp;quot;$WSLROOT&amp;quot;$(readlink -f &amp;quot;$ARG&amp;quot; | sed &amp;#39;s@/@\\@g&amp;#39;)
                        ARGS[$IDX]=$NEW
                fi
                ;;
        esac
done
 
exec &amp;quot;$JLINKEXE&amp;quot; &amp;quot;${ARGS[@]}&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;/usr/bin/nrfjprog:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/bash
 
ARGS=(&amp;quot;$@&amp;quot;)
NRFJPROG=&amp;#39;/mnt/c/Program Files/Nordic Semiconductor/nrf-command-line-tools/bin/nrfjprog.exe&amp;#39;
WSLROOT=&amp;#39;\\wsl$\Ubuntu&amp;#39;
 
for IDX in ${!ARGS[*]}; do
        ARG=${ARGS[$IDX]}
        case &amp;quot;$ARG&amp;quot; in
        -*)
                ;;
        *)
                if [ -e &amp;quot;$ARG&amp;quot; ]; then
                        NEW=$(wslpath -aw &amp;quot;$ARG&amp;quot; 2&amp;gt;/dev/null) || \
                        NEW=&amp;quot;$WSLROOT&amp;quot;$(readlink -f &amp;quot;$ARG&amp;quot; | sed &amp;#39;s@/@\\@g&amp;#39;)
                        ARGS[$IDX]=$NEW
                fi
                ;;
        esac
done
 
exec &amp;quot;$NRFJPROG&amp;quot; &amp;quot;${ARGS[@]}&amp;quot;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The scrips need to be set as a executable using &lt;code&gt;chmod +x /usr/bin/nrfjprog /usr/bin/JLinkExe&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I also recommend to rename the existing executables before replacing them, incase you need to revert the changes.&lt;/p&gt;
&lt;p&gt;It should be possible to do the same for other CLI tools, but these are the only ones I have tested.&lt;/p&gt;
&lt;p&gt;This approach requires &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download"&gt;nRF-Command-Line-Tools&lt;/a&gt; and &lt;a href="https://www.segger.com/downloads/jlink/"&gt;SEGGER JLink&lt;/a&gt; to be installed on the host windows system.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Bendik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>