aminpix
Advanced Member level 4
I am trying to develop a code to receive a a character through the serial port in interrupt fashion.
everything works except the code stop at Xil_ExceptionEnable();
when I enter a character, the rest of the code executes and everything works fine. When I upload the code into the Zynq FPGA, the Zynq execute all the command till reach this command, Xil_ExceptionEnable(). It will wait until I enter a character then the zynq execute the rest of the codes.
here is my code to initialise the interrupt:
everything works except the code stop at Xil_ExceptionEnable();
when I enter a character, the rest of the code executes and everything works fine. When I upload the code into the Zynq FPGA, the Zynq execute all the command till reach this command, Xil_ExceptionEnable(). It will wait until I enter a character then the zynq execute the rest of the codes.
here is my code to initialise the interrupt:
C++:
int GIC_Init(XUartPs *UartInstancePtr, XScuGic *IntcInstancePtr)
{
int Status;
XScuGic_Config *IntcConfig;
IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
if (NULL == IntcConfig) {
return XST_FAILURE;
}
Status = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
IntcConfig->CpuBaseAddress);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
(Xil_ExceptionHandler) XScuGic_InterruptHandler,
IntcInstancePtr);
Status = XScuGic_Connect(IntcInstancePtr, UART_INT_IRQ_ID,
(Xil_ExceptionHandler) UART_Handler,
(void *) UartInstancePtr);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
XScuGic_Enable(IntcInstancePtr, UART_INT_IRQ_ID);
Xil_ExceptionEnable();
return XST_SUCCESS;
Code: