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:


Fullscreen
1
2
3
4
5
6
7
8
9
10
11
-- 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/python@3.9/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/python-tk@3.9/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/python-tk@3.9/libexec/_tkinter.cpython-39-darwin.so
Reason: image not found
FAILED: CMakeFiles/guiconfig /Users/myusername/myprojectname/myprojectname/build/CMakeFiles/guiconfig
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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:

Fullscreen
1
2
3
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",
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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:

    Fullscreen
    1
    2
    3
    4
    5
    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/python@3.9/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:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Reply
  • 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:

    Fullscreen
    1
    2
    3
    4
    5
    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/python@3.9/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:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Children
  • 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

  • Yeah that's strange, I did select nRF52840dk_nrf52840 for the build config. I wonder if the other nrf52840 options have the same issue,.

  • Also to add, looking further, as per the first message. The directory:

    /opt/nordic/ncs/v1.7.1/toolchain/opt

    Is missing tcl-tk/lib/libtcl8.6.dylib, as I had a look there and it doesn't seem to be found.

  • I had this same issue when trying to build guiconfig on a Mac. Creating the missing directory and copying the files 

    libtcl8.6.dylib and libtk8.6.dylib from a different python distribution to that directory fixed the issue and let me build the guiconfig target successfully.

  • Hello, and thanks for reporting this. 

    According to our team the issue is due to an outdated/incorrect build of the toolchain. The latest kconfig extension should be available, and working, instead of guiconfig

    The team are aware and working on a fix for Mac. 

    Kind regards,
    Øyvind