Cant delete button nodes.

Im trying to delete button nodes but Im getting errors 

devicetree error: /aliases: undefined node label 'button0'

Tried a bunch of different approaches. Deleting unwanted LEDs I managed following  RE: nRF5340 + Zephyr cannot disable led node 

If I delete directly from Devicetree i get

Property "gpios" is required

also there is pwm node that I also cant remove 

pwmleds
no matter if I try to disable it or delete it, via dts or devicetree i get 
Property "pwms" is required

/ {
    aliases {
        /delete-property/ sw0;
        /delete-property/ sw2;
        /delete-property/ sw3;
    };

    /delete-node/ buttons;

    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>;
        };
    };
};

  • Hello,

    There must be some reference to buttons that you have deleted still in the dts and that would be causing error.

    Build without your overlay and note in the compiled dts where button0, button2, and button3 are used.

    For example, I can see that mcuboot-button0 alias is defined for button0, and hence if there is no button0 (as we have deleted using the overlay) then it would case error.

    I simply added the following in your overlay and it is working fine:

    /{
        aliases {        
            mcuboot-button0 = &button1;
        };
    };

Related