migration from 1.9.1 to 2.1.2

Hi,

I'm migrating a vscode project from 1.9.1 to 2.1.2.

I'm testing on  nrf52840dk_nrf52840.

I'm using I2S.

In the 1.9.1 environment I have an overlay.

&i2s0: &i2s0 {
status = "okay";
sck-pin = <25>;
lrck-pin = <26>;
sdout-pin = <27>;
};

and i2s works fine, but I can't make it work in the 2.1.2 environment.

If I compile in 2.1.2 without an overlay the compile works, but  the zephyr.dts has the following for i2s0.

i2s0: i2s_rxtx: i2s@40025000 {
compatible = "nordic,nrf-i2s";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x40025000 0x1000 >;
interrupts = < 0x25 0x1 >;
status = "disabled";;
};

If I add an overlay the changes status from disabled to ok the compile fails because there is no pinctrl entry for i2s0.

My prj.conf has the following line

'

CONFIG_I2S=y

What do I have to do to enable I2s in 2.1.2?

Parents
  • Hello Martin,

    I will have to get back to you on this tomorrow.

    Regards,

    Elfving

  • Pin Ctrl was added in NCS 2.0.  so you will need to add reference to it in your overlay if you are changing the pins.

    If you look at the attached code you can add this to the overlay and see if that helps.

    &i2s0 {
        status = "okay";
    	pinctrl-0 = <&i2s0_default>;
     	pinctrl-1 = <&i2s0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &pinctrl {
        i2s0_default: i2s0_default {
                group1 {
                        psels = <NRF_PSEL(I2S_MCK, 0, 12)>;
                        nordic,drive-mode = <NRF_DRIVE_H0H1>;
                };
    
                group2 {
                        psels = <NRF_PSEL(I2S_SCK_M, 0, 14)>,
                                <NRF_PSEL(I2S_LRCK_M, 0, 16)>,
                                <NRF_PSEL(I2S_SDOUT, 0, 13)>,
                                <NRF_PSEL(I2S_SDIN, 0, 15)>;
                };
    
        };
    
        i2s0_sleep: i2s0_sleep {
                group1 {
                        psels = <NRF_PSEL(I2S_MCK, 0, 12)>,
                                <NRF_PSEL(I2S_SCK_M, 0, 14)>,
                                <NRF_PSEL(I2S_LRCK_M, 0, 16)>,
                                <NRF_PSEL(I2S_SDOUT, 0, 13)>,
                                <NRF_PSEL(I2S_SDIN, 0, 15)>;
                        low-power-enable;
                };
    
        };
    };

  • Thank you so much.

    I added this code to my project and it seems to work (my test hardware is at my customers - he will test the new image for me in  day or two)

    I've a question or two, if that's OK.

    I think I understand the construct.

    Where do I find the documentation that tells me the details? 

    For a given peripheral:

         what pins go in groups 1 and 2

          what are their names

    Thanks

Reply
  • Thank you so much.

    I added this code to my project and it seems to work (my test hardware is at my customers - he will test the new image for me in  day or two)

    I've a question or two, if that's OK.

    I think I understand the construct.

    Where do I find the documentation that tells me the details? 

    For a given peripheral:

         what pins go in groups 1 and 2

          what are their names

    Thanks

Children
Related