My question is regarding to the ldr file generated in my application. The challenge is to write some values in the ldr file on a define address.
Anyone can please help me with this question?
I want to write a value for example "14.04.2020" to address 0x10 in ldr file. Then I would to check the ldr file at address 0x10 to find the value.
Ah, smaller variables get collected into bss data blocks and that wouldn't allow absolute placement of a variable within such a block. If you put #pragma symbolic_ref before the variable definition that…
120 viewers and no one can answer the question?!
Do you mean that you want to change a LDR file rather than change and rebuild the application?
Editing the LDR image itself is not recommended nor supported. If you overwrite the content of the tools-generated LDR file, you will be corrupting the boot image that is guaranteed to be accurate by virtue of being generated appropriately by the tool chain. I realize the date string you provided is just an example of what you wish to do, but I will use it to formulate the response. Whether or not you have full confidence that this date string is the very first piece of payload data (immediately after the block 0 header at offset 0x10) AND is the exact same size as whatever data elements you are replacing, it is recommended to change the string in the source code and rebuild the project such that the LDR file is correct for the modified application. If you absolutely want to manually modify your LDR file, then you'd need to edit the binary image directly. However, there is no guarantee that the application will function properly if the LDR image is post-modified in this fashion.
I don't want to change the LDR file manually. I mean, I want to write some values on an address, where I can find the value in the LDR file that has been generated.
In my application I write this:
const char data = "some useful stuff";
memcpy((char *)0x8000010, data, sizeof (data));
but when I look at the ldr file at address 0x800010, the values is not written.