nRF Connect SDK- NRF5340 Audio DK Python script build problems

I'm using the doc at https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf5340_audio/README.html For the nrf5340_audio DK and I'm having problems building with the Python script in the building in the programming section https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf5340_audio/README.html# 

BUILDING AND PROGRAMMING the AUDIO Example

Development platform used

Windows10

nRFConnect SDK version v2.4.0

nRF Connect for VS Code Extension Pack  v2022.9.6

I'm getting an error 

  • west' is not recognized as an internal or external command

I'm using the toolbox manager bash command and I'm able to get past some of the tools and installed them with PIP . what do I need to do to assure that the tools for West and others in the script are visible?

Parents
  • Hi Stephen,

    Could you take a look at this ticket.

    Best Regards,

    Priyanka

  • Thank you for your response. However I looked at the ticket you referred to and it doesn't answer the complete question building the audio DK application. We're installing West might work but it's more of getting the script to execute without error. That is what I'm trying to accomplish and will continue to find the solution.

  • Hi Stephen,

    Apologies for the delay. Once you install west, then your problem of west not found might disappear. Then I understand that you also get errors when executing, in the script. So in order to take a closer look at this, could you attach what error you get when trying to execute the script?

    -Priyanka

  • Thank you for your response  

    I have been able to get way pass the initial build issue that I opened this ticket with. 

    west' is not recognized as an internal or external command

    I'm now using the bash command line tool accessible from the SDK version tab in the Tool Manger.

    I have spent may long days trying to get a build done, so I could move on to programming the 2 devices. I was successful with the build (using different permutations of arguments) but the Programming using the script was not resulting in a proper firmware installation on both devices?

    Now I'm stuck in programming the devices. I cannot program the net core on both devices? Due to readback protection?

    Here are the steps I did.

    1. Copy code to s4
      1. I’m using the v2.4.0 of the SDK , so here is the directory I copied the code from: C:\ncs\v2.4.0\nrf\applications\nrf5340_audio
    2. Change Jason file to add device id for gateway and headset devices.
    3. Go to  the script directory
      1. cd C:/A/s4/tools/buildprog
    4. Turn on both devices and USB cables to PC
    5. 1 BUILD with Debug not Release
      1. python buildprog.py -c both -b debug -d both -m external 
    6. 2 PROGRAM with Debug not release
      1. python buildprog.py -p -c both -b debug -d both

    I have attached the results of the BUILD and the PROGRAMMING in 2 separate word docx documents

    Here is a screenshot of the result of the PROGRAM command 

    Not sure why I'm getting this error? PLEASE ADVISE

    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).

    the arguments --recover and --log DO NOT work in the python script? PLEASE ADVISE

    I am stuck now on this and need your help with some direction on what I'm doing wrong?

    s4 build.docxs4 program.docx

  • Hi Stephen,

    Please take a look at the Building and Programming using script documentation. There it is specified how to recover for readback protection.

    -Priyanka

  • Hi

    i’m sorry,  but I have used this document for days now. I have tried documenting my steps and tried the recover argument and it does not work as specified. 

    Can you be more specific with giving me the correct command line to recover Please…

    again, I have found the document to have errors with the recover argument .

    Regards Steve 

  • Hi Stephen,

    In the link I have mentioned in the previous comment, it highlights to this:

    Have you tried this?

    -Priyanka

Reply Children
  • Yes I have tried this. but a get the following error all the time?

    buildprog.py: error: unrecognized arguments: --recover-on-fail

    It appears that It doesn't know about the argument " --recover-on-fail"

  • The App doc page is incorrect the program command has an incorrect argument “--recover-on-fail”! It should be defined with underscores not dashes.

    THIS NEEDS TO BE FIXED ON THE DOC PAGE TO STOP CONFUSION WHEN USING THE AUDIO EXAMPLE TO BUILD & PROGRAM the KIT

    Using the command:

    python buildprog.py -c both -b debug -d both -p --recover_on_fail

    Results:

    1. Still get the use recover argument error in the output, even though I ran the command with “--recover_on_fail” ? Please refer to the output of the command at the end of this reply.
    2. Received some other errors refer to “s4_program_sucess_with_recover.txt”
    3. I’m assuming the 2 boards are programmed because the script reports that they are as follows:

     

    |    snr     | snr conn |  device | only reboot             | core app programmed | core net programmed |

    | 1050171701 |   True   | headset | Not selected    |         Done                              Done       

    | 1050131916 |   True   | gateway | Not selected    |         Done                              Done       

    The output of the command:

    skrug@DESKTOP-KJBLMH9 MINGW64 /c/A/s4/tools/buildprog
    $ python buildprog.py -c both -b debug -d both -p --recover_on_fail
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    | 1050171701 |   ←[32mTrue←[0m   | headset | Not selected |     Selected TBD    |     Selected TBD    |
    | 1050131916 |   ←[32mTrue←[0m   | gateway | Not selected |     Selected TBD    |     Selected TBD    |
    |     10     |  ←[33mFalse←[0m   | headset | Not selected |     Selected TBD    |     Selected TBD    |
    +------------+----------+---------+--------------+---------------------+---------------------+
    Invoking build step
    Net core uses precompiled hex
    Run: west build C:\A\s4 -b nrf5340_audio_dk_nrf5340_cpuapp -d C:\A\s4\build\dev_headset\build_debug
    [0/14] Performing build step for 'empty_net_core_subimage'
    [0/5] Performing build step for 'b0n_subimage'
    ninja: no work to do.
    [1/10] Performing build step for 'mcuboot_subimage'
    ninja: no work to do.
    [4/6] Generating ../../zephyr/net_core_app_test_update.hex
    image.py: sign the payload
    [6/6] Running post-build ble5-ctr signing step...
    0x00000001
    image.py: sign the payload
    input hex name C:\ncs\v2.4.0\nrf\lib\bin\bt_ll_acs_nrf53\bin\ble5-ctr-rpmsg_shifted_3349.hex
    relative path
    Run: west build C:\A\s4 -b nrf5340_audio_dk_nrf5340_cpuapp -d C:\A\s4\build\dev_gateway\build_debug
    [0/14] Performing build step for 'empty_net_core_subimage'
    [0/5] Performing build step for 'b0n_subimage'
    ninja: no work to do.
    [1/10] Performing build step for 'mcuboot_subimage'
    ninja: no work to do.
    [2/10] Generating ../../zephyr/net_core_app_test_update.hex
    image.py: sign the payload
    [6/6] Running post-build ble5-ctr signing step...
    0x00000001
    image.py: sign the payload
    input hex name C:\ncs\v2.4.0\nrf\lib\bin\bt_ll_acs_nrf53\bin\ble5-ctr-rpmsg_shifted_3349.hex
    relative path
    Using NET hex: C:\lib\bin\bt_ll_acs_nrf53\bin\ble5-ctr-rpmsg_3349.hex for 1050171701 headset left
    Using NET hex: C:\lib\bin\bt_ll_acs_nrf53\bin\ble5-ctr-rpmsg_3349.hex for 1050131916 gateway
    Programming net core on: 1050171701 headset left
    Programming net core on: 1050131916 gateway
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    Recovering device: 1050171701 headset left
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    Recovering device: 1050131916 gateway
    [error] [ Client] - Encountered error -90: Command enable_coprocessor executed for 14 milliseconds with result -90
    [error] [ Worker] - Application core access protection is enabled, can't enable coprocessor.
    Recovering device. This operation might take 30s.
    [error] [ Client] - Encountered error -90: Command enable_coprocessor executed for 14 milliseconds with result -90
    Recovering device. This operation might take 30s.
    [error] [ Worker] - Application core access protection is enabled, can't enable coprocessor.
    Erasing user code and UICR flash areas.
    Erasing user code and UICR flash areas.
    Writing image to disable ap protect.
    Writing image to disable ap protect.
    Recovering device. This operation might take 30s.
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    Writing image to disable ap protect.
    Programming net core on: 1050131916 gateway
    Programming net core on: 1050171701 headset left
    Programming app core on: 1050131916 gateway
    Programming app core on: 1050171701 headset left
    Programming UICR
    Parsing parameters.
    Writing.
    Parsing parameters.
    Writing.
    Resetting 1050131916 gateway
    Parsing parameters.
    Writing.
    Resetting 1050171701 headset left
    Applying system reset.
    Run.
    Applying system reset.
    Run.
    build_prog.py finished. Report:
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    | 1050171701 |   True   | headset | Not selected |         Done        |         Done        |
    | 1050131916 |   True   | gateway | Not selected |         Done        |         Done        |
    |     10     |  False   | headset | Not selected |     Not selected    |     Not selected    |
    +------------+----------+---------+--------------+---------------------+---------------------+
    
    skrug@DESKTOP-KJBLMH9 MINGW64 /c/A/s4/tools/buildprog

Related