|
Hi all,
I'm working on a selfmade board with many IOs. A SAM7X512 will be the brain in the middle. Getting commands via CAN and setting PWM, IO, Analog-Out, stepper control and so on. For this functionality I need several nested interrupts.
Here some information: I use the µVision4 IDE (didn't get the Yagarto/Eclipse/J-Link stuff to flash/debug the sam7x) with the Atmel AT91Lib. I started my code with a Atmel AT91Lib example for Keil. The board_cstartup_keil.s explicitly says, it supports nested interrupts. My code is C++ with many static classes, using the C-functions from the AT91Lib via extern "C".
And here is my problem: At the moment, I have 2 interrupts enabled. CAN-event-handler and 10ms-PIT. When both are having the same priority (== no nesting), everything works fine. When the CAN gets a higher priority, the core hangs up here and then (few seconds to minutes). Debugger says: Mode: undefined, PC points to 0x4 (undefVector). When stepping through the code, this happens when returning from a function that's called from a interrupt handler.
So my idea is, that there is a problem with the return-address when trying to return to the calling interrupt handler function. Any idea how to solve this? If you need more info, just tell me.
Greetings from Germany, Thomas
|