cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
digitalone
Explorer
Explorer
6,608 Views
Registered: ‎10-29-2008

MicroBlaze Exception Handling

I am using ISE/EDK 14.2 with a single MicroBlaze with a standalone project.

 

I have an issue where writting to a certain memory location from an interrupt is causing a delay in the interrupts output.  If I comment out that line of code the delay goes away.  The delay is about 14 microseconds long so it is way too long for it to just be the write time. I think it is hitting an error which is delaying it.

 

I would like to enable exceptions so I can determine the cause.

 

I have done the following:

 

	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				(Xil_ExceptionHandler)XIntc_InterruptHandler,
				&InterruptController);

	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_FIRST,             My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_FIRST);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_FSL,               My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_FSL);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_UNALIGNED_ACCESS,  My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_UNALIGNED_ACCESS);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_ILLEGAL_OPCODE,    My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_ILLEGAL_OPCODE);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_M_AXI_I_EXCEPTION, My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_M_AXI_I_EXCEPTION);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IPLB_EXCEPTION,    My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_IPLB_EXCEPTION);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_M_AXI_D_EXCEPTION, My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_M_AXI_D_EXCEPTION);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_DPLB_EXCEPTION,    My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_DPLB_EXCEPTION);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_DIV_BY_ZERO,       My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_DIV_BY_ZERO);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_FPU,               My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_FPU);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_STACK_VIOLATION,   My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_STACK_VIOLATION);
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_MMU,               My_ExceptionHandler, (void*)XIL_EXCEPTION_ID_MMU);

	/*
	 * Enable exceptions.
	 */
	Xil_ExceptionEnable();

 and in my BSP I have set "microblaze_exceptions" to true.

 

I tried testing it by putting a divide by zero, but my exception handler is not getting called.

 

What am I missing?

 

Thanks.

0 Kudos
3 Replies
goran
Xilinx Employee
Xilinx Employee
6,601 Views
Registered: ‎08-06-2007

Hi,

 

Have you configured the MicroBlaze core to implement all those exceptions?

 

Göran

0 Kudos
digitalone
Explorer
Explorer
6,594 Views
Registered: ‎10-29-2008

No, I did not.

 

So I need to use XPS to enable these?

 

I would guess this would increase the logic usage then correct?

 

If I enable them in XPS, what else do I need to do in SDK for example to enable them?

 

Thanks.

0 Kudos
tibacou
Explorer
Explorer
6,331 Views
Registered: ‎02-17-2013

Hey 

I search example of application in c language who use a custom peripheral in interruption. The Ip does'nt use the Axi gpio 

0 Kudos