I am new to the nRF SDK and Zephyr, and I am having a terrible time with my Kconfig!
The setup:
I have an AdaFruit ItsyBitsy nRF52840, and I’m using nRF SDK 2.2.0 located in ~/.local/share/ncs
and VS Code as my editor with the nRF plugin, all on Linux.
I can create a project using the plugin, copying any one of the sample projects, and it sets everything up in ~/development/diy_gnss_v2
I can compile and flash the code to my device and all works as expected.
The goal:
I want to add a driver to my project for a UART-based GNSS module, the PX1122R. So following various examples dotted around GitHub, blogs, and YT videos, I have come up with the following directory structure:
├── CMakeLists.txt
├── drivers
│ ├── CMakeLists.txt
│ ├── Kconfig
│ └── px1122r
│ ├── CMakeLists.txt
│ ├── Kconfig
│ └── px1122r.c
├── Kconfig.diy_gnss_v2
├── prj.conf
├── README.rst
├── sample.yaml
├── src
│ └── main.c
├── west.yml
└── zephyr
└── module.yml
My root Kconfig file Kconfig.diy_gnss_v2
simply includes the various Kconfig files all the way down where the bottom-most one defines a simple config variable:
config WIBBLE
bool "Wobble"
Which I set in my prj.conf
The problem:
When I go to build, it says that it cannot find CONFIG_WIBBLE:
Parsing /home/merseyviking/.local/share/ncs/v2.2.0/zephyr/Kconfig
Loaded configuration '/home/merseyviking/.local/share/ncs/v2.2.0/zephyr/boards/arm/adafruit_itsybitsy_nrf52840/adafruit_itsybitsy_nrf52840_defconfig'
Merged configuration '/home/merseyviking/development/diy_gnss_v2/prj.conf'
/home/merseyviking/development/diy_gnss_v2/prj.conf:1: warning: attempt to assign the value 'y' to the undefined symbol WIBBLE
error: Aborting due to Kconfig warnings
Looking at the build output, it seems to completely ignore my west.yml
and my zephyr/module.yml
I can fill them with syntax errors and it doesn’t say anything.
If I rename my top-most Kconfig file to simply Kconfig
the build system picks up on it (still ignoring the two YAML files), but then doesn’t load the default ncs one, and so barfs because no other symbols are defined:
Parsing /home/merseyviking/development/diy_gnss_v2/Kconfig
Loaded configuration '/home/merseyviking/.local/share/ncs/v2.2.0/zephyr/boards/arm/adafruit_itsybitsy_nrf52840/adafruit_itsybitsy_nrf52840_defconfig'
Merged configuration '/home/merseyviking/development/diy_gnss_v2/prj.conf'
Traceback (most recent call last):
File "/home/merseyviking/.local/share/ncs/v2.2.0/zephyr/scripts/kconfig/kconfig.py", line 292, in <module>
main()
File "/home/merseyviking/.local/share/ncs/v2.2.0/zephyr/scripts/kconfig/kconfig.py", line 65, in main
if kconf.syms['WARN_DEPRECATED'].tri_value == 2:
KeyError: 'WARN_DEPRECATED'
So I am at a loss and very confused.
I know many people have suffered from similar problems, and I am sure it’s a PEBKAC, but no amount of Googling has told me what I need to do to fix it. Or maybe it has, but at this point I have tried so many things, I don’t know what works and what doesn’t.