Using the STR912, I am using several different interrupts (usb, uart, timer and wiu) all of the irq handled as VIC (vectored) with different priorities (2->6). It happens that something my firmware hangs and I think is because once I get inside a interrupt the IRQ are disabled (according with the datasheet) and if other IRQ occurs during this time my program crashes ... no Undefined_Handler IRQ, no Abort_Handler IRQ ... nothing. The expected behavior is that if not working with nested interrupts the execution should finish the execution of the actual interrupt and then switch for the next one, even if an interrupt occurs during the execution of the previous (atomic execution), right? Someone has an idea what can possibly be?
This is basically how I use the IRQ handlers:
void TIM1_IRQHandler(void) { // Clear TIM1 counter TIM_CounterCmd(TIM1, TIM_CLEAR); // Clear TIM1 flag OC1 TIM_ClearFlag(TIM1,TIM_FLAG_OC1); // whatever I want VIC0->VAR = 0xFF; }
r u using ulink2 debugger while running the program? do u use any SWI?
Thanks for the answers.
To Software Engineer, I am using the j-link to debug while running the program and I don't use any SWI.
Tamir: is not a stack overflow for sure.
I don't use any FIQ .. I am aware of the priorities.
no error/warnings My problem is if I try to delay the execution inside a interrupt in order to test the priorities, the program hangs. If I execute my program normally with the usb/uart/timer interrupts and execution with no delay everything works fine. What I did was to simply insert a delay inside the interrupt to see what happens if I trigger another interrupt, and after 3 tries the program crashes ... no more interrupts! no default irq nor abort irq, nothing ... and for me this is strange.
Thanks a lot for your attention.
I once saw a document written by either ST or NXP to explain what happens in such a situation. I don't have time to look now, but I will next week if you don't find it!
i just guess it may be the problem of the debugger, which occupy one interrupt routine( seems SWI). while u delay and mcu no feedback to debugger host via JTAG. it seems crash in host, saying,can't keep in sync with the mcu status on board.
so u can build the hex file and program into board.Directly test on board without the debugger.
I have been trying several things including the download and not using the debugger without success. I have a TIMER interrupt with a while inside of 5 seconds and I call an UART interrupt through the hyperterminal, it happens that now the UART doesn't even occurs anymore. The UART interrupt is priority 4 and TIMER 5, how can this happen?
Thanks for your help.