nRF Connect for VS Code: Kconfig & GUI config failing with SDK v1.8.0 (macOS)

HI, 

I've gotten round to trying to setup a development envoironment with nRF Connect SDK & VS Code which I've been really looking forward to. 

I've installed nRF SDK v1.8.0 from the NRF connect desktop app's toolchain manager. I've also installed all the required VS code extensions.

I then went to setup an example project: "zephyr/samples/bluetooth/peripheral_hr ", using a freestanding envoironment. It succesfully builds and flashes my nRF52840 dk, and seems to work. 

I tried to then use the guiconfig to see what modules I can add and start playing around, the following error is produced in the terminal when I try to start it:


-- west build: running target guiconfig
[0/1] cd /Users/myusername/myprojectname/myprojectname/build/zephyr/kconfig &...phyr/scripts/kconfig/guiconfig.py /opt/nordic/ncs/v1.8.0/zephyr/Kconfig
Traceback (most recent call last):
  File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 77, in <module>
    from tkinter import *
  File "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: dlopen(/opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/libexec/_tkinter.cpython-39-darwin.so, 2): Library not loaded: /opt/nordic/ncs/v1.8.0/toolchain/opt/tcl-tk/lib/libtcl8.6.dylib
  Referenced from: /opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/libexec/_tkinter.cpython-39-darwin.so
  Reason: image not found
FAILED: CMakeFiles/guiconfig /Users/myusername/myprojectname/myprojectname/build/CMakeFiles/guiconfig 

It seems the python interpreter used cannot find the Tk gui package. I'm not quite sure if it's trying to use one of my system interpet

Also, Im not sure if this is supposed to anything but clicking 'Kconfig' just says "Unable to find Kconfig information to display. Please select a Kconfig file first"

Further more, there is an error message in the zephyr files Kconfig.defconfig, I'm not sure if this is related:

File: "/opt/nordic/ncs/v1.8.0/zephyr/soc/arm/atmel_sam/Kconfig.defconfig",

"message": "soc/arm/atmel_sam/Kconfig.defconfig:11: error: couldn't parse 'default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)': macro expanded to blank string",


Parents
  • Hi, 

    Yes I'm starting VS Code from the toolchain manager. I haven't actually adjusted any configurations, as the said error messages pop up soon as  I click "guiconfig" or "kconfig". I've tried one of the 'official' examples: like https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/samples/bluetooth/peripheral_hr_coded/README.html

    Same issue there.

    For guiconfig, it's clear the python interpreter is being used cannot find the tkinter gui package. I've done some more investigation, and it seems your toolchain has it's own python interpreter bundled with it, as you can see from these lines:

      File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 77, in <module>
        from tkinter import *
      File "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 37, in <module>
        import _tkinter # If this fails your Python may not be configured for Tk
    ImportError:

    For kconfig, this message I think might be causing the issue:

    soc/arm/atmel_sam/Kconfig.defconfig:11: error: couldn't parse 'default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)': macro expanded to blank string

    In the file "/opt/nordic/ncs/v1.8.0/zephyr/soc/arm/atmel_sam/Kconfig.defconfig",

  • savvn001 said:
    In the file "/opt/nordic/ncs/v1.8.0/zephyr/soc/arm/atmel_sam/Kconfig.defconfig",

    Not sure why this file is included if you chose to build for the nRF52840dk_nrf52840

    I have forwarded your question to our team. 

    Kind regards,
    Øyvind

  • @ Nice, thanks for that. Will give that a go as a temp workaround for now.

  • Please note that the Mac toolchain for v1.8.0 is updated. Reinstall v1.8.0 to fix.

  • @ I've just removed, then re installed v1.8.0:

    Opened my current workspace project and ran guiconfig, it generates the following error:

    > Executing task: /opt/nordic/ncs/v1.8.0/toolchain/bin/west build -d /Users/myusername/myproject/build -t guiconfig <
    
    -- west build: running target guiconfig
    [0/1] cd /Users/myusername/myproject/build/zephyr/kconfig && /opt/nordic/ncs/v1.8.0/toolchain/Cellar/cmake/3.21.1/bin/cm...lchain/opt/[email protected]/bin/python3.9 /opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py /opt/nordic/ncs/v1.8.0/zephyr/Kconfig
    Traceback (most recent call last):
    File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 2331, in <module>
    _main()
    File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 105, in _main
    menuconfig(standard_kconfig(__doc__))
    File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 183, in menuconfig
    _create_ui()
    File "/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/guiconfig.py", line 295, in _create_ui
    _root = Tk()
    File "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable init.tcl in the following directories:
    /usr/local/Cellar/tcl-tk/8.6.11_1/lib/tcl8.6 /opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/3.9.6/lib/tcl8.6 /opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/lib/tcl8.6 /opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/3.9.6/library /opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/library /opt/nordic/ncs/v1.8.0/toolchain/Cellar/[email protected]/tcl8.6.11/library /opt/nordic/ncs/v1.8.0/toolchain/Cellar/tcl8.6.11/library
    
    
    
    This probably means that Tcl wasn't installed properly.

  • _tkinter.TclError: Can't find a usable init.tcl in the following directories: /usr/local/Cellar/tcl-tk/8.6.11_1/lib/tcl8.6

    Do you have another instance/installation of tcltck? The developers are not able to reproduce your issue and refers to using menuconfig or the new kconfig extension.

  • Hi Guys, 

    I have the same issue on a Mac, and I do not have another version of TCL installed, and running into the same issue on both v1.8.0 and 1.9.1. It can be solved with sym linking

    /usr/local/Cellar to /opt/nordic/ncs/{$version}/toolchain/Cellar

    However that is hardly a solution. I believe what is happening here is that the TCL_LIBRARY_PATH needs to be set to point to /opt/ncs/{$version}/tollchain/Cellar

    The reason the devs might not see it is because they already have stuff in /usr/local/Cellar on their test machine. 


    hope this helps the devs to isolate the issue. If not... reach out.

Reply
  • Hi Guys, 

    I have the same issue on a Mac, and I do not have another version of TCL installed, and running into the same issue on both v1.8.0 and 1.9.1. It can be solved with sym linking

    /usr/local/Cellar to /opt/nordic/ncs/{$version}/toolchain/Cellar

    However that is hardly a solution. I believe what is happening here is that the TCL_LIBRARY_PATH needs to be set to point to /opt/ncs/{$version}/tollchain/Cellar

    The reason the devs might not see it is because they already have stuff in /usr/local/Cellar on their test machine. 


    hope this helps the devs to isolate the issue. If not... reach out.

Children
No Data
Related