testing nf5340_audio_dk

I am trying to use the nrf5340 audio DK for the first time using one of the sample blink codes. I keep getting an error when first creating an application by copying the sample provided. The system seems to be missing a board information and I could not figure out where and how to provide that information. My system configuration and versions of my tools are given below. I am beginning to wonder if my installation is ok as some of the folders are different from the nrfConnect instruction videos from Nordic which  were for a Windows PC.

My Toolchain is 2.6.1 at /opt/Nordic/ncs/toolchains

My SDK is 2.6.1 at /opt/Nordic/ncs/v2.6.1

My applications are in user/name/ncs/

MacBook Pro 2.9ghz quad core i7

16GB RAM Mac OS13.6.7

VS Code

Version: 1.90.1

Commit: 611f9bfce64f25108829dd295f54a6894e87339d

Date: 2024-06-11T21:02:41.372Z

Electron: 29.4.0

ElectronBuildId: 9593362

Chromium: 122.0.6261.156

Node.js: 20.9.0

V8: 12.2.281.27-electron.0

OS: Darwin x64 22.6.0

The error I am getting is below. Apologies for the long text captured and pasted. Can someone help?

CMake Error at /opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake:2891 (message):BOARD is not being defined on the CMake command-line, in the environment or

by the app.

[{

"resource": "/opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake",

"owner": "cmake-configure-diags",

"severity": 8,

"message": "CMake Error at /opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake:2891 (message):BOARD is not being defined on the CMake command-line, in the environment or\nby the app.",

"source": "CMake (message)",

"startLineNumber": 2891,

"startColumn": 1,

"endLineNumber": 2891,

"endColumn": 10000,

"relatedInformation": [

{

"startLineNumber": 56,

"startColumn": 1,

"endLineNumber": 56,

"endColumn": 1000,

"message": "In call to 'zephyr_check_cache' here",

"resource": "/opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/boards.cmake"

},

{

"startLineNumber": 129,

"startColumn": 1,

"endLineNumber": 129,

"endColumn": 1000,

"message": "In call to 'include' here",

"resource": "/opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/zephyr_default.cmake"

},

{

"startLineNumber": 66,

"startColumn": 1,

"endLineNumber": 66,

"endColumn": 1000,

"message": "In call to 'include' here",

"resource": "/opt/nordic/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake"

},

{

"startLineNumber": 159,

"startColumn": 1,

"endLineNumber": 159,

"endColumn": 1000,

"message": "In call to 'include_boilerplate' here",

"resource": "/opt/nordic/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake"

},

{

"startLineNumber": 4,

"startColumn": 1,

"endLineNumber": 4,

"endColumn": 1000,

"message": "In call to 'find_package' here",

"resource": "/Users/assegid/ncs/blinky/CMakeLists.txt"

}

]

}]

Parents
  • Hi,

    Could you open your VS Code command pallette (ctrl/cmd +  shift + p) and generate support information and paste it here? You can avoid longer text snippets by using the insert -> code feature as seen below:

    It seems like that the board is not defined when you're building. Could you describe the procedure you go through when trying to build the firmware?

    Does the issue persist if you add the SDK folder into your workspace as seen below?

    Kind regards,
    Andreas

  • Hi Andreas, I simply used Create a new application in Visual Studio Code and then copied the sample provided for the nrf5340_audio_dk and created a build using the dafault settings. I have attached the support file generated as you requested. I was unable to add the SDK folder to the workspace because the /opt folder where the SDK is in was not available in the add folder dialog window. Do you want me to copy the SDK folder and paste it in the application folder and try?

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 22.6.0: Mon Apr 22 20:54:28 PDT 2024; root:xnu-8796.141.3.705.2~1/RELEASE_X86_64",
        "osKernel": "22.6.0",
        "vscode": "1.90.1",
        "electron": "29.4.0",
        "node": "v20.9.0"
      },
      "system": {
        "date": "2024-06-18T05:22:20.847Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:11:28",
        "osUptime": "32:40:15",
        "cpu": "Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz"
      },
      "workspace": {
        "name": "nrf5340_audio (Workspace)",
        "workspaceFile": "/Users/assegid/ncs/nrf5340_audio/nrf5340_audio.code-workspace",
        "folders": [
          "/Users/assegid/ncs/nrf5340_audio"
        ]
      },
      "sdks": [
        {
          "version": "v2.6.1",
          "path": "/opt/nordic/ncs/v2.6.1"
        }
      ],
      "activeBuild": "/Users/assegid/ncs/nrf5340_audio/buildAsIs",
      "apps": [
        {
          "workspace": "/Users/assegid/ncs/nrf5340_audio",
          "uri": "/Users/assegid/ncs/nrf5340_audio",
          "buildConfigurations": [
            {
              "id": "/Users/assegid/ncs/nrf5340_audio/buildAsIs",
              "name": "buildAsIs",
              "boardId": "nrf5340_audio_dk_nrf5340_cpuapp",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "/opt/nordic/ncs/v2.6.1",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.6.1",
          "path": "/opt/nordic/ncs/toolchains/580e4ef81c"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "001050124819"
        }
      ],
      "deviceProvider": "nrfutil",
      "tools": {
        "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.16.5",
        "/Applications/SEGGER/JLink/JLinkExe": "7.94e",
        "/usr/local/bin/nrfjprog": null,
        "nrfutil": "Not found",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/cmake": "3.21.0",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/west": "1.2.0",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/python3": "3.9.6",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gperf": "3.1",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gn": "2154",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/git": "2.37.3",
        "gdbPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-x64/platform/nrfutil/bin/nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.1",
          "binPath": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-x64/platform/nrfutil/bin/nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/Cellar/git/2.37.3/libexec/git-core",
          "HOME": "/Users/assegid",
          "PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/local/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/nanopb/generator-bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/riscv64-zephyr-elf/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v2.6.1/zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk",
          "USER": "assegid"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/Users/assegid",
          "PATH": "/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin",
          "USER": "assegid"
        },
        "toolchainPath": "/opt/nordic/ncs/toolchains/580e4ef81c",
        "toolchainBinPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin",
        "toolchainVersion": "2.6.1"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "",
          "toolchain": {
            "path": ""
          },
          "ozonePath": "",
          "applications": [],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "taskBindings": {},
          "buildTerminal": {
            "condensedProgress": true
          },
          "debugging": {
            "flash": true,
            "bindings": {},
            "justMyCode": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": null,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask"
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2024.3.25",
            "path": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2024.3.15",
            "path": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-terminal-2024.3.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2024.3.78",
            "path": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2024.3.78",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2024.3.21",
            "path": "/Users/assegid/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2024.3.21",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.20.5",
          "ms-vscode.js-debug": "1.90.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.9",
          "devicescript.devicescript-vscode": "2.16.2",
          "espressif.esp-idf-extension": "1.7.1",
          "ms-vscode-remote.remote-containers": "0.369.0",
          "ms-vscode.cmake-tools": "1.18.42",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "platformio.aceinna-ide": "0.1.2",
          "platformio.platformio-ide": "3.3.3",
          "raspberry-pi.raspberry-pi-pico": "0.13.1",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      }
    }
    
    

  • I managed to program the boards after lots of trial and error and information from the link below..

     Flashing issues after updating Command Line Tools on macOS 

    Now, I am off to the long road of setting up the various tools properly as I am not at all confident my system is optimized with the various tools linked properly. I am still getting errors when copying sample codes to create an application.

  • Hi,

    Glad to see that you've been having some progress. Here's some update/follow up regarding your various comments from the weekend

    assegid said:
    I followed the installation instructions on your website and another available on youtube. I was unsuccessful on both Mac and Windows machines

    I would typically recommend that you go through the guide in this course for installation: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-1-nrf-connect-sdk-introduction/ (exercise 1), which links to the official documentation here https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation.html 

    Unfortunately the youtube videos might be slightly updated w.r.t to installing and setting up the SDK.

    assegid said:
    When I create an application by copying the Blinky example provided, I get the errors shown below in the pictures.

    This might not be relevant since you in your latest comment suggests that you've resolved this, but anyways: Is this output generated when you use the Build in the VS Code extension? I.e how did you build the sample?

    assegid said:
    I am still getting errors when copying sample codes to create an application.

    The same errors as previously seen or new ones?

    Kind regards,
    Andreas

  • Hi Andreas,

    I wanted to try building and programming using the instructions provided here. However, when I run python buildprog.py -h, I get the response below.

    assegid@HIDA-4167107 buildprog % python buildprog.py -h
    
    Traceback (most recent call last):
    
      File "/opt/nordic/ncs/v2.6.1/nrf/applications/nrf5340_audio/tools/buildprog/buildprog.py", line 20, in <module>
    
        from colorama import Fore, Style
    
    ModuleNotFoundError: No module named 'colorama'

    I have already tried to install colorama using the pip instructions.

    Any idea what is going on now?

  • Hi,

    From what I see it looks like you're using an Engineering version of the DK. Is this correct? Referring to the image you pasted showing your connected devices: 

    This PDK is an experimental DK so there might be anomalies with this board that causes this issue. I would recommend that you get hold of a newer DK and test with this. Please reach out to your local RSM for more information regarding this.

    The error: 

    CMake Error at /opt/nordic/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake:2891 (message):BOARD is not being defined on the CMake command-line, in the environment or by the app.

    indicates that the board could be the issue.

    We've tried to reproduce it on several MacOS machines, but with non-clean installations and clean installations and we don't see the same issue that you're seeing, so you will have to exclude that this is caused by the board before we move on as well as trying with a 100% clean machine from scratch following the installation guides for your OS on your machine.

    Kind regards,
    Andreas

  • After getting over the 'colorama module missing' issue, I have been able to program the boards without issues. I have created another thread regarding 'colorama' to help other users save time if they run into the same issue. I have tested the provided sample code for CIS and BIS modes; Broadcast Source, Broadcast Sink, Unicast Client, Unicast Server, enabling and disabling the configuration bits, and the results are below. 

    Summary

    In all cases audio input using USB works only briefly or not at all.

    In BIS mode volume is lower.

    Volume control and test tones work only in CIS mode CONFIG_STREAM_BIDIRECTIONAL=y makes no difference.

    In BIS and Bidirectional mode: no mic activity

    In CIS and Bidirectional mode: no mic activity

    In CIS and walkie talkie: low quality sound from mic from gateway to headset, no line in or test tone working

    In CIS walkie talkie and bidirectional: very low mic sound quality, no line in or test tone

    In BIS and walkie talkie: cmake error 256

    In BIS Bidirectional and walkie talkie: cmake error 256

    Please confirm my boards are older engineering versions, I have attached a picture showing version, production date and serial numbers.

Reply
  • After getting over the 'colorama module missing' issue, I have been able to program the boards without issues. I have created another thread regarding 'colorama' to help other users save time if they run into the same issue. I have tested the provided sample code for CIS and BIS modes; Broadcast Source, Broadcast Sink, Unicast Client, Unicast Server, enabling and disabling the configuration bits, and the results are below. 

    Summary

    In all cases audio input using USB works only briefly or not at all.

    In BIS mode volume is lower.

    Volume control and test tones work only in CIS mode CONFIG_STREAM_BIDIRECTIONAL=y makes no difference.

    In BIS and Bidirectional mode: no mic activity

    In CIS and Bidirectional mode: no mic activity

    In CIS and walkie talkie: low quality sound from mic from gateway to headset, no line in or test tone working

    In CIS walkie talkie and bidirectional: very low mic sound quality, no line in or test tone

    In BIS and walkie talkie: cmake error 256

    In BIS Bidirectional and walkie talkie: cmake error 256

    Please confirm my boards are older engineering versions, I have attached a picture showing version, production date and serial numbers.

Children
  • Hi,

    assegid said:
    After getting over the 'colorama module missing' issue, I have been able to program the boards without issues. I have created another thread regarding 'colorama' to help other users save time if they run into the same issue. I have tested the provided sample code for CIS and BIS modes; Broadcast Source, Broadcast Sink, Unicast Client, Unicast Server, enabling and disabling the configuration bits, and the results are below. 

    Glad to hear that you isolated the issue down to this!

    Out of curiosity, did you use a terminal that were not opened from either the toolchain manager or the VS Code extension such as the nRF Connect terminal or did you run the buildprog script from a "generic" terminal, i.e something similar to the equivalent of opening command prompt on Windows from the start menu?

    I've had a similar experience with a different Python script recently, where a missing module caused errors when I ran the script from the default Windows cmd prompt. This was not caused when running the same script from a command prompt/nRF connect terminal set up through either of the mentioned terminals due to the environment being properly setup, so I'm curious if it's the same case for the buildprog script for nRF Audio on your device as well

    If it is, we'll update the documentation to specify that you must either install the missing modules yourself (and that we add a requirements.txt that you can run to install all the missing modules) or to make sure that you use a terminal that has been set up to be a "proper" environment"

    Kind regards,
    Andreas

  • Hi Andreas,

    I have now abandoned using Visual Studio Code and simply using the python script in zsh editing the json file and the prj.conf file as needed. When I was using VS Code, I was using the nrf Connect terminal within VS Code. I have also tried the other terminals in the list.

  • Noted,

    Thank you for verifying that the behavior was present in either ways to open the terminal.

    assegid said:
    Please confirm my boards are older engineering versions, I have attached a picture showing version, production date and serial numbers.

    The boards seems to be of a new enough revision.

    For now, does this resolve the original issue in this case?

    If so we'll mark your case as resolved and as always please feel free to open new cases for new queries and questions

    Kind regards,
    Andreas

Related