nRF5340_Audio Build Error

Hello All,

Just to begin, I am an extreme novice when it comes to building/flashing FW so if I do not provide enough description or ask questions that may seem a bit surface level please keep that in mind, but I am happy to provide more info anything else that is needed to help with debugging!

I believe I have the prerequisites installed and I am trying to build the nrf5340_audio sample application, but when I run the following command:

python buildprog.py -c app -b release -d gateway

I get the following log and errors:

C:\Users\samietz\Desktop\nrf5340_audio_test\tools\buildprog>python buildprog.py -c app -b release -d gateway
+------------+----------+---------+--------------+---------------------+---------------------+
|    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
+------------+----------+---------+--------------+---------------------+---------------------+
|    1000    |  ←[33mFalse←[0m   | headset | Not selected |     Not selected    |     Not selected    |
| 1050159080 |   ←[32mTrue←[0m   | gateway | Not selected |     Selected TBD    |     Not selected    |
|    1000    |  ←[33mFalse←[0m   | headset | Not selected |     Not selected    |     Not selected    |
+------------+----------+---------+--------------+---------------------+---------------------+
Invoking build step
Run: west build C:\Users\samietz\Desktop\nrf5340_audio_test -b nrf5340_audio_dk_nrf5340_cpuapp -d C:\Users\samietz\Desktop\nrf5340_audio_test\build\dev_gateway\build_release
-- west build: generating a build system
Traceback (most recent call last):
  File "c:\python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\west.exe\__main__.py", line 7, in <module>
  File "c:\python38\lib\site-packages\west\app\main.py", line 793, in main
    app.run(argv or sys.argv[1:])
  File "c:\python38\lib\site-packages\west\app\main.py", line 109, in run
    self.run_command(argv)
  File "c:\python38\lib\site-packages\west\app\main.py", line 345, in run_command
    self.run_extension(args.command, argv)
  File "c:\python38\lib\site-packages\west\app\main.py", line 417, in run_extension
    command.run(args, unknown, self.topdir, manifest=self.manifest,
  File "c:\python38\lib\site-packages\west\commands.py", line 135, in run
    self.do_run(args, unknown)
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\zephyr\scripts\west_commands\build.py", line 201, in do_run
    self._run_cmake(board, origin, self.args.cmake_opts)
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\zephyr\scripts\west_commands\build.py", line 488, in _run_cmake
    run_cmake(final_cmake_args, dry_run=self.args.dry_run)
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\zephyr\scripts/west_commands\zcmake.py", line 45, in run_cmake
    _ensure_min_version(cmake, dry_run)
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\zephyr\scripts/west_commands\zcmake.py", line 277, in _ensure_min_version
    version_out = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
  File "c:\python38\lib\subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "c:\python38\lib\subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "c:\python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "c:\python38\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application
Traceback (most recent call last):
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\tools\buildprog\buildprog.py", line 417, in <module>
    __main()
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\tools\buildprog\buildprog.py", line 400, in __main
    __build_module(build_cfg, options)
  File "C:\Users\samietz\Desktop\nrf5340_audio_test\tools\buildprog\buildprog.py", line 149, in __build_module
    raise Exception("cmake error: " + str(ret_val))
Exception: cmake error: 1

This was done while following the instructions here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf5340_audio/README.html#building-and-programming-using-script.

I have also tried building via the command line and also receive an error, but it's not the same as the above:

samietz@samietz0 MINGW64 ~/Desktop/nrf5340_audio_test
$ west build -b nrf5340_audio_dk_nrf5340_cpuapp --pristine -DCONFIG_AUDIO_DEV=2 -DCONF_FILE=prj_release.conf
WARNING: ZEPHYR_BASE=C:\ncs\v2.0.1\zephyr in the calling environment will be used,
but the zephyr.base config option in C:\Users\samietz\Desktop\nrf5340_audio_test is "zephyr"
which implies a different ZEPHYR_BASE=C:\Users\samietz\Desktop\nrf5340_audio_test\zephyr
To disable this warning in the future, execute 'west config --global zephyr.base-prefer env'
ERROR: source directory -DCONFIG_AUDIO_DEV=2 does not exist
FATAL ERROR: refusing to proceed without --force due to above error

Without an in-depth understanding of what is actually going on here I am a bit lost as to what is going wrong. Any help would be greatly appreciated!

Parents Reply Children
  • Hello,

    I am glad to hear that you were able to resolve your issue! From your initial ticket I too suspected that this would be due to the python installation, setup or similar. Just for the record, did you install the nRF Connect SDK using the Toolchain Manager from the nRF Connect SDK desktop application?

    asamietz said:
    So turns out installing cmake via the executable does not actually work and I had to install cmake with 

    Yes, I think python will not be able to use the general cmake on the system path, it will need it to be installed as a part of the python environment.

    asamietz said:
    Last thing I need is access to LC3. Can someone point me towards the contact to do that?

    LC3 access still requires an evaluation agreement, for the time being. To arrange this, and get the access to the LC3 repository, you should speak to your Regional Sales Director. The RSD for California is Mike Obot, and you may reach him on [email protected].

    Please do not hesitate to ask if you should encounter any other issues or questions in the future! :) 

    Best regards,
    Karl

  • I initially had some trouble with the Toolchain manager as the west update command was not working properly. Again this could have been due to my lack of knowledge in this area, but after installing west and installing the sdk via the command line it started to work properly (once I installed cmake via pip).

    Thanks for the contact! I will reach out to Mike.

  • asamietz said:
    Again this could have been due to my lack of knowledge in this area,

    That's no problem at all - please do not hesitate to ask us if there's anything, we are happy to help you get the hang of things! :) 
    By the way, if you would like a concise way to familiarize with the nRF Connect SDK fundamentals in a convenient and easy way I highly recommend looking through this course in DevZone Academy.

    asamietz said:
    I initially had some trouble with the Toolchain manager as the west update command was not working properly.

    Is this the west update command you ran as part of the setting up the audio repositories section of the Audio reference application documentation?
    If so, this west update is expected to end with an error if you do not have access to the LC3 repository (but all the other parts of the update should complete successfully).
    In essence, if you intend to work with the SBC or another codec then it is ok that the west update fails for the sdk-lc3 repository specifically.

    asamietz said:
    Thanks for the contact! I will reach out to Mike.

    Great! :) 

    Best regards,
    Karl

  • Thanks for the link to the fundamentals course in the DevZone, I think that would be great to check out. Being an EE only gave me brief exposure to the FW side of things.

    I can't recall the exact error that I was receiving, but the west update command would not even begin to download the audio repositories. I believe it was because I was using the west init command both without the repository as an argument and not in the initial ncs folder with the toolchain. With those repositories not being downloaded then build and flash were unrecognized commands.

  • asamietz said:
    Thanks for the link to the fundamentals course in the DevZone, I think that would be great to check out. Being an EE only gave me brief exposure to the FW side of things.

    Great! :) The nRF Connect SDK development suite can seem quite a handful at first, but this course helps you get familiar with all the different fundamental aspects, so that you may leverage all their benefits (compared to the bare-metal SDK).

    asamietz said:
    I believe it was because I was using the west init command both without the repository as an argument and not in the initial ncs folder with the toolchain. With those repositories not being downloaded then build and flash were unrecognized commands.

    Ah, yes, this could also be the case if you do not perform the commands in an 'nRF Terminal(inside VSC press ctrl+shift+p and type 'terminal' to open one), or you could open a terminal through the Toolchain Manager drop-down menu option - in both these cases the terminal will be sourced from the correct environment right off the bat, as opposed to if you only open a separate powershell or cmd instance through your windows taskbar.

    Best regards,
    Karl

Related