Hi, I'm using the DM6437 here.
I'm setting up a simple ISR to handle I2C interrupts. I've used DSP/BIOS to set up the interrupt using the dispatcher:
bios.HWI.instance("HWI_INT6").interruptSelectNumber = 83;
bios.HWI.instance("HWI_INT6").fxn = prog.extern("I2CIsr__Fv");
bios.HWI.instance("HWI_INT6").useDispatcher = 1;
bios.HWI.instance("HWI_INT6").interruptMask = "all";
My ISR (does nothing at the moment except check the I2C interrupt type):
void I2CIsr(void)
{
unsigned int I2CIntVec; // I2C interrupt vector register
// get I2C interrupt status
g_RegRead = ICSTR_R;
I2CIntVec = ICIVR_R;
}
I enable the interrupt a thread that loops, doing the main work of the program:
int MainLoop()
{
//setup ...
// enable interrupt 6
C64_enableIER(C64_EINT6);
// main loop
while (1)
m_Manager.RuntimeUpdates();
}
The I2C interrupt fires, the ISR runs OK, but when it exits the CPU either:
* resets to c_int00 through HWI_Obj HWI_RESET (I stepped through)
* stops at the end of the ISR
* jumps somewhere seemingly random with corrupted context (this has only happened once so far)
A possible problem: I'm using NDK 2.00 which is running in the background. NDK has it's own running thread (s?) and uses a CLK_F_isr on INT14.
I'm not sure where to start here to narrow this down. I'd love to get your ideas about the probable cause. I've read that the BIOS dispatcher is supposed to handle HWI_enter / exit in order to save and restore the ISR calling context, but it looks like something is going wrong with that.
Thanks for considering my problem. Please let me know if I can supply added information that would clarify.
- Craig
Some system details if they help:
CCS 3.3.82.13 SR12
BIOS 5.41.11.38
CGTools 7.0.4
Coding in C++