Retrieve MCUBoot version from main application

Hi,

I'm trying to retrieve the MCUBoot version inside my application (from the VERSION file).

In the Zephyr documentation (docs.zephyrproject.org/.../index.html), I found that I can access app_version.h (located in /app/build/app/zephyr/include/generated/app_version.h).

A similar file exists in the MCUBoot build folder (/app/build/mcuboot/zephyr/include/generated/app_version.h).

I'm facing two problems:
1) I can't find a way to include the MCUBoot app_version.h file in my code.
2) Assuming I can include it, it uses the same macro names as the application. In my code, I need to use both the application version and the MCUBoot version. How can I modify the macro names generated for MCUBoot to avoid conflicts?

thanks

Parents Reply Children
  • because i want to know what is the version of mcuboot. not the version i declare it is.
    the CONFIG_FW_INFO_FIRMWARE_VERSION value can be set to be 300 if i want, but it wont let me know that a real new MCUBoot version is out.

    as i said, in my code i perform DFU to upgrade the mcuboot. but to do that i need to know that the version was changed.

    The usage of FW Info was an attempt to grab this data, but as long as im digging into the mcuboot versioning i see that the VERSION file info is not embedded into the binary file! 

  • Udi Vahaba said:
    because i want to know what is the version of mcuboot.

    But why?

    If you build your project, you are free to set both MCUboot version and FW_INFO version right?

    In this case you can make sure FW_INFO mathces MCUboot version, and the product should work the same right?

    From what I know, we decided to use FW_INFO instead of the Zephyr version of MCUboot when adding the feature for updatable bootloaders and therefore we have not implemented any way of reading MCUboot version. This is why I recommend FW_INFO.

    I am maybe a bit difficult here, but knowing the use-case to why you need this version will help me best help you in finding the best solution

  • Hi Sigurd, i'm Eyal, the TL of Udi who opened the ticket.
    The "running sequence number" is indeed something we will use for FOTA, but still we want to be able to send the version number of the mcu boot. the version number is not the sequence number that we decide on in the  CONFIG_FW_INFO_FIRMWARE_VERSION we set ourselves but the VERSION file that resides in the mcuboot repo.
    The way zephyr works, that file is integrated into the mcuboot binary (s1\s0 if build or just s0 if not dual boot).
    We cannot find that data in the binary, we are asking why and where can we find it cause not finding it means something is wrong.
    Please refer to the question and not the scenario.

    Thanks,

    Eyal.

Related