how do I get image end address from linker?
MCU : STM32F411CEU6
Hello everyone. I have an application in which I want to get image end address from linker.
Here is a full context of what I want to do, I have a struct living in start of my image, which basically tells the bootloader usefull info, if bootloader want to inspect the image, the struct looks like this (BTW this struct is not yet implemented and this feature I made for when working with TI CC series so I am trying to replicate it for STM as well)
const imgHdr_t _imgHdr __attribute__((section( ".image_header"))) =
{
.imgID = OAD_IMG_ID_VAL,
.crc32 = DEFAULT_CRC,
.imgCpStat = DEFAULT_STATE, //!< Image copy status bytes */
.crcStat = DEFAULT_STATE, //!< CRC status */
.imgNo = 0x1, //!< Image number of 'image type' */
.imgVld = 0xFFFFFFFF, //!< In indicates if the current image in valid 0xff - valid, 0x00 invalid image */
.len = INVALID_LEN, //!< Image length in bytes. */
.softVer = SOFTWARE_VER, //!< Software version of the image */
.prgEntry = (uint32_t)&prgEntryAddr, //vector table entry
.imgEndAddr = (uint32_t)&flashEndAddr,
}
Now what I want to do is to give this struct the flashEndAddr when I compile my code.
And I am also interested in getting vector table size, so I can put this struct exactly after the vector table. Right now I am thinking of putting it before vector table and vector table will be placed with offset of this struct, but I am not sure if this is the right way. In TI it was after the vector table so I am bit confused in this as well.
you help or any suggestion is appreciated
thank you.
