Setup custom KCONFIG for spi drivers offset.h cmake

Hey Everyone, I am new to Nordic and zephyr. I would say I am a beginner. 
I am trying to setup custom drivers from ST for the lsm6dsv16x sensor. I know most of the time is in the setup stage, which is where I am at. 

As soon as I put my own Kconfig in my folders, my cmake and prj.conf are all red. Im not sure why. All im trying to do is add the custom st drivers into a zephyr library so that I can use the SPI features

I uploaded a zip of my project 


update:

I was able to add the custom yaml file by following a similar format to this 
https://github.com/teslabs/zds-2022-drivers-app

but I am having an issue with the overlay, the node says it is an unknown node. 


// To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.

// You can also use the buttons in the sidebar to perform actions on nodes.
// Actions currently available include:

// * Enabling / disabling the node
// * Adding the bus to a bus
// * Removing the node
// * Connecting ADC channels

// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
// You can also visit the nRF DeviceTree extension documentation at https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/ncs_configure_app.html#devicetree-support-in-the-extension
&i2c0 { status = "disabled"; };
&spi0 { status = "disabled"; };
&i2c1 { status = "disabled"; };

&spi1 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    pinctrl-0 = <&spi1_default>;
    pinctrl-1 = <&spi1_sleep>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; // Adjust this pin as per your setup
    lsm6dsv16x@0 {
        compatible = "custom,lsm6dsv16x";
        reg = <0>;
        spi-max-frequency = <8000000>;

    };

};

&pinctrl {
    spi1_default: spi1_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 7)>,
                    <NRF_PSEL(SPIM_MISO, 0, 26)>;
        };
    };
    spi1_sleep: spi1_sleep {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 7)>,
                    <NRF_PSEL(SPIM_MISO, 0, 26)>;
            low-power-enable;
        };
    };
};

another issue I am getting is this

In file included from C:/ncs/v2.6.1/zephyr/include/zephyr/app_memory/app_memdomain.h:9,
from C:/ncs/v2.6.1/zephyr/include/zephyr/rtio/rtio.h:31,
from C:/ncs/v2.6.1/zephyr/include/zephyr/drivers/sensor.h:28,
from C:/nordic/inter/blinky/drivers/sensor/lsm6dsv16x/lsm6dsv16x_reg.h:36,
from C:/nordic/inter/blinky/drivers/sensor/lsm6dsv16x/lsm6dsv16x_reg.c:20:
C:/ncs/v2.6.1/zephyr/include/zephyr/linker/linker-defs.h:26:10: fatal error: offsets.h: No such file or directory
26 | #include <offsets.h>

7506.blinky.zip

Parents Reply Children
  • Hi there,

    Yes I am using the nRF5340DK ev board. I believe I was able to solve the offset by including this 

    if(CONFIG_CUSTOM_LSM6DSV16X)
    zephyr_include_directories(.)
    zephyr_library()
    zephyr_library_sources( lsm6dsv16x_zephyr.c)
    zephyr_library_sources(lsm6dsv16x_reg.c)
    zephyr_library_add_dependencies(offsets_h)
    
    endif()
    

    on the sensor folder. 

    But now I feel like the issue I have is on the overlay. I'm not sure if my custom yaml is being read correct. 
    I believe my cmake configuration is not right or my kconfig is not right throught my project folder. 
    Again I am also new to cmake, so if there is sources out there that I can learn more about cmake and what not that would be helpful 
    6254.blinky.zip
    this is the upgraded zip folder of the project. 

  • Hi there, I decided to redo my project a bit and I think I passed the custom drivers. But now I am having an issue with


    "C:/blinky/build_3/zephyr/include/generated/syscalls/log_msg.h:66: undefined reference to `__device_dts_ord_137'"

    I am not sure why I get that. 

    2844.blinky.zip

Related