This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom Kconfig Menu

I'm trying to add a sensor driver to my project based off of Zephyr's sensor driver for adxl372. I can't figure out how to get the Kconfig file in that sensor folder to show up in SES "Configure nRF Connect SDK Project" gui.

This is how I have my project setup:

($ProjectFolder)

- CMakeLists.txt

- myproject.emProject

- Kconfig.myproject

- prj.conf

- src

    - CMakeLists.txt

    - Kconfig

    - main.c

    - mysensor

        - CMakeLists.txt

        - Kconfig

        - mysensor.c

Kconfig.myproject:

menu “MyProject”

rsource “src/Kconfig”

endmenu

Kconfig under src:

comment “Device Drivers”

rsource “mysensor/Kconfig”

and the sensor Kconfig is mostly like zephyr example:

menuconfig MYSENSOR
	bool "MYSENSOR Three Axis High-g I2C/SPI Accelerometer"
	#depends on I2C || SPI
	help
	  Enable driver for MYSENSOR Three-Axis Digital Accelerometers.

if MYSENSOR

choice MYSENSOR_BUS_TYPE
	prompt "Interface type"
	help
	  Select interface the digital interface type for the MYSENSOR
	  
...continued...

But none of the options show up in SES gui.

What am I missing?

Parents
  • I figured it out. I changed and added a few things, some of which may not be needed.

    New folder tree:

    ($ProjectFolder)
    - CMakeLists.txt
    - myproject.emProject
    - prj.conf
    - src
        - main.c
    - drivers
        - mysensor
            - CMakeLists.txt
            - Kconfig
            - mysensor.c
            - zephyr
                - module.yml

    Added this line to the top of root CMakeLists.txt:

    set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}/drivers/mysensor)

    drivers/mysensor/CMakeLists.txt:

    zephyr_include_directories(.)
    
    zephyr_library()
    zephyr_library_sources_ifdef(CONFIG_MYSENSOR mysensor.c)

    drivers/mysensor/zephyr/module.yml:

    build:
      cmake: .
      kconfig: Kconfig

Reply
  • I figured it out. I changed and added a few things, some of which may not be needed.

    New folder tree:

    ($ProjectFolder)
    - CMakeLists.txt
    - myproject.emProject
    - prj.conf
    - src
        - main.c
    - drivers
        - mysensor
            - CMakeLists.txt
            - Kconfig
            - mysensor.c
            - zephyr
                - module.yml

    Added this line to the top of root CMakeLists.txt:

    set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}/drivers/mysensor)

    drivers/mysensor/CMakeLists.txt:

    zephyr_include_directories(.)
    
    zephyr_library()
    zephyr_library_sources_ifdef(CONFIG_MYSENSOR mysensor.c)

    drivers/mysensor/zephyr/module.yml:

    build:
      cmake: .
      kconfig: Kconfig

Children
No Data
Related