General issues with overlays (ie, thingy53 board selected after build configuration nrf5340dk, is this normal?)

I am working through setting up device overlays and am struggling a bit. In some part because I can't find consistency in naming or location or anything. My goal is to set up i2s and use it. 

For example I went to kconfig and selected i2s to enable it, then went and found that in zephyr.dts, the i2s was disabled. I would have expected an error in the build if that were the case.

From a search it looks like this will require an overlay, which makes sense. I went to check where to stick this and found that my boards/ directory was populated entirely with incorrect board names, ie thingy53_nrf5340_cpuapp_ns.overlay, when I selected nrf5340dk_nrf5340_app as the board in the build configuration. Is this expected or normal?...

I thought to check against an install of the excellently detailed nrf_audio example. Unfortunately if you go into kconfig for that, i2s is disabled entirely, but the i2s in the overlay is "okay"! 

Does anyone have a concise checklist for what needs to happen to enable i2s, select the pins, and use it? I am about to just go dig into the registers themselves and give that a shot, it is at least very consistently documented in the 5340 peripheral guide...

Parents
  • Just to follow up as I have been doing additional debugging...

    I'm still not sure why the nrf_audio doesn't have i2s enabled via kconfig. Looking for comprehension there.

    What did help was I found this page -> https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/pinctrl/index.html#state-model which elaborates on the new pinctrl method. In addition the project includes app.overlay which is a default, so the specific board name doesn't matter. The pinctrl can be created and assigned like the below

    &pinctrl {
        compatible = "nordic,nrf-pinctrl";
        i2s0_default: i2s0_default {
            phandle = < 0x9 >;
            group1 {
                psels = <NRF_PSEL(I2S_SCK_M, 0, 4)>, <NRF_PSEL(I2S_LRCK_M, 0, 6)>, <NRF_PSEL(I2S_SDOUT, 0, 5)>;
                nordic,drive-mode = < NRF_PULL_UP >;
            };
        };
    };

    &i2s0 {
        pinctrl-0 = < &i2s0_default >;
        pinctrl-names = "default";
    };
    This builds but I am still unable to get status: "okay", it's still disabled. I don't see any logs or anything and am not sure what happens in the backend to make this work. If there is a misconfiguration I would have expected some kind of warning or error pointing out what is missing. As of right now I know that
    1. The i2s device is enabled in kconfig (which, does that even matter?...)
    2. The i2s device is in the zephyr.dts and matches the nrf_audio's zephyr.dts
    3. The i2s device's pinctrl are in the dts as modified. In the same spot as the nrf_audio but with different pins.
    4. The name of the device in the .c where I use device_get_binding matches the name of the i2s device (i2s0). 
    Besides that, unless there is some dependency on another module that needs to be also included but is not, I am not sure where else to look, without any sort of error log. 
Reply
  • Just to follow up as I have been doing additional debugging...

    I'm still not sure why the nrf_audio doesn't have i2s enabled via kconfig. Looking for comprehension there.

    What did help was I found this page -> https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/pinctrl/index.html#state-model which elaborates on the new pinctrl method. In addition the project includes app.overlay which is a default, so the specific board name doesn't matter. The pinctrl can be created and assigned like the below

    &pinctrl {
        compatible = "nordic,nrf-pinctrl";
        i2s0_default: i2s0_default {
            phandle = < 0x9 >;
            group1 {
                psels = <NRF_PSEL(I2S_SCK_M, 0, 4)>, <NRF_PSEL(I2S_LRCK_M, 0, 6)>, <NRF_PSEL(I2S_SDOUT, 0, 5)>;
                nordic,drive-mode = < NRF_PULL_UP >;
            };
        };
    };

    &i2s0 {
        pinctrl-0 = < &i2s0_default >;
        pinctrl-names = "default";
    };
    This builds but I am still unable to get status: "okay", it's still disabled. I don't see any logs or anything and am not sure what happens in the backend to make this work. If there is a misconfiguration I would have expected some kind of warning or error pointing out what is missing. As of right now I know that
    1. The i2s device is enabled in kconfig (which, does that even matter?...)
    2. The i2s device is in the zephyr.dts and matches the nrf_audio's zephyr.dts
    3. The i2s device's pinctrl are in the dts as modified. In the same spot as the nrf_audio but with different pins.
    4. The name of the device in the .c where I use device_get_binding matches the name of the i2s device (i2s0). 
    Besides that, unless there is some dependency on another module that needs to be also included but is not, I am not sure where else to look, without any sort of error log. 
Children
No Data
Related