03-28-2012 12:09 PM
Im running the xilkernel, and trying to get an interrupt to occure at a regular 1/4 ms.
Majority of the time it runs ok, however sometimes it is delayed a little bit.
This causes signal processing problems.
The maximum time for the interrupt is well under the 1/4ms time limit, and the average time it runs is very small.
(gdb) p max_tracking_timer
$38 = 0.00013711536303162575
(gdb) p avg_tracking_time
$39 = 3.282309745553627e-005
The time inbetween my interrupt however is sometimes much greater than the 1/4ms interival.
(gdb) p max_between_time
$40 = 0.00039486680179834366 <- This number should always be around .00025
(gdb) p avg_between_time
$41 = 0.00025274289338876631
My code isn't locking out interrupts, unless the xilkernel is.
Also I noticed that the interrupt uses the IRQ stack, so this probably means the timing interrupt timer1, and os timer interrupt(timer 0) are somehow locking interrupts to prevent stack corruption.
Was wondering where the vector table code was. Can I preempt the os timer interrupt with mine if I make some assembly code to define my own stack?
I moved the irq stack into the interal ram thinking that would fix the problem. False.
Anyhow here is how I am starting up the interrupt. Couldn't get the xilkernel register_interrupt, and enable_interrupt to work.
// Driver instances
static XTmrCtr myTimer;
extern XIntc sys_intc;
/* Set options: auto-reload, down count, enable interrupts */
XTmrCtr_SetOptions(&myTimer,0,XTC_INT_MODE_OPTION | XTC_DOWN_COUNT_OPTION | XTC_AUTO_RELOAD_OPTION);
/* Set handler for interrupt to run when timer expires */
XTmrCtr_SetResetValue(&myTimer, 0, 25000/2); //Not sure why this needs to 25000/2 were using a 100MHz clock, want .00025 s intervals
XIntc_Connect(&sys_intc, XPAR_XPS_INTC_0_XPS_TIMER_1_INTERRUPT_INTR, XTmrCtr_InterruptHandler,&myTimer);
/********* Start the timer ***************************************************/
/* Enable the interrupt controller */
printf("Launching application threads\n");
void my_timer_int_handler(void *CallBackRef, Xuint8 TmrCtrNumber)
//My timing information is done in here, so unless the OS is taking a super long time, we should be meeting timing.
Should I make my own interrupt vector and share data via a global to a xilinx thread?
Would that even preempt the os timer?
03-28-2012 06:04 PM
I'm not sure what the correct format is but make sure you are using the correct interrupt functions with the kernel because they are different.
What is the priority of the interrupt in EDK? Could it be at a lower level?
03-29-2012 09:02 AM
03-29-2012 09:45 AM
07-12-2015 04:26 AM
I have similiar issue in which the interrupt test fails with xilkernel bsp, and succeeded standalone bsp.
Is there any idea what can cause such behaviour ?