RLP and interrupt handlers

I’m busy pin-pointing issues I have with the debugger on EMX in combination with RLP on latest 4.1 release.

I have a simple application that calls a Init() method in RLP. That Init method configures TIMER3 to overflow at 1khz and installs an interrupt handler for that timer:

RLPext->Interrupt.Install(TIMER3_INT, Timer3Isr, NULL)

When I run the project, it deploys and runs. When I hit stop, the debugger stops. When I press run, debugger hangs in “Rebooting” phase, I need to reset my board.

Now, if I just comment out that one line

RLPext->Interrupt.Install(TIMER3_INT, Timer3Isr, NULL)

.

I can run, stop, run as much as I want…

So question: Why does installing an interrupt lock up? Is TIMER3 in use by something else in the core? Or is it because my interrupt handler doesn’t clear some flag?

The interrupt handler contains this code in order to clear the interrupt flag:


DWORD n = T3IR;
T3IR = n;

I also tried with and without “VICVectAddr = 0;”,

Any ideas?

Obviously nobody knows the anser, or my question is too long. I’ll try to ask a shorter one:

Why can’t Visual Studio reboot my board if there is a timer with interrupt running in RLP at 1000Hz?

WouterH,

My guess would be either a coding error or your ISR is trapped in a fast loop

If I toggle a pin in the ISR, it’s toggled at 1000hz.
I’ve seen that, when I disable the timer before stopping the debugger, I can redeploy without problems. So VS can’t reboot the device when there is a timer running with interrupt attached.

So additional question: can I detect that debugging is stopped from RLP?

@ WouterH - GHI may need to give you a definitive answer, but having a good read of chapter 33 realMonitor page 663,( in my user manual) may help.

EDIT: Sorry its chapter 35 page 748.

But works if fewer interrupts?

1 Like

Good idea.

Will try this when I get back home.

You may want to follow this code and see how it works underneath … this is what i use from the Managed side to detect if a Debugger is Attached:


if (System.Diagnostics.Debugger.IsAttached){
 debug.Print("Debugger is attached");
}

1 Like

@ Jay Jay - Great, so I should be able to look that up in the sources.

Let us know what you dig up Please …

thanks