Building a Connect SDK v1.9 project

Hello,

I am working on a project which was previously developed by another person, and am struggling to setup the development environment. The project was built on nRF Connect SDK v1.9, and I need to be able to recompile the firmware as-is due to time constraints preventing a migration to v3 at the moment.

After getting past some initial hurdles, I'm currently stuck with a device tree error.

Here is the build output:

west build -b nrf9160dk/nrf9160/ns -d c:\wm2build --  -DOVERLAY_CONFIG="config/overlay-debug.conf" -DCONFIG_MCUBOOT_IMAGE_VERSION=\"0.3.0+1\" -DPM_STATIC_YML_FILE=pm_static_debug.yml
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/wm2
-- CMake version: 4.1.0
-- Cache files will be written to: C:/wm2/zephyr/.cache
-- Zephyr version: 4.2.99 (C:/wm2/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: nrf9160dk, Revision: 0.14.0, qualifiers: nrf9160/ns
-- Found host-tools: zephyr 0.17.0 (C:/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (C:/zephyr-sdk-0.17.0)
-- Found BOARD.dts: C:/wm2/zephyr/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns.dts
-- Found devicetree overlay: C:/wm2/zephyr/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_0_14_0.overlay
-- Found devicetree overlay: C:/wm2/boards/nrf9160dk_nrf9160_ns.overlay
devicetree error: 'sda-pin' appears in /soc/peripheral@40000000/i2c@a000 in C:/wm2build/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in C:/wm2/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml
CMake Error at zephyr/cmake/modules/dts.cmake:306 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

Call Stack (most recent call first):
  zephyr/cmake/modules/zephyr_default.cmake:131 (include)
  zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
  CMakeLists.txt:17 (find_package)


-- Configuring incomplete, errors occurred!

The error mentions "C:/wm2build/zephyr/zephyr.dts.pre" and "C:/wm2/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml", but should I even be going in and touching those Zephyr files to begin with? I'm not sure what the proper solution would be for this.

The overall process has been like so:
-git clone ...
-cd ...
-west init
-west update
-run west build

Has anyone seen a similar issue to this, and be able to advise on how I should proceed?

Thank you

  • What is in the C:/wm2/boards/nrf9160dk_nrf9160_ns.overlay? Seems like the error comes from that file 

  • Thanks for pointing me in the right direction, it does appear to be related to the project overlay(s).

    Here are relevant snippets from the overlay which appear to be triggering the errors.


    devicetree error: 'sda-pin' appears in /soc/peripheral@40000000/i2c@a000 in C:/wm2build/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in C:/wm2/zephyr/dts/bindings\i2c\nordic,nrf-twim.yaml

    &i2c2 {
    	compatible = "nordic,nrf-twim";
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x0 >;
    	reg = < 0xa000 0x1000 >;
    	clock-frequency = < 0x61a80 >;
    	interrupts = < 0xa 0x1 >;
    	status = "okay";
    	label = "I2C_2";
    	sda-pin = < 0x1e >;
    	scl-pin = < 0x1f >;
    
    	lis3mdl: lis3mdl@1e {
    		compatible = "st,lis3mdl";
    		reg = <0x1e>;
    		label = "LIS3MDL";
            irq-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
    	};
    };


    devicetree error: 'ch0-pin' appears in /soc/peripheral@40000000/pwm@21000 in C:/wm2build/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in C:/wm2/zephyr/dts/bindings\pwm\nordic,nrf-pwm.yaml

    &pwm0 {
    	status = "okay";
    	ch0-pin = <2>;
    	ch1-pin = <3>;
    };


    devicetree error: missing data after phandle in <Property 'pwms' on /pwmleds0/pwm_led_0 in C:/wm2/boards/nrf9160dk_nrf9160_ns.overlay:58>

    pwmleds0 {
    		compatible = "pwm-leds";
    		pwm_led0: pwm_led_0 {
    			pwms = <&pwm0 2>;
    		};
    	};
    
    	pwmleds1 {
    		compatible = "pwm-leds";
    		pwm_led1: pwm_led_1 {
    			pwms = <&pwm0 3>;
    		};
    	};


    I can remove those blocks from the overlay to get around the above errors. My assumption was that the project would be in a buildable state given the correct SDKs are setup. Could it be that the overlay was meant for a different version of nRF Connect SDK and/or Zephyr? 

  • Okay it looks like I may have not properly set things up originally, I never specified v1.9.0 when issuing west init. I've tried changing the procedure as follows, and I no longer get early device tree overlay errors, but unfortunately still fails to build.

    0. clone project repo/copy sample to c:\test
    1. make c:\west
    2. cd c:\west
    3. west init -m https://github.com/nrfconnect/sdk-nrf --mr v1.9.0
    4. west update
    5. west build -b nrf9160dk_nrf9160_ns -s c:\test --pristine

    I've attached a minimal complete reproducible project if someone else can test out the procedure as well. I used the hello-world sample as a basis, and then modified main.c to add some calls to DEVICE_DT_GET(...). When I test trying to get "sw0", I have no issues building. When I test trying to get "lis3mdl" then there are a bunch of warnings and errors (see output.txt).


    test project:

    6153.test.zip


    build output:

    1205.output.txt

  • based on the overlay you posted:

    &i2c2 {
    	compatible = "nordic,nrf-twim";
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x0 >;
    	reg = < 0xa000 0x1000 >;
    	clock-frequency = < 0x61a80 >;
    	interrupts = < 0xa 0x1 >;
    	status = "okay";
    	label = "I2C_2";
    	sda-pin = < 0x1e >;
    	scl-pin = < 0x1f >;
    
    	lis3mdl: lis3mdl@1e {
    		compatible = "st,lis3mdl";
    		reg = <0x1e>;
    		label = "LIS3MDL";
            irq-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
    	};
    };

    I think you should do:
    const struct device *mag = DEVICE_DT_GET(DT_NODELABEL(lis3mdl));

  • Hello,

    Sorry for jumping in late. NCS v1.9.X -> v3.1.0 is a long jump. A lot have happened in that time, modules like pinctrl and sysbuild have been added. I believe these are the two biggest changes between these NCS versions. 

    I strongly recommend that you look into the Nordic Developer Academy. The very first course, nRF Connect SDK Fundamentals has a lesson on I2C. Look at that one in particular to see how to set up your devicetree after pinctrl was introduced. But feel free to at least peek trough the first couple of lessons as well, to familiarize yourself with NCS, if you haven't used it much before.

    Best regards,

    Edvin

Related