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: 
Explorer
Explorer
6,124 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
Xilinx Employee
Xilinx Employee
6,117 Views
Registered: ‎08-06-2007

Re: MicroBlaze Exception Handling

Hi,

 

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

 

Göran

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

Re: MicroBlaze Exception Handling

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
Explorer
Explorer
5,847 Views
Registered: ‎02-17-2013

Arm Exception Handling and custo peripheral

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