• Resolved

How to load math libraries from flash into RAM after reset and power cycle?


I am fairly new to this, so please excuse any ignorant or seemingly stupid questions - I am still learning here (so be gentle!)  

I have built an application on an F28335 eval kit.  I have built my system to boot from flash, and then I want to move a lot of the time critical routines into RAM.  I have managed to do that following the examples and documentation with no significant problems.

 However, as part of this, I also need to put the math libraries into RAM for quicker execution as well.  I have found the way to do that in the linker file is doing something like:

.rts  { -lrts2800_fpu32.lib (.tex) }  >> RAML3,   PAGE = 0

This works great for the initial running of the system, and everything runs fine when I start the application from the debugger.  However, when I power cycle the device, I would like it to immediately boot from flash, and begin running again (after re-initializing RAM properly).  However, that is not the case because of the math library.

I move my own code sections into RAM using the memcopy command like is specified in the documentation - I do this as part of the init routine.  It looks something like this:

(in linker file):

   ramfuncs            : LOAD = FLASHD, 
PAGE = 0

(in init code):
&RamfuncsLoadEnd - &RamfuncsLoadStart);

However, I cannot figure out how to move the library into RAM at run time in a similar manner.

So my question is how would I affect the same copy from flash and into RAM after a reset or power cycle of the linked in library routines?   What is normally done about things
like this?  If I leave the math library in flash and do not move it to RAM in the linker file, everything works splendidly and will come back after the power cycle.  I just cannot have
the performance impact that this causes, so I need to move the libraries into RAM.

Any help or suggestions would be greatly appreciated!  Thanks!


  • Hi Jeff,

    Im not sure(Im still looking) if there is a way to do this with the RTS library but if you are looking for faster math routines may I suggest using the FPUfastRTS library. You can find it in controlSUITE (www.ti.com/controlSUITE) under c:\ti\controlSUITE\libs\math\FPUfastRTS



  • In reply to Vishal_Coelho:

    This post may help:-


  • In reply to Paul Raine:

    Hi Paul,

    Thanks do much for the followup and suggestion.  I actually found that I could load the functions into RAM during the boot phase so that the copying and linking were unnecessary.

    I simply loaded in the file DSP28xxx_SectionCopy_nonBIOS.asm, and then during the code_start section in  DSP2833x_CodeStartBranch.asm,, instead of jumping directly to _c_int00 to start running, I call out to copy_sections, where I just copy the math directly to RAM.  After that I jump to _c_int00, and let it run from there.  Now there is no need for any subsequent copy, as it is all done during boot.

    Thanks for the suggestion though!