Cannot build I2S echo application for NRF5340

Hi, I am a beginner into the embedded audio space, and happened upon this board to use for our university project. Our team's current plan would be to produce audio directly on the board and play it through the headphone jack, but have not found much success with the NRF5340 Audio application, as it has a lot of integration with Bluetooth (which we don't need for now). Right now we just need a simple application that plays a tune on the board.

In my search I have found the I2S echo application, which seems like a simple start for our use case. However, when trying to build the application we encountered the following error:

-- Found BOARD.dts: C:/ncs/v2.6.2/zephyr/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: boards/nrf5340dk_nrf5340_cpuapp.overlay
devicetree error: pinctrl-names property in /soc/peripheral@50000000/i2s@28000 in C:/ncs/v2.6.2/zephyr/misc/empty_file.c has 1 strings, expected 2 strings

This is our build configuration (all other options left as default):

SDK version:

Any help would be appreciated! Thanks!

Parents
  • I received your friend request relating to this problem, and while I wish I could help, my previous post that you referenced is all the knowledge I have to share.

    I've spent two years so far studying Zephyr and NCS, and I'm still barely a beginner. Nordic's nrf5340_audio application remains an impenetrable maze to me, so inextricably intertwined that none of its modules can even be reused, and trying to dissect it for example code has been an exercise in frustration.

    Good luck, but I'm definitely not an expert to solicit for guidance.

Reply
  • I received your friend request relating to this problem, and while I wish I could help, my previous post that you referenced is all the knowledge I have to share.

    I've spent two years so far studying Zephyr and NCS, and I'm still barely a beginner. Nordic's nrf5340_audio application remains an impenetrable maze to me, so inextricably intertwined that none of its modules can even be reused, and trying to dissect it for example code has been an exercise in frustration.

    Good luck, but I'm definitely not an expert to solicit for guidance.

Children
  • Hi,

    To successfully build Zephyr I2S echo sample on the nrf5340_audio-dk board, you would need to make some modifications in your overlay file. You would need to have 2 pin control names and specify them in the pinctrl-names property for i2s in the overlay file. You can compare content of i2s0 in your overlay file with the i2s0 content nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi file. Try to make the changes (shown below) in your overlay file and rebuild the application.

    i2s_rxtx: &i2s0 {
    	status = "okay";
    	pinctrl-0 = <&i2s0_default_alt>;
    	pinctrl-1 = <&i2s0_sleep>;
    	pinctrl-names = "default","sleep";
    	clock-source = "ACLK";
    };

    Best regards,
    Dejan

  • Hi, thanks for the reply! This problem was fixed when I added a second name. However, now when I run the application, it gives an error when trying to build the codec. Is there a work around for this? On the wiki page it says the NRF5340 is supported by this sample. 

  • Hi,

    Can you provide application error log?

    Best regards,
    Dejan

  • Hi,

    Here is what I see over the serial console:

    Serial Port opened
    *** Booting nRF Connect SDK 4040aa0bf581 ***
    I2S echo sample
    Initialization step 0 failed
    Tracing "Initialization step 0 failed" led to line 117 in codec.c, which leads me to believe that something went wrong with setting up the codec. Appreciate the help!
  • Hi,

    In the sample requirements, you can read this "The sample uses the WM8731 audio CODEC that can be found, for example, on the Audio Codec Shield, but it can be easily adapted to use other CODECs." but it is not the same codec that is used by the nrf5340_audio-dk board. You could try to add the lines below to your nrf5340_audio_dk_nrf5340_cpuapp.overlay file:

    &spi4 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>, <&gpio0 17 GPIO_ACTIVE_LOW>;
    	pinctrl-0 = <&spi4_default>;
    	pinctrl-1 = <&spi4_sleep>;
    	pinctrl-names = "default", "sleep";
    
    	cs47l63: cs47l63@1 {
    		compatible = "cirrus,cs47l63";
    		reg = <1>;
    		spi-max-frequency = <8000000>;
    		irq-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
    		reset-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
    		gpio9-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
    	};
    };

    Best regards,
    Dejan

Related