This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nordic Alexa_Gadget firmware sample does not build

Hi,

I would like to try the Alexa_Gadget sample supplied in nRF Connect SDK v1.4.0 on an nRF52382DK but the sample does not build.  I have tried both SES and command line builds.

I am using a Windows 10 PC, installed and launched the v1.4.0 SDK using Toolchain Manager.

The SES build appears to go well until it has to invoke the .bat files used to generate protobuf files and exits with the following error (see attachment 'alexa_gadget_SES_transcript.txt' for the full SES build transcript):

1> Error starting process src\gadgets\CMakeFiles\protobuf_generation_BASE-aa7d0b8.bat
Build failed

Building ‘cmake_object_order_depends_target_ALEXA_GADGETS_PROFILE’ from solution ‘build’ in configuration ‘Common’
Building ‘C:/NordicSemiconductor/nRF_Connect_SDK/v1.4.0/zephyr/include/dt-bindings/gpio/gpio.h’ from solution ‘build’ in configuration ‘Common’
Building ‘C:/NordicSemiconductor/nRF_Connect_SDK/v1.4.0/zephyr/include/dt-bindings/i2c/i2c.h’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/misc/generated/struct_tags.json’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘zephyr/misc/generated/struct_tags.json’
Building ‘zephyr/misc/generated/syscalls.json’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/CMakeFiles/parse_syscalls_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/parse_syscalls_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/include/generated/driver-validation.h’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘zephyr/include/generated/driver-validation.h’
Building ‘zephyr/CMakeFiles/driver_validation_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/driver_validation_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/include/generated/kobj-types-enum.h’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘zephyr/include/generated/kobj-types-enum.h’
Building ‘zephyr/include/generated/otype-to-str.h’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/CMakeFiles/kobj_types_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/kobj_types_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/include/generated/syscall_list.h’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘zephyr/include/generated/syscall_list.h’
Building ‘zephyr/CMakeFiles/syscall_list_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/include/generated/syscall_dispatch.c’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/syscall_list_h_target’ from solution ‘build’ in configuration ‘Common’
Building ‘cmake_object_order_depends_target_offsets’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj’ from solution ‘build’ in configuration ‘Common’
1> Compiling ‘offsets.c’
Building ‘zephyr/offsets’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/include/generated/offsets.h’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘zephyr/include/generated/offsets.h’
Building ‘zephyr/CMakeFiles/offsets_h’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/offsets_h’ from solution ‘build’ in configuration ‘Common’
Building ‘zephyr/zephyr_generated_headers’ from solution ‘build’ in configuration ‘Common’
Building ‘cmake_object_order_depends_target_app’ from solution ‘build’ in configuration ‘Common’
Building ‘generated/alexa/protobuf/accessories.pb.c’ from solution ‘build’ in configuration ‘Common’
1> Combining ‘generated/alexa/protobuf/accessories.pb.c’
1> Error starting process src\gadgets\CMakeFiles\protobuf_generation_BASE-aa7d0b8.bat
Build failed

The command line build fails because it looks for some of the build generated .H files before they have been created.  One such file is syscall_list.h.  Output from the command line build is in the attachment  'alexa_gadget_CMD_transcript.txt'.  Also of note in the command line transcript is that build did appear to be able to invoke the .BAT files.

4848.alexa_gadget_CMD_transcript.txt

This seems like it is an issue with project or environment settings to either allow the .BAT files to be invoked from SES or to generate the .H files prior to their use when building from the command line.

Any advice to fix those issues would be appreciated!

Sincerely,

Doug Young

Parents
  • Thank you for reporting this. I put nanopb-0.4.2-windows-x86 inot the sample folder, built it using SES/cmd and Git Bash from Toolchain Manager (TM) NCS v1.4.0 and got the same errors as you. I have reported the issue internally and hopefully we are able to resolve this soon. I found a discussion on lists.zephyrproject.org that may be related to this.

    However, I was able to build the sample from outside the Toolchain Manager. If you install NCS manually and build from a non-TM command line, you may be able to work around this as a temporary solution.

    Best regards,

    Simon

  • Hi Simon,

    I first tried spawning a command prompt outside of Toolchain Manager and then ran a batch file to set the environment variables (required to get it to build) but I still got the syscall_list.h error.

    The Zephyr discussion you referenced had some good information.  I was able to use it to remove the syscall_list.h error by adding the following lines to the src/gadgets/CMakeLists.txt file:

    # added by DY to ensures build time kernel .h files depended on by ALEXA_GADGETS_PROFILE
    # source code, such as syscall_list.h, are present when ALEXA_GADGETS_PROFILE
    # library is built.  offsets_h depends on these same kernel headers.
    add_dependencies(ALEXA_GADGETS_PROFILE offsets_h)

    The build now holds off compiling gadgets_profile.c until offsets.h is created but it then run into another dependency.

    In file included from ../src/gadgets/gadgets_profile.h:33,
                     from ../src/main.c:20:
    generated/alexa/protobuf/alexaGadgetMusicDataTempoDirective.pb.h:7:10: fatal error: directiveHeader.pb.h: No such file or directory
        7 | #include "directiveHeader.pb.h"

    I tried using the same technique to add a dependency on directiveHeader.pb.h but i haven't figured out how to do this properly.  Do you have any ideas?

    Sincerely,

    Doug Young

  • I made some more progress and can now build successfully from a bash prompt spawned from Toolchain Manager.  To fix the 'directiveHeader.pb.h' file not found error highlighted in my last post I appended a custom target to the ../src/gadgets/CMakeLists.txt file.  The custom target,  PROTOBUF_TAR, depends on the targets within the CMakeLists.txt file that are generating the protobuf files. 

    I also made the app target within ../src/CMakeLists.txt dependent on PROTOBUF_TAR so that main.c will not be built until after the protobuf files are generated.

    After modifying the CMakeLists files I have been able to build from the bash prompt a half a dozen times without error.

    This is the text appended to ../src/gadgets/CMakeLists.txt

    # DY - PROTOBUF_TAR target has no output but still has dependencies that are
    # set below.  Cmake targets that are dependent on protobuf_ready will be held
    # off until the protobuf_ready dependencies are satisfied.
    #
    add_custom_target( PROTOBUF_TAR ALL )
    #
    # protobuf_ready depends on protobuf generation targets being complete
    #
    foreach(GROUP BASE NOTIFICATIONS ALERTS STATELISTENER SPEECHDATA MUSICDATA CUSTOM)
    	add_dependencies(PROTOBUF_TAR  protobuf_generation_${GROUP} )
    endforeach()
    #
    # DY - to ensures build time kernel .h files depended on by ALEXA_GADGETS_PROFILE
    # source code, such as syscall_list.h, are present when ALEXA_GADGETS_PROFILE
    # library is built.  offsets_h depends on these same kernel headers.
    #
    add_dependencies(ALEXA_GADGETS_PROFILE offsets_h)
    #
    # DY - gadgets_profile.c is dependent on one or more proto-buffers
    #
    add_dependencies(ALEXA_GADGETS_PROFILE PROTOBUF_TAR)

    This is the text appended to ../src/CMakeLists.txt

    # DY - Added the following dependencies
    # src/main.c includes header files generated by scripts called from src/gadgets/CMakeLists.txt
    # Target PROTOBUF_TAR was appended to src/gadgets/CMakeLists.txt.
    # PROTOBUF_TAR is dependent on completed execution of the protobuf scripts
    # By making the target app dependent on target PROTOBUF_TAR, all dependencies of PROTOBUF_TAR will be complete before app target sources are compiled.
    # 
    add_dependencies(app PROTOBUF_TAR)

    Now I need to figure out how to use a command line build with the Segger SES debugger.

    Sincerely,

    Doug Young

  • I really appreciate you sharing the solutions. This will help other customers, as well as us in Nordic to fix the issue.

    If you have any specific question regarding the command line build with the Segger SES debugger, please ask, and I can look into it next week.

    Best regards,

    Simon

Reply Children
No Data
Related