we have a problem to get right interrupts while BDM debugging when the vector table is relocated into RAM.
The interrupts seems to be eaten somewhere.
Reading the MC9S12XDP512 Data Sheet, Rev. 2.15 on the page 601 there is sentence: "Note: If the BDM is active (i.e., the CPU is in the process of executing BDM firmware code), the contents of IVBR are ignored and the upper byte of the vector address is fixed as “0xFF”.
My question is : How to get the relocated interrupt vectors running when a BDM debugger is used?
When S12X interrupts stop working you should check the contents of CPU CCH register. If it is not reset-default IPL==0, then interrupts with too low priority will be "eaten". This can occur for example if you stop program in ISR and adjust PC to restart program, or if you load new program to RAM. Your debugger can or can not reset CPU after download and you should check it.
I just tried to do simple RTI handler in RAM and vectors in RAM. It works with BDM connected. I can place breakpoints where I want and it all works as expected. So I don't know what Alban is talking about. Active BDM is exactly when CPU executes hidden BDM firmware. When you hit run button or step over a C line - CPU exits active BDM to execute your code and IVBR becomes active. You stop the target or target stops on breakpoint and IVBR according to datasheet becomes ignored again.
The way to relocate the vectors is to change IVBR. When you connect the BDM, the IVBR is ignored. So when BDM is connected, vectors are located like out of reset.