Building nrf5340_audio based project for nRF5340 DK

Hi Nordic Team and Community,

I'm working on a project based on the nrf5340_audio application, which I intend to run on the standard nRF5340 DK (the non-Audio version), which is listed as supported hardware in the SDK documentation (https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/doc/requirements.rst)

My target board for west build is nrf5340dk/nrf5340/cpuapp. My build command is: west build -b nrf5340dk/nrf5340/cpuapp --pristine -- -DEXTRA_CONF_FILE="unicast_server/overlay-unicast_server.conf"

Problem Description:

I'm encountering several issues when trying to build for the standard nRF5340 DK:

Initial Devicetree Error: I first hit an error 'DT_N_ALIAS_sw4_P_gpios_IDX_0_VAL_pin' undeclared. This was because my project's src/modules/button_assignments.h file unconditionally defines a BUTTON_5 using DT_ALIAS(sw4). 

The official user_interface.rst documentation does show different button mappings for the nRF5340 DK vs. the Audio DK, implying the application should adapt.

Linker Errors:
After working around the initial button issue (by commenting out BUTTON_5 and its usage), I now face the following linker errors:

  • undefined reference to 'nrf5340_audio_dk_init' (called from my project's unicast_server/main.c)
  • undefined reference to 'hw_codec_default_conf_enable' (called from my project's src/audio/audio_system.c)
  • undefined reference to 'hw_codec_soft_reset' (from src/audio/audio_system.c)
  • undefined reference to 'hw_codec_init' (from src/audio/audio_system.c)
  • undefined reference to 'volume_evt_sub' (a Zbus observer used in my unicast_server/main.c)

    Any guidance on the correct setup for making an nrf5340_audio-based project work cleanly on the standard nRF5340 DK would be greatly appreciated.

    Thanks

    • I've noticed a documentation discrepancy that might be relevant to the challenges I'm facing with NCS v3.0.2 and the standard nRF5340 DK.

      While the nrf5340_audio app's documentation on GitHub's main branch (in requirements.rst and user_interface.rst) indicates support for the standard nrf5340dk_nrf5340_cpuapp, the specific documentation for NCS v3.0.2 (here: docs.nordicsemi.com/.../requirements.html) states that for this SDK version, the application was designed only for the nRF5340 Audio DK.

      This might explain why adapting it to the standard DK with NCS v3.0.2 requires more adjustments than initially anticipated.

      Anyway, I have made significant progress. By implementing conditional compilation directives (#if IS_ENABLED(CONFIG_BOARD_NRF5340_AUDIO_DK) and #if IS_ENABLED(CONFIG_AUDIO_CODEC_CS47L63)) in my project's C files (including unicast_server/main.c, src/audio/audio_system.c, and src/modules/button_assignments.h), I have successfully resolved all previous linker errors and devicetree issues. The project now compiles successfully for the nrf5340dk/nrf5340/cpuapp target.

      Furthermore, I have mapped the button functionalities described in the user_interface.rst documentation to the available buttons on the standard nRF5340 DK.



    • Hello,

      CyrilS said:
      I've noticed a documentation discrepancy that might be relevant to the challenges I'm facing with NCS v3.0.2 and the standard nRF5340 DK.

      This is very relevant. Since you are working on nRF Connect SDK v3.0.2, you need to also refer to the release specific documentation, and not the "latest" documentation. On https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html this is selected with the pull down menu under the page header(s): 

      CyrilS said:
      While the nrf5340_audio app's documentation on GitHub's main branch (in requirements.rst and user_interface.rst) indicates support for the standard nrf5340dk_nrf5340_cpuapp, the specific documentation for NCS v3.0.2 (here: docs.nordicsemi.com/.../requirements.html) states that for this SDK version, the application was designed only for the nRF5340 Audio DK.

      Support for nRF5340 DK is under development and not currently part of a tagged release of nRF Connect SDK. You can find the current state of the implementation in the main branch of nRF Connect SDK. See for example this commit which takes different board configurations into account when configuring LEDs and buttons.

      If you want to know when the next nRF Connect SDK version is released, please contact your Regional Sales Manager.

      If you are having any issues with using the nRF5340 DK for LE Audio development after the implementation has been finalized, please let us know here on DevZone.

      Best regards,

      Maria

    Related