# Something missing from zephyr sdk debugging documentation

**URL:** <https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046>\
**Category:** Firmware\
**Tags:** windows\
**Created:** [April 2, 2024, 8:34pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046 "2024-04-02T20:34:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Embedded\_iceman](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@Embedded\_iceman](https://discuss.blues.com/u/Embedded_iceman)\
**Post date:** [April 2, 2024, 8:34pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046/1 "2024-04-02T20:34:21Z")

</div>

Hi,

First things first, I am new to docker and Zephyr and my host machine runs W11.

I managed to get app-accelerator project 18 to build in a docker image.

Now I am stuck at launching debug server (openocd)  
Execute the following command on your host machine, _OUTSIDE_ the container:

```auto
openocd --search /usr/share/openocd/scripts --file interface/stlink.cfg --command "transport select hla_swd" --file target/stm32l4x.cfg

```

from [Zephyr SDK - Blues Developers](https://dev.blues.io/tools-and-sdks/firmware-libraries/zephyr-sdk/#gdb-openocd-via-stlink)

It mentions to do that outside of the container environment. So I assume this must be done from WSL2 ?

Then I get

Open On-Chip Debugger 0.11.0  
Licensed under GNU GPL v2  
For bug reports, read  
[OpenOCD: Bug Reporting](http://openocd.org/doc/doxygen/bugs.html)  
hla\_swd  
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD  
Info : Listening on port 6666 for tcl connections  
Info : Listening on port 4444 for telnet connections  
Info : clock speed 500 kHz  
Error: open failed

I have forwarded the USB port to wls  
$ lsusb  
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  
Bus 001 Device 002: ID 0483:3754 STMicroelectronics STLINK-V3  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I am sure there are some key information missing from that page. Can someone get me on the right path here ?

---

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [April 2, 2024, 8:39pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046/2 "2024-04-02T20:39:54Z")

</div>

OpenOCD connects to the attached MCU from your PC, then opens a port (Internet) on your PC through which you can send debug commands to the attached MCU. GDB will then connect to the port, and you can debug the attached MCU.

It’s been a long while since I’ve used Windows, but back i the day, WSL had difficulty identifying USB devices (i.e. they do not show up in `/dev`).

I would propose running OpenOCD in Cygwin or powershell, and see if you have any better luck.

Best,  
Zak

---

<div class="post-metadata">

**Author:** ![Embedded\_iceman](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@Embedded\_iceman](https://discuss.blues.com/u/Embedded_iceman)\
**Post date:** [April 2, 2024, 8:58pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046/3 "2024-04-02T20:58:02Z")

</div>

Ok, I am surely not the first to have issues using west flash in a container image.

Is there a way to use ST-link-V3 from within the container image ?

---

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [April 2, 2024, 9:24pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046/4 "2024-04-02T21:24:13Z")

</div>

The problem is the way Docker is implemented on Windows / MacOS, versus Linux.

Linux runs containers natively, so all resources, devices, networks, etc. are shared.

Both Windows and MacOS run Docker in a VM. This adds a layer of complexity, when trying to link everything together. This is why I would suggest using OpenOCD natively, because it opens a port, and makes it’s easy to bridge the gap between the VM and Windows using the network.

However, if you want to go down the path of WSL2, then I suggest you follow this guide: [Connect USB devices | Microsoft Learn](https://learn.microsoft.com/en-us/windows/wsl/connect-usb), to enable WSL2 to connect to your USB devices. I have a friend who has successfully done this, but he worked at Microsoft for 25 years, so he understands the internals a little better than most.

If you do get it working, please post back here with your experience, because I’m sure there will be many more that would like to follow in your footsteps.

Best,  
Zak

---

<div class="post-metadata">

**Author:** ![Embedded\_iceman](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@Embedded\_iceman](https://discuss.blues.com/u/Embedded_iceman)\
**Post date:** [April 3, 2024, 8:02pm UTC](https://discuss.blues.com/t/something-missing-from-zephyr-sdk-debugging-documentation/2046/5 "2024-04-03T20:02:18Z")

</div>

Thank you zfields. That clears it up for me. Onto setting up a linux machine 😁
