AM62Ax MCU+ SDK  10.01.00
Software version check for appImage

Introduction

The RPRC image of user defined appImage are marked with SW version, this version is passed into RPRC generation script 'tools/boot/out2rprc/elf2rprc.js", through the makefile. The SOFTWARE VERSION is defined in imports.mak. If the software version doesn't match, the bootloader doesn't load the appImage.

Steps to check software version?

  • Define software version in the imports.mak, the software version is defined in 32 bit hex value. For example, version number 10.01.00.00 is defined as 0x0A010000, 0x0A for 10, 0x01 for 1 and 0x00s for 0s in the version number.
    SW_VERSION=0x0A010000

  • Pass the software version argument to the RPRC generation command in the makefile, the software version is written is passed to the version field in the rprc header section, (refer Out2RPRC section in Booting Tools for more info)
    $(OUTRPRC_CMD) $(OUTNAME) $(SW_VERSION)>> $(BOOTIMAGE_TEMP_OUT_FILE)

  • Pass the software version argument to the bootloader file through the library makefile.
    -DSW_VERSION=$(SW_VERSION)

  • The software version is checked in the api Bootloader_rprcImageLoad presnt in the file source/drivers/bootloader/bootloader.c
    if(header.magic != (uint32_t)BOOTLOADER_RPRC_MAGIC_NUMBER || header.version != SW_VERSION)
    {
    status = SystemP_FAILURE;
    }