parse error: undefined node label 'pwm1' when building for 3.0.1 using nrf5340dk

I'm using 3.0.1 to compile an app for a nrf5340dk. It is building for 2.9.1, but errors on 3.0.1:

devicetree error: ./nrf5340dk_nrf5340_cpuapp_291.overlay:51 (column 1): parse error: undefined node label 'pwm1'
CMake Error at /opt/nordic/ncs/v3.0.1/zephyr/cmake/modules/dts.cmake:305 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

Call Stack (most recent call first):
  /opt/nordic/ncs/v3.0.1/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
  /opt/nordic/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /opt/nordic/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
  CMake configure failed for Zephyr project: display_hello_world

  Location: /Users/*********/Projects/GitHub/*********/display_hello_world
Call Stack (most recent call first):
  cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
  cmake/modules/sysbuild_default.cmake:21 (include)
  /opt/nordic/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  /opt/nordic/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  /opt/nordic/ncs/v3.0.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)

Line 51 is the first line of:

&pwm1 {
    status = "okay";
    pinctrl-0 = <&pwm1_default>;
    pinctrl-1 = <&pwm1_sleep>;
    pinctrl-names = "default", "sleep";
};

I thought that was the node label definition.

Here is the complete overlay:

/* Include the MIPI DBI definitions */
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>

&pinctrl {

    spi4_default: spi4_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
                <NRF_PSEL(SPIM_MOSI, 0, 25)>;
        };
    };

    spi4_sleep: spi4_sleep {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
                <NRF_PSEL(SPIM_MOSI, 0, 25)>;
            low-power-enable;
        };
    };

    pwm1_default: pwm1_default {
		group1 {
			psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
		};
	};

	pwm1_sleep: pwm1_sleep {
		group1 {
			psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
			low-power-enable;
		};
	};
};

&pwm1 {
    status = "okay";
    pinctrl-0 = <&pwm1_default>;
    pinctrl-1 = <&pwm1_sleep>;
    pinctrl-names = "default", "sleep";
};

&spi4 {
	status = "okay";
	pinctrl-0 = <&spi4_default>;
	pinctrl-1 = <&spi4_sleep>;
	cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

/ {
    chosen {
        zephyr,display = &st7789v_st7789v_tl019fqv01;
    };

    lvgl_pointer_input: lvgl_pointer {
        compatible = "zephyr,lvgl-pointer-input";
    };

    aliases {
        input = &cst816s;
        screenblk = &display_blk;
    };

	pwmleds {
		compatible = "pwm-leds";
	
		display_blk: pwm_led_0 {
			pwms = <&pwm1 0 PWM_USEC(15) PWM_POLARITY_NORMAL>;
            label = "Display Backlight";
		};

	};

    mipi_dbi {
		compatible = "zephyr,mipi-dbi-spi";
        reset-gpios = < &gpio1 10 GPIO_ACTIVE_LOW>;
        dc-gpios = < &gpio1 11 GPIO_ACTIVE_HIGH>;
		spi-dev = <&spi4>;
		#address-cells = <1>;
		#size-cells = <0>;
		write-only;
        st7789v_st7789v_tl019fqv01: st7789v@0 {
            compatible = "sitronix,st7789v";
            reg = <0>;
            mipi-max-frequency = <DT_FREQ_M(20)>;
            mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
            status = "okay";
            width = <240>;
            height = <280>;
            x-offset = <0>;
            y-offset = <20>;
            vcom = <0x19>;
            gctrl = <0x35>;
            vrhs = <0x12>;
            vdvs = <0x20>;
            mdac = <0x00>;
            gamma = <0x01>;
            colmod = <0x05>;
            lcm = <0x2c>;
            porch-param = [0c 0c 00 33 33];
            cmd2en-param = [5a 69 02 01];
            pwctrl1-param = [a4 a1];
            pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
            nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
            ram-param = [00 F0];
            rgb-param = [CD 08 14];
        };
    };


    buttons {
		compatible = "gpio-keys";
		button1: button_1 {
			gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
			label = "Push button 2";
			zephyr,code = <INPUT_KEY_1>;
		};
	};

};

Parents
  • Hello,

    Could you attach the full build log? I'm curious if there's anything else there.

    Could you compare it with the solution (https://github.com/NordicDeveloperAcademy/ncs-inter/tree/main/l4/l4_e2_sol) in https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-4-pulse-width-modulation-pwm/topic/exercise-2-17/ and see if you've missed any configuration?

    Kind regards,
    Andreas

  • Sorry. I just tried with the battery sample and am getting the same error:

    -- Found BOARD.dts: /opt/nordic/ncs/v2.9.1/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    devicetree error: /soc/peripheral@50000000/pwm@22000: undefined node label 'pwm1_default'
    CMake Error at /opt/nordic/ncs/v2.9.1/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.9.1/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: battery
    
      Location: /Users/xxxxxxxxx/Projects/GitHub/xxxxxxxxx/battery
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /opt/nordic/ncs/v2.9.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    

    I simply created a new app using the battery sample as a template, selected nrf5340dk as the board target, and tried to build it.

Reply
  • Sorry. I just tried with the battery sample and am getting the same error:

    -- Found BOARD.dts: /opt/nordic/ncs/v2.9.1/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    devicetree error: /soc/peripheral@50000000/pwm@22000: undefined node label 'pwm1_default'
    CMake Error at /opt/nordic/ncs/v2.9.1/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.9.1/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: battery
    
      Location: /Users/xxxxxxxxx/Projects/GitHub/xxxxxxxxx/battery
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /opt/nordic/ncs/v2.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /opt/nordic/ncs/v2.9.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    

    I simply created a new app using the battery sample as a template, selected nrf5340dk as the board target, and tried to build it.

Children
No Data
Related