- Edited
Hello,
I recently posted a couple questions about creating a new Zephyr device driver. I’ve worked further on a driver, following Jared Wolff’s post at https://interrupt.memfault.com/blog/building-drivers-on-zephyr. When I go to compile, I get multiple similar errors regarding undefined driver config flags. The first few are,
home/ted/projects/embedded/ncs/zephyr/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_defconfig:3: warning: attempt to assign the value 'y' to the undefined symbol SOC_SERIES_NRF91X
/home/ted/projects/embedded/ncs/zephyr/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_defconfig:4: warning: attempt to assign the value 'y' to the undefined symbol SOC_NRF9160_SICA
/home/ted/projects/embedded/ncs/zephyr/boards/arm/sparkfun_thing_plus_nrf9160/sparkfun_thing_plus_nrf9160_defconfig:5: warning: attempt to assign the value 'y' to the undefined symbol BOARD_SPARKFUN_THING_PLUS_NRF9160
My starting point is a copy of one of Nordic’s ncs v1.6.1 sample projects. Essentially I copied ‘ncs/zephyr/samples/basic/blinky’ to ‘ncs/zephyr/samples/sandbox/blink-and-uart’, where I tried a few simple combining of example projects. Those all build but did not involve changing nor adding Kconfig and CMakeLists.txt files.
It is here is the sandbox project that I added a small directory tree like the one in Jared’s pyrinas
project:
` drivers
|
+-------------+--------+
| | |
CMakeLists.txt Kconfig kionix
|
+-------------+---+----+
| | |
CMakeLists.txt Kconfig kx132-1211
|
+-------------+
| |
CMakeLists.txt Kconfig
My starting point came with a CMakeLists.txt file, to which I added one line:
add_subdirectory(drivers)
There was no Kconfig file, so along side the new drivers
directory I added a file Kconfig with these lines:
menu "stage 1 drivers including Kionix"
rsource "drivers/Kconfig"
endmenu
Do the errors above indicate that my new Kconfig file is mis-directing the cmake
build process away from my development board’s Kconfig or other build files?
Before I created the ‘drivers’ directory and Kconfig file alongside, was it a module.yml file which pointed cmake to a top level Kconfig file somewhere else in Nordic’s nsc Software Development Kit?
Jared’s blog posts walks through an example driver hierarchy dir by dir and file by file. From this walk through it looks like we should be able to create the same file and dir structure in an example project of the ncs SDK. Is this a mistaken assumption?
- Ted