Hello,
I am using the OMAP-L138 (DSP C6748) on a custom board, and the CCS5.1 IDE to debug and develop code. My DSP compiler version is 7.3.1. I have not been able to get the linker-generated copy tables described in SPRU186V, section 7.8 to work as I expected. I am working on a multiple stage boot-loader that is able to call several stages of application code. I have a small AIS image in flash that only sets the PINMUX registers and jumps to the ARM boot code image. The ARM boot image only wakes the DSP and jumps to the first DSP image. DSP Image 1performs all the necessary hardware initialization and jumps again to application code. This is all working fine using the monolithic, instruction dump binary images generated from the respective ARM and DSP compiler tools with the "-b" option. This has allowed me to develop chained modules of complete programs that simply jump to the next image in the chain when finished processing.
The problem comes when I try to store code in flash that moves itself to RAM to run. I need everything out of flash in case I need to write to it. Using the "load" and "run" linker command options works partially, until I have data in the .const section. If I have constant values, the linker doesn't know how to move this section to RAM. If I don't move it to RAM, as soon as I try to read flash status, I will loose access to these constants, as the flash status is read at every address once the command is given.
The linker documentation states that a copy table could be used to move code from flash to RAM. I only need to move the .text and .const sections (I think) since all other uninitialized sections are already linked into the shared RAM. From a maintainability standpoint, it would be ideal if the copy table functionality were contained fully within the application images that need if instead of having a separate main that would need to be re-linked if the image it was copying was changed.
It is possible to setup the linker command file to create a copy table for this entire application except for the copy table functionality? Meaning, can I have my main function call a subroutine to copy the table data using the linker symbols, or do I have to make a separate application?
Using the copy table also generates the LOAD placement warning for the .text and .const sections. Is there any way to build this application into a boot object, and link that entire object to move from flash to RAM? I have not had any success in using the object created with the -boot option for further linking.
I tried following the general steps in "Combining Executable Files For ROMing", an application note proposal from 2008, reproduced on the Wiki below.
http://processors.wiki.ti.com/index.php/Combining_executable_files
I have not had success with this method yet, as I am still unclear as to whether the boot code needs its own main, and which symbols are carried over from the application object for this secondary link step. I will investigate this further first.
The next step I need to try is to turn off all caching by the DSP. I think this has been the reason for my limited and inconsistent success with run/load sections, as this seems to work with small programs, but not the main application code.
Any further, specific examples or advice on how the DSP interprets copy tables or boot copy tables, would be greatly appreciated.
-Kaitlyn