Overlay conflict with dts

Hello,

I have a project for the nRF52811 using the nRF Connect SDK. As I understand, it’s not recommended to modify the main .dts file directly; instead, changes should be made through an .overlay file.

However, when I add a button to my overlay on a pin that’s already used in the .dts file (e.g., gpio0 pin 9), I get a warning saying: pin 9 of gpio0 already assigned to &led2. I found a suggestion to remove the original pin assignment in the overlay using:

/delete-node/ &led2;

/delete-property/ led2;

But when I do this, it causes an error in the original .dts file in the aliases section: led2 = &led2; -> unknown reference to &led2.

So, I'm unsure of the correct approach here. Should I modify the original .dts file directly? Should I create my own .dts file that isn’t part of the SDK? Or is there a clear guide on how to handle these conflicts properly?

Thank you very much for your help!

Parents
  • Hello,

    The alias needs to be deleted as well. Please see my answer in this thread:  nRF5340 + Zephyr cannot disable led node 

    Best regards,

    Vidar 

  • Thank you. But still error:

    This is in my overlay:

      aliases{
            btntx1 = &btntx1;
            btntx2 = &btntx2;
            btntx3 = &btntx3;
            btntx4 = &btntx4;
            adcbat = &adcbat;
            adcbat2 = &adcbat2;
            userledgreen = &ledtxgreen;
            userledred  = &ledtxred;
            /delete-property/ led0;
            /delete-property/ led1;
            /delete-property/ led2;
            /delete-property/ led3;
        };
    
        /delete-node/ leds;
    But in .dts file is error becasue the aliases for led0,1,2,3 are undefined:
    aliases {
            led0 = &led0;
            led1 = &led1;
            led2 = &led2;
            led3 = &led3;
            pwm-led0 = &pwm_led0;
            sw0 = &button0;


    What else is wrong? Thank you
    in  .dts: 
Reply
  • Thank you. But still error:

    This is in my overlay:

      aliases{
            btntx1 = &btntx1;
            btntx2 = &btntx2;
            btntx3 = &btntx3;
            btntx4 = &btntx4;
            adcbat = &adcbat;
            adcbat2 = &adcbat2;
            userledgreen = &ledtxgreen;
            userledred  = &ledtxred;
            /delete-property/ led0;
            /delete-property/ led1;
            /delete-property/ led2;
            /delete-property/ led3;
        };
    
        /delete-node/ leds;
    But in .dts file is error becasue the aliases for led0,1,2,3 are undefined:
    aliases {
            led0 = &led0;
            led1 = &led1;
            led2 = &led2;
            led3 = &led3;
            pwm-led0 = &pwm_led0;
            sw0 = &button0;


    What else is wrong? Thank you
    in  .dts: 
Children
Related