AnsweredAssumed Answered

Relocating function ( code ) from FLASH to RAM

Question asked by alemannia on May 12, 2011
Latest reply on May 12, 2011 by alemannia



My (custom) Blackfin BF537 board is configured to start execution directly from FLASH (ASYNC) memory after reset. The bootloader code executes a checksum function to verify the integrity of the firmware to be booted. This function takes a long time when running from FLASH. Is there a possibility ( in C ) to relocate this function into RAM before starting it? I know the u-Boot from ucLinux is doing some tricks like this but it's all in assembly.


All my L1 program memory is empty, so it should be enough to copy the function into 0xFFA00000 and make a function call. But...

1. How do I find out the size of the function?

2. What about relative vs. static addressing within the function code?

3. Do I need to adapt the .ldf file for this?


You see, I am a bit lost here and any suggestions are appreciated.