Using the VERSION file

Hi! I am currently working on updating our code to comply with SDK version 2.5.1. When it comes to using the VERSION file i'm getting confused. First of all, why is VERSION_TWEAK or EXTRAVERSION not defined in app_version.h? APPVERSION and APP_VERSION_STRING is constructed differently and APP_BUILD_VERSION why is this an string (unquoted) ? 

From what i'm seeing the resulting CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION is constructed as VERSION_MAJOR.VERSION_MINOR.VERSION_PATCHLEVEL+VERSION_TWEAK but the APP_VERSION_STRING defined in app_version.h is constructed as VERSION_MAJOR.VERSION_MINOR.VERSION_PATCHLEVEL-EXTRAVERSION. Am i missing something here or is this considered as work in progress ? 

Regards 

Anton

Parents
  • Hi Anton,

    I have looked into the VERSION file feature. It was initially a feature that is meant for the versioning and header file generation for the entire Zephyr RTOS rather than an application. It was generalized and expanded for application versioning use in commit 2c757f and 99064c.

    If I understand correctly, the generated content in app_version.h to be just a direct port of version.h, without any specific usage intended yet.

    At the very least, as of NCS 2.5.1, I have confirmed that it doesn't factor into DFU or image management at all. The DFU solution still works based on CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION. If you need access to that value in the current build, you can just access CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION directly. See: Firmware updates — nRF Connect SDK 2.5.1 documentation (nordicsemi.com).

    It is recommended that you don't configure CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION directly. You should keep it unconfigured and use the VERSION file instead; it will defaulted to the value you have found.

    As for the EXTRAVERSION field, my understanding is that it is a remnant from the kernel versioning, and not directly relevant here.

    Hieu

  • Hi Hieu, thank you for your time and your answer! 

    I managed to get everything to work fine using the VERSION file, i was just confused to why it seemed non consistent, for example, i needed to get TWEAK_VERSION in my code and i ended up having to define a variable in CMakeLists.txt since it is available there and not in app_version.h. Another example is, lets say i for some reason needs to access the EXTRA_VERSION, it's not possible from what i can see. 

    Regards 

    Anton

  • Hi Anton,

    You are right about needing some workaround to get access to TWEAK_VERSION and EXTRA_VERSION. They are just not directly accessible.

    I imagine an alternative to getting TWEAK_VERSION via CMakeLists.txt is to derive them by processing the strings that include them in app_version.h.

    However, I don't feel like they are often relevant for the application. What use do you have in mind for them, if I may ask?

    Regards,

    Hieu

Reply Children
Related