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

Error when attempting to create a custom driver for kx134-1211 accelerometer

Hello, 

I am trying to create a  custom driver for an accelerometer I have sourced. I am using the nrf5340-dk. 

The code was not able to compile as a result of the following CMake errors when attempting to create a new driver:

warning: TACH_NPCX (defined at c:\Users\Matt\ncs\v1.6.1\nrf5340_Projects\kx134_tst1\build\soc\arm\nuvoton_npcx\npcx7\Kconfig.defconfig.series:85) defined without a type

c:\Users\Matt\ncs\v1.6.1\nrf5340_Projects\kx134_tst1\prj.conf:3: warning: attempt to assign the value 'y' to the undefined symbol SPI_1
Parsing C:/Users/Matt/ncs/v1.6.1/zephyr/Kconfig
Loaded configuration 'C:/Users/Matt/ncs/v1.6.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'c:/Users/Matt/ncs/v1.6.1/nrf5340_Projects/kx134_tst1/prj.conf'

error: Aborting due to Kconfig warnings

CMake Error at C:\Users\Matt\ncs\v1.6.1\zephyr\cmake\kconfig.cmake:264 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:\Users\Matt\ncs\v1.6.1\zephyr\cmake\app\boilerplate.cmake:555 (include)
C:\Users\Matt\ncs\v1.6.1\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:24 (include)
C:\Users\Matt\ncs\v1.6.1\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:35 (include_boilerplate)
c:\Users\Matt\ncs\v1.6.1\nrf5340_Projects\kx134_tst1\build\CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'c:\Users\Matt\ncs\v1.6.1\toolchain\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\Users\Matt\ncs\v1.6.1\toolchain\opt\bin\python.exe' '-Bc:\Users\Matt\ncs\v1.6.1\nrf5340_Projects\kx134_tst1\build' '-Sc:\Users\Matt\ncs\v1.6.1\nrf5340_Projects\kx134_tst1' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONF_FILE:STRING=c:/Users/Matt/ncs/v1.6.1/nrf5340_Projects/kx134_tst1/prj.conf -DDTC_OVERLAY_FILE:STRING=c:/Users/Matt/ncs/v1.6.1/nrf5340_Projects/kx134_tst1/boards/nrf5340dk_nrf5340_cpuapp.overlay
The terminal process terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

I referenced the is2DH driver and sample to create my code. 

I have created the following overlay file in the boards directory of the test file. 


&spi1 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    sck-pin = <47>;
    mosi-pin = <45>;
    miso-pin = <46>;
    cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;

    kx134@0 {
        compatible = "rohm,kx134";
        label = "KX134";
        spi-max-frequency = <16000000>;
        reg = <0>;
        irq-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    };
};
I have added the driver instance to the correct KConfig and CMakeLists.txt files within the <homepath>\zephyr\drivers\sensor and <homepath>\zephyr\drivers directories. 
I have also tried updating west and the tool chains required. 
My development environment is the Visual Studio code configuration that was set up using the following instructions: devzone.nordicsemi.com/.../nrf-connect-for-visual-studio-code-preview

Would someone be able to help me trouble shoot these errors, that is familiar with the zephyr device tree api. 

Thanks 

Parents Reply Children
No Data
Related