Unable to add versioning to NRF application

Hello Community, I am trying to add versioning to my Bluetooth HCI_UART program for that I have modified a little according to my requirements. This would be for the BL5340PA custom board from Liard connectivity. The core chip of this board would still be the NRF5340.

To add versioning to the firmware file I am trying to follow the steps mentioned in the article here : https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/version/index.html#app-version-details

In this article the mention to create a VERSION text file in the base folder of the project and then add the "app_version.h" header file to your project.

The contents of my base folder of my project : 

While doing so I am getting the following error while building the project: 


FAILED: CMakeFiles/app.dir/src/main.c.obj 
ccache /home/mutsl04176/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/mutsl04176/ncs/PA_Firmware/zephyr/include -Izephyr/include/generated -I/home/mutsl04176/ncs/PA_Firmware/zephyr/soc/arm/nordic_nrf/nrf53 -I/home/mutsl04176/ncs/PA_Firmware/zephyr/soc/arm/nordic_nrf/common/. -I/home/mutsl04176/ncs/PA_Firmware/zephyr/subsys/mgmt/mcumgr/util/include -I/home/mutsl04176/ncs/PA_Firmware/zephyr/subsys/mgmt/mcumgr/transport/include -I/home/mutsl04176/ncs/PA_Firmware/bootloader/mcuboot/boot/bootutil/include -I/home/mutsl04176/ncs/PA_Firmware/bootloader/mcuboot/boot/zephyr/include -I/home/mutsl04176/ncs/PA_Firmware/zephyr/subsys/usb/device -I/home/mutsl04176/ncs/PA_Firmware/zephyr/subsys/bluetooth -I/home/mutsl04176/ncs/PA_Firmware/nrf/include -I/home/mutsl04176/ncs/PA_Firmware/nrf/tests/include -I/home/mutsl04176/ncs/PA_Firmware/modules/hal/cmsis/CMSIS/Core/Include -I/home/mutsl04176/ncs/PA_Firmware/modules/hal/nordic/nrfx -I/home/mutsl04176/ncs/PA_Firmware/modules/hal/nordic/nrfx/drivers/include -I/home/mutsl04176/ncs/PA_Firmware/modules/hal/nordic/nrfx/mdk -I/home/mutsl04176/ncs/PA_Firmware/zephyr/modules/hal_nordic/nrfx/. -Imodules/libmetal/libmetal/lib/include -I/home/mutsl04176/ncs/PA_Firmware/modules/lib/open-amp/open-amp/lib/include -I/home/mutsl04176/ncs/PA_Firmware/modules/lib/zcbor/include -I/home/mutsl04176/ncs/PA_Firmware/nrfxlib/softdevice_controller/include -isystem /home/mutsl04176/ncs/PA_Firmware/zephyr/lib/libc/minimal/include -isystem /home/mutsl04176/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem /home/mutsl04176/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem /home/mutsl04176/ncs/PA_Firmware/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros /home/mutsl04176/ncs/PA_Firmware/zephyr/samples/bluetooth/ua-ugw-ble-carrier-board/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs --sysroot=/home/mutsl04176/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/mutsl04176/ncs/PA_Firmware/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/mutsl04176/ncs/PA_Firmware/zephyr/samples/bluetooth/ua-ugw-ble-carrier-board=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/mutsl04176/ncs/PA_Firmware/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/mutsl04176/ncs/PA_Firmware=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
../src/main.c:12:10: fatal error: app_version.h: No such file or directory
   12 | #include <app_version.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
[32/318] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/mutsl04176/ncs/toolchains/1f9b40e71a/usr/local/bin/cmake --build /home/mutsl04176/ncs/PA_Firmware/zephyr/samples/bluetooth/ua-ugw-ble-carrier-board/build

The header file is also added to my main.c file : 

I am also making sure to sure the same toolchain version as that of the zephyr SDK version.

What could be the issue here? Is my application not able to find the app_version header file?

I am utilizing the Zephyr/nrf SDK version 2.4.1 (received from Laird for updated TX power setting rules: GitHub - LairdCP/bl5340pa_manifest: Manifest for the Laird Connectivity fork of the nRF Connect SDK with support for the BL5340PA).

Parents
  • Hi,

     

    This was a feature added in zephyr v3.5 (ncs v2.5 and newer). It is not present in ncs v2.4.1.

     

    1. Create the my_project/VERSION file, containing something like this:

    VERSION_MAJOR = 1
    VERSION_MINOR = 2
    PATCHLEVEL = 3
    VERSION_TWEAK = 4
    EXTRAVERSION = unstable

     

    2. Include app_version.h in your project, for instance in main.c

    3. configure your project (ie. add a new build)

     

    If you configure your project, then add the VERSION file, it will not be picked up by CMake/build system, so it is important that you re-generate your project.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    This was a feature added in zephyr v3.5 (ncs v2.5 and newer). It is not present in ncs v2.4.1.

     

    1. Create the my_project/VERSION file, containing something like this:

    VERSION_MAJOR = 1
    VERSION_MINOR = 2
    PATCHLEVEL = 3
    VERSION_TWEAK = 4
    EXTRAVERSION = unstable

     

    2. Include app_version.h in your project, for instance in main.c

    3. configure your project (ie. add a new build)

     

    If you configure your project, then add the VERSION file, it will not be picked up by CMake/build system, so it is important that you re-generate your project.

     

    Kind regards,

    Håkon

Children
Related