Hi,
i am working on XMC4500. i want to Implement Self Flashing i.e., the Controller Flash itself, Till now the code is Running from Flash. To Achive this one approach is if i Execute code from RAM Then flash Remains Free So that i Could Download the Code into Flash and Run it. Here my doubt is Can i Run the Code from RAM if so how could i achieve this ??
Thanks and Regards,
Harshan.
Hi Harshan,
Simply assign the base address to program counter is incorrect as the LSB is 0 and this means trying to switch to ARM state (if you are using BX/BLX instruction to branch there).
I don’t know the base address for the PSRAM in your chip. Assume it is 0x20008000, you can use the instruction sequence:
LDR R0, =0x20008001 /* Note that LSB is 1 */
BX R0 /* Branch to the address, you can also use BLX if the code need to return */
In C you can try using function pointer to call a function in certain address.
But of course you need to make sure you have the image loaded correctly in the PSRAM in the first place.
I am sorry I don’t have example of linker script for this.
Also, the exact details depends on how you compile the code. If the code in PSRAM being compiled separately? (this is the typical arrangement).
The flash programming part might be already available in the pre-loaded firmware (in NXP they call it In-Application Programmable – IAP).
I don’t know if this is the same for Infineon.
Regards,
Joseph
Thanks for Reply Sir,
i got reply from infineon forum, here the link is XMC4500 Running Code from PSRAM??