I have a similar problem.
I am porting a code from Diab compiler to CodeWarrior 8.1 for MPC555.
because of some available external memory some data is being placed on that address space.
there are some differences the way #pragma section statement works between two compilers.
I was able to port the code that works as follows
#ifdef __MWERKS__ // Changes for Metrowerks port - EA - 07/01/03
#pragma push
#pragma section RW ".abs.00980040"
#pragma section ".abs.00980040" ".abs.00980040" data_mode=far_abs
__declspec(section ".abs.00980040") extern T_dhp_nv_data_struct dhp_nv_data_struct;
#pragma pop
#else //Orginal Diab is below
#pragma section DHP_NV_DATA_Sect far-absolute RW address=0x00980040
#pragma use_section DHP_NV_DATA_Sect dhp_nv_data_struct;
extern T_dhp_nv_data_struct dhp_nv_data_struct;
#endif
above metrowerks code works, it creates the variable at correct location. I had to fiddle around with different options to get this working. Since this code is in the .h file where it is declared, but the action memory is allocated in the .c file.
however Metrowerks way does not allow me to crated a named section with a given address like Diab statement. Is there a way to do it? I do not want to do it in the LCF file, since I would like this to also work in the debug version where .lcf is not used. I was able to get MW to create a named section, or create it at an absolute address, but not both together like Diab Does.
This is the first question.
second question is:
I am having trouble making interrupt vectors defined at an address
Diab code is as follows
---------------
#pragma interrupt InterruptHandler
#pragma interrupt InterruptHandler
#pragma section ProgSect address=0x940000
#pragma use_section ProgSect InterruptMachine
#pragma section ProgSectII address=0x940100
#pragma use_section ProgSectII InterruptHandler
----------
I checked the Metrowerks targeting manual but could not find a corresponding way to place Interrupt routines at certain address.
following statement defines interrupt routine but not at an address
__declspec(interrupt) void InterruptHandler()
or
#pragma interrupt on
void InterruptHandler(void)
{
myRoutine()
}
#pragma interrupt off
also Diab way first defines where the function will be placed and then function is declared later on, can you do that with CodeWarrior?
Cheers