2019-06-12 04:11 AM
Is there any specific address location in generated binary file so we can know the size of that binary file?
Using this, in the firmware to read the size of binary file from that location and use it in our application.
Solved! Go to Solution.
2019-06-12 08:24 PM
@Community member Is there any resource where I can find all those symbol list which we will use in startup file like"_limit_flash"?
2019-06-13 09:11 AM
The linker generates a .MAP file, I'd expect it to appear in there.
I generated it as a means to demonstrate how one uses linker scripts, the file itself reflects the use of several similar concepts in defining and placing the statics which are copied into RAM by the startup code. I'm not using GNU/GCC on a daily basis, but I can usually get things to work with a little trial and error and reviewing available documentation.
Most of this stuff should come from an understanding of Compilers, Assemblers, Linker and Loaders..
2019-06-13 07:24 PM
I am not too much expertise in all these concept but I will try my best to understand it.
Yes, it is available in .map file but it will generate once the compilation done.
So, before all that we have to know the symbols which will useful to add in the startup(.s) and linker(.ld) file. Where it is present? Is it in the GCC-IDE(Atollic TrueStudio) installation files?
2019-07-01 08:32 PM
@Community member Here one problem is found. When my binary size is greater then 65KB it will not give me the proper size. In every case, when I am checking the binary size and read, it is giving me the first two byte is 0x0802 every time and last two bytes is size.
Attached snapshot of example, my binary size is 119468 bytes(0x1D2AC). When I am read from ST-LINK it is showing 0x0802D2AC.
Why it is added 0x0802 in every binary? Can you please provide me the solution for this?
2019-07-02 02:14 AM
Can someone have an idea about this?
2019-07-02 11:49 PM
@Community member Can you provide the feedback on this? We specify the "_limit_flash" as ".word" in startup file. So, Why it is store the 0x0802 (two bytes) every time in flash instead of storing the 4 bytes length of binary?
2019-07-03 05:35 AM
It is storing the end address, or limit, of the firmware image, for the length you'll clearly need to deference it from the base address of the image.
You can probably use existing symbols to do the math, the base of the vector table for instance.
2019-07-03 05:59 AM
@Community member I tried it with de referencing it. But not got the success. Please help me to do this. How it is end address storing? 0x0802 is not an address of any location.
2019-07-03 06:07 AM
All your other vector addresses are in the 0x08020000+ range, it is within the FLASH memory region.
/* End section */
. = ALIGN(4);
.endof :
{
/* This is used by the startup in order to find the end */
_limit_flash = .; /* define a global symbol at the end of flash */
_flash_size = _limit_flash - g_pfnVectors; /* compute length based on beginning and ending points */
} >FLASH
2019-07-03 08:34 PM
@Community member As per your given above solution, I added "_flash_size = _limit_flash - g_pfnVectors;" this specific line into linker file but still it is not working. Is it require to configure some other things which I have missed? What should require to do here?