Hi again,
I tried to reconstruct the problem with a small project, but I was not able to see the problem again.
Here is the code of my test project (I created the project with the CodeWarrior Wizard):
/* main.c */
#include <hidef.h> /* common defines and macros */
#include <mc9s12dp256.h> /* derivative information */
#pragma CODE_SEG USER1
char service1(char i);
#pragma CODE_SEG USER2
char service2(char i);
#pragma CODE_SEG DEFAULT
#pragma LINK_INFO DERIVATIVE "mc9s12dp256b"
void main(void)
{
/* put your own code here */
char i = 0;
EnableInterrupts;
for(;

{
i = service1(i);
} /* wait forever */
}
#pragma CODE_SEG USER1
char service1(char i)
{
return service2(i);
}
#pragma CODE_SEG USER2
char service2(char i)
{
return (++i);
}
#pragma CODE_SEG DEFAULT
/*.prm-File */
...
PLACEMENT
...
USER1 INTO PAGE_32;
USER2 INTO PAGE_31;
DEFAULT INTO PAGE_30;
...
The small program works as it should work, it calls service1() from main() (sets PPAGE from 30 to 32 and then calls service2() (sets PPAGE from 32 to 31) and then returns to main() (PPAGE = 30).
The only difference I found within the compiler-flags is a -D_HCS12 define (Compiler/Assembler) but adding this to my large Project didn't solve the problem. The datapage.c is identical in both projects. The start12.c is little bit different but I haven't found anything what could be the reason for my problems.
The assembly code of both projects is correct I think (in my big project there is a "call addr, page" instruction too) but the instructions behave different. So it can't be the datapage.c/start12.c, it must be something within uC config, am I right? What could be the reason for this? What prerequisites are needed to get the ppage switching to work?
Mario