This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: ti embedded debug plugin for osx installs wrong openocd

Part Number: CC2340R5

Hello,

I have the latest version of the ti embedded debug plugin for vscode and it looks like the extension installed a version of openocd compiled for linux:

file ~/Library/Application\ Support/Texas\ Instruments/ti-embedded-debug/openocd/1.1.1.46/bin/bin/openocd
/Users/munan/Library/Application Support/Texas Instruments/ti-embedded-debug/openocd/1.1.1.46/bin/bin/openocd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=7e4e35869916778b9e29d3195eb15a2163a88544, with debug_info, not stripped

Obviously this didn't run when I tried to launch a debug session...

Munan

  • Hi Munan,

    I have brought this to the attention of the relevant team. I will provide updates here as I get them.

    Thanks

    ki

  • I just removed and installed again on my mac.  

    It is normal for it to say Unix Executable file.

    If you run from the terminal what happens.   For me I had to install libusb.  Then after that it ran.  I didn't pass in any config info.

    I don;t have a launch.json setup right now but I will give that a shot tomorrow.

  • Munan,

    I just tried on my other mac where I have my launch.json setup correctly.

    I removed my existing extensions and openocd.  Installed them again.

    I was able to launch a debug session fine, the openocd we install works fine.   I suspect that you are missing a dependency or something else if you are having issues.  What do you see if you try to run openocd from the terminal.

    Regards,

    John

  • Hey John,

    Ok yeah I think the issue is that the openocd is compiled against the homebrew libusb:

    munan@Munans-MacBook-Pro bin % ./openocd                            
    dyld[70265]: Library not loaded: /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib
      Referenced from: <166FE4AC-96B8-353B-9BA7-F6A7783FCCDC> /Users/munan/Library/Application Support/Texas Instruments/ti-embedded-debug/openocd/1.1.1.46/bin/bin/openocd
      Reason: tried: '/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file)
    zsh: abort      ./openocd
    

    I use macports to manage packages on my mac, so it's not finding the needed library there. I did manage to clone and build the ti-openocd repo and install it from the makefile and that of course finds the necessary library since it was configured against my system:

    munan@Munans-MacBook-Pro bin % otool -L /usr/local/bin/openocd

    /usr/local/bin/openocd:

    /opt/local/lib/libusb-1.0.0.dylib (compatibility version 6.0.0, current version 6.0.0)

    /opt/local/lib/libftdi.1.dylib (compatibility version 22.0.0, current version 22.0.0)

    /opt/local/lib/libusb-0.1.4.dylib (compatibility version 9.0.0, current version 9.4.0)

    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)

    Is it possible to distribute a local version of the libusb in the ti-embedded-debug package so it's not dependent on an external library? Otherwise it doesn't do much good to have the install dependencies button that doesn't fully install everything needed.

    Munan

  • Is it possible to distribute a local version of the libusb in the ti-embedded-debug package so it's not dependent on an external library?

    We will look to do this for a future release.

    Thanks

    ki