Paolo- Ziveri

Help on putting the code in SRAM - CW 5.9.0 for ColdFire

Discussion created by Paolo- Ziveri on Oct 31, 2008
Latest reply on Nov 24, 2008 by CrasyCat
Hi, I'm working on a project with the ColdFire 5235, in wich I try to put some code running in SRAM

I declared the code that I want in sram as follows

_declspec(text2)voidSupervisioneComandi(void)

 and I put the following lines on the .lcf file

.text :       // here I want to put the code in FLASH
{
___VECTOR_RAM = .
;
.= ___VECTOR_RAM +
0x400;
.= ALIGN(0x04);
*(.text)      

*(.init)      
*(.fini)      
*(.rodata) 

__START_DATA_ROM = .

} > ram1


// here I want to put the initialized data, the ROM values to initialize the data starts from __START_DATA_ROM 
.data: AT(__START_DATA_ROM)
{
___DATA_RAM = .
;
*(
.data)
___DATA_END = .
;

} > ram2


// here I want to put the sram code; the ROM image of that code will be immediatly after the initialization data

.text2 :  AT(__START_DATA_ROM + ___DATA_END - ___DATA_RAM)
{
___SRAM_START = .;
*(.text2)
___SRAM_END = .
;
} > sram

and this works.

My problem is, I have some other files, wich code I want also to run in SRAM, but they comes from a third-part graphic library, so I am unlikely to modify directly the source code.
Putting a line like this :

.text2 :  AT(__START_DATA_ROM + ___DATA_END - ___DATA_RAM)
{
___SRAM_START = .;

*(.text2)
gdisp.c (.text) 
___SRAM_END = .
;
} > sram

 doesn't work, because the file code of gdisp.c will be first captured in the ram1 section.

In the previous command-line based compiler, I do it directly by adding a switch when compiling , but in the CodeWarrior IDE, it is possible to assign some compilation switch only to a file?

Or, is there someone havings some other hints to do this operation?

Thank you

Stefano

Outcomes