Hello Ladislav,
You're right, I should've supplied more info. Here it is. The board I'm using is of my own design; it's simply a wall clock. The MC9S12C32 is connected via SPI to a M41T93 RTC, a New Haven LCD and a MAX7221 LED driver. Yes, the circuit was working before for some several months. The environment is Code Warrior and the programmer is a PE Microsystems USB Multilink.
The problem occurred when I was reprogramming the 9SC32; I think I removed the BDM cable too soon. Now there are no error messages of any kind when code is loaded; it appears to load normally. But now, when the new clock code is loaded, rather than the Source window in the Debugger screen going to the first line of code in the main program, like normal, I am in Start12.c code. When I attempt to run the code it doesn't run, but appears to be executing a few lines of assembler code before it stops when you watch the Assembly window. In the Assembly window all you see is BGND in each location. Also in the Command window I see an ILLEGAL_BP message.
One of the troubleshooting tests I did was to load a simple program to just toggle an I/O pin; this worked. The behavior of the IDE was normal. Further, I tested with some simple functions to initialize the LCD and show a cursor; this worked and again, the IDE behavior was normal. However as soon as code that uses a function with a parameter is inserted, like trying to write a string to the LCD with a function that gets passed a pointer, the unusual behavior described above is the result.
The processor always runs as evidenced by the signal on the Eclk pin.
I thought maybe as a result of the BDM cable being removed too soon that the part may have been "secured" even though I don't know how a secured part behaves. So I used a PE Micro tool to unsecure it. But it wasn't secured.
I hope you can help because sure am stuck.
Cheers,
Gordon