Dear all;
I need to copy the data that from the flash special address to the RAM adress which is special;before project start running;
thanks for supply the sample code;
Here I have described how it is possible to relocate code to the RAM:
https://community.freescale.com/thread/386638
Similar approach can be used with data as well but
- variable is already located in RAM whilst its default value is being loaded from flash during init, thus I don’t see any reason for relocation
int i = 10;
- if you need specific alignment, use pragma aligned like this (aligns to 8 bytes)
vuint32_t test[2] __attribute__ ((aligned (8))) =
{
0xBABADEDA,
0xABBAABBA
};
- if you really need to access specific address, you can do it as follows where 0x40000000 specifies address (don’t forget to reserve space in linker command file) for this accesses:
*(unsigned int*)0x40000000 = 0x44444444;