Tool/software: TI C/C++ Compiler
Hi,
I'm having some issue with a project for TM320F2806x using C2000 compiler suite. This is about the USB library from TI.
I inherited a project using the TI USB library version 135. The library was included in the project by copy-pasting the source code files in the project folders and unfortunately modified to fit with the applications need. One major modification to solve enumeration issues was to use
#pragma CODE_SECTION(SetTxpsInfo,"ramfuncs");
to place critical functions to a "Run from RAM" section. This showed an improvement and solved the enumeration issues (see here)
Later on I had to update the library to V151. To do so I tried to keep it cleaner, so I included the .lib file instead of the sources and rewrite an interface to provide the desired functionalities without touching the source code of the library. I got something like this :
But doing so I cannot use the pragma to relocate functions to RAM anymore. So I tried to use a method from this forum (see here ) to obtain the same effect. This resulted in the following in my .cmd file :
ramfuncs : LOAD = FLASH_RFR, RUN = RAML4_5, LOAD_START(_RamfuncsLoadStart), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart), LOAD_SIZE(_RamfuncsLoadSize), PAGE = 0 { --library=usblib.lib (.text) }
Bad luck, there is not enough memory available and the linker tells me it now requires 3 times the memory required previously (using source code of library version 135). So it does not fit in anymore ...
So here are my questions :
* Is there a way to include the ".lib" and ask the compiler or linker to discard any unused high-level functions ? This would allow to place the remaining content of the library in the available memory space.
* Or is it possible to specify which functions or modules from the library should be place in the "Run from RAM" section ? From the thread mentioned above, It seems feasible to select .obj files but how do I now which one are included in the library and which one I need to relocate ... ?
For now I only have in mind the option of removing the .lib and link the source code directly in the project to be able to use pragma's like before. But it is a pain in the ... to update the library using such project configuration.
Thanks for any help. :)