UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar beandigital
Scholar
586 Views
Registered: ‎04-27-2010

Timer interrupt only works once

I have a design that uses the Zynq timer to generate a 1 second interrupt. This works fine once. But if I disconnect the debug, change the code, then start the debug again, it doesnt work. Is there something else I need to add? Thanks

 

	Gic_Config = XScuGic_LookupConfig(XPAR_PS7_SCUGIC_0_DEVICE_ID);
	Status = XScuGic_CfgInitialize(&my_Gic, Gic_Config, Gic_Config->CpuBaseAddress);

	Timer_Config = XScuTimer_LookupConfig(XPAR_PS7_SCUTIMER_0_DEVICE_ID);
	Status = XScuTimer_CfgInitialize(&my_Timer, Timer_Config, Timer_Config->BaseAddr);

	Xil_ExceptionInit();
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT, (Xil_ExceptionHandler)XScuGic_InterruptHandler, &my_Gic);
	Status = XScuGic_Connect(&my_Gic, XPAR_SCUTIMER_INTR, (Xil_ExceptionHandler)my_timer_interrupt_handler, (void *)&my_Timer);
	XScuGic_Enable(&my_Gic, XPAR_SCUTIMER_INTR);
	XScuTimer_EnableInterrupt(&my_Timer);
	Xil_ExceptionEnable();

	XScuTimer_LoadTimer(&my_Timer, XPAR_PS7_CORTEXA9_0_CPU_CLK_FREQ_HZ / 2);
	XScuTimer_EnableAutoReload(&my_Timer);
	XScuTimer_Start(&my_Timer);
0 Kudos
1 Reply
Highlighted
Moderator
Moderator
577 Views
Registered: ‎09-12-2007

Re: Timer interrupt only works once

If you restart the pl, without resetting the ps, then you may need to set the EOI during init. For example can you add the line in the interrupt init in your application Where XX is your interrupt ID

XScuGic_CPUWriteReg(&InterruptController, XSCUGIC_EOI_OFFSET, XX);

0 Kudos