About DeviceTree and Overlay files

I want to edit the sample source (nRF5340 Audio) and program it on my own board.

I'm using CIS.

I'm using NCS version 2.5.0.

The nRF5340 Audio DK board is exactly the same hardware,

so one overlay file works fine.

The circuit of the transmitter and receiver of my own board is different.

Therefore, I think two overlay files are necessary.

VSCODE is not recommended for nRF5340 Audio.

Therefore, I run the program made in Python from the command prompt.

Specifically, I run buildprog.py in the Tools/buildprog folder with the following command.

python buildprog.py -c both -b release -d both -m internal -M -p --recover_on_fail

How can I achieve this?

For example, is it possible to create two types of overlay files in one source and use different overlay files when running the script?

I would like to know the specific method.

When I enter the corresponding
J-Link serial number only into the Headset in the nrf5340_audio_dk_devices.json file and execute the build and write, then I enter the corresponding J-Link serial number only into the Gateway and execute the build and write, and I am unable to connect to BLE.

Do you know what the cause is?

  • Hello,

    For starters, the nRF5340 audio application(s) can be built with the command line as well as with the script. Also, from NCS v2.6.0, the SoftDevice controller is the default controller for the application(s), which means that building and programming with the VS Code extension is possible. We do recommend that you use the most recent releases of NCS when developing LE Audio because there are frequent updates. Please upgrade to NCS v2.6.1 if you can.

    Specifically, I run buildprog.py in the Tools/buildprog folder with the following command.

    python buildprog.py -c both -b release -d both -m internal -M -p --recover_on_fail

    How can I achieve this?

    For example, is it possible to create two types of overlay files in one source and use different overlay files when running the script?

    I would like to know the specific method.

    You should be able to edit the buildprog.py script to fit your requirements. This can be to add more flags to the command or changing the behaviour for the existing flags. Since you want to add a devicetree overlay to your application, there aren't many changes needed  If you store the overlay file in a boards directory within the LE audio project I think you only need to change the target board in the buildprog.py script. The basis for my hypothesis is that the buildprog.py script is putting together a west command, and west will find overlays within <project-folder>/boards when building.

    When I enter the corresponding
    J-Link serial number only into the Headset in the nrf5340_audio_dk_devices.json file and execute the build and write, then I enter the corresponding J-Link serial number only into the Gateway and execute the build and write, and I am unable to connect to BLE.

    I have a few questions to make sure I understand your setup: Are you flashing your custom board? If yes: What are you using as a debugger?

    Do you know what the cause is?

    The device logs in debug mode can be helpful to find out what goes wrong with the connection. Build and flash with -b debug, then study and send the device logs in a reply. Tip: You can insert the log through Insert->Code.

    Best regards,

    Maria

  • When using VSCODE, I think you can only build and flash one at a time, either the Gateway or Headset.

    Do I need to set anything in the configuration file?

    I previously received a response from dejans that VSCODE is not supported.

    If I update NSC to 2.6.1, develop with VSCODE, and encounter problems,

    can you provide support?

    The latest NCS is 2.7.0-rc2. Is it okay to use that?

    I am flashing to a custom board.

    I am using the J-Link BASE Compact debugger.

    When I build with a script in debug mode with NCS version 2.5.0, I get a build error.

    (I have asked about this in another ticket)

  • I installed the 2.6.1 version of NCS.

    I also installed the 2.6.1 version of the nRF5340 Audio source.

    When I ran the script, I got the following python argument error.

    The command I ran is below.

    python buildprog.py -c both -b release -d both -m external -M

    The error is below.

    usage: buildprog.py [-h] [-r] [-p] [-c {app,net,both}] [--pristine] [-b {release,debug}] -d {headset,gateway,both}

    [-s] [-f] [--nrf21540] [-cn [CUSTOM_BT_NAME ...]] [-u]

    buildprog.py: error: unrecognized arguments: -m external -M

    When I ran the script as shown below without the arguments that were causing the error, I got the following error.
    CMake Error at C:/ncs/v2.6.1/zephyr/cmake/modules/boards.cmake:167 (message):

    Invalid BOARD; see above.

    Call Stack (most recent call first):

    C:/ncs/v2.6.1/zephyr/cmake/modules/zephyr_default.cmake:129 (include)

    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)

    C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)

    CMakeLists.txt:13 (find_package)

    -- Configuring incomplete, errors occurred!

    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe '-BC:\Users\TSP_M1\nrf5340_audio_1\build\dev_headset\build_release' -GNinja -DBOARD=nrf5340_audio_dk/nrf5340/cpuapp -DCONFIG_AUDIO_DEV=1 -DFILE_SUFFIX=release '-SC:\Users\TSP_M1\nrf5340_audio_1'
    Traceback (most recent call last):
    File "C:\Users\TSP_M1\nrf5340_audio_1\tools\buildprog\buildprog.py", line 417, in <module>
    __main()
    File "C:\Users\TSP_M1\nrf5340_audio_1\tools\buildprog\buildprog.py", line 400, in __main
    __build_module(build_cfg, options)
    File "C:\Users\TSP_M1\nrf5340_audio_1\tools\buildprog\buildprog.py", line 175, in __build_module
    raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 1

    What is the cause of each error?

    I get an error even when building with VSCODE.

    If you want to build with VSCODE, you may need to add additional items to the configuration file.
    Please tell me the additional items for Gateway and Headset.

  • Thank you for the additional information.

    The DFU process has been through a change when switching from the dedicated audio controller to the SDC controller. This could be a cause for the "unrecognized arguments" error. I will do a test tomorrow to verify.

    The invalid board seems to be that the -DBOARD value is nrf5340_audio_dk/nrf5340/cpuapp which is the format in NCS main now, but should not be the format for NCS v2.6.1 as far as I know. The toolchain hash seems to be correct, so I am not sure why the new format is there.

    I'll get back to this tomorrow!

  • When testing I found the following:

    1. python buildprog.py -c both -b release -d both -m external -M will not work and will produce an Exception: DFU arguments only accepted when using controller: ACS_nRF53. Please use standard tools.

    2. When running the command python buildprog.py -c both -b release -d both --ctlr ACS_nRF53 -m external -M the build succeeds.

    Are you building the default application version or a modified/duplicated version? The buildprog.py script can change between NCS releases, so ensure that the buildprog.py you are using corresponds to the NCS version and toolchain you are using.

    Can you verify that you are able to build the nRF5340 Audio application after a fresh NCS installation?

    Junichi said:

    I installed the 2.6.1 version of NCS.

    I also installed the 2.6.1 version of the nRF5340 Audio source.

    The nRF5340 Audio applications are part of NCS so you should not install the application again after installing NCS.

    Best regards,

    Maria

Related