cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
6,478 Views
Registered: ‎05-28-2015

Troubles with isr and GPI interrupt on microblaze

Hi the forum,

 

I have problems with an isr on my project, it never runs. I have spent couple of day searching on the forum clues but nothing has helped.

 

here is the code without useless wrintings :

 

#include <stdio.h>
#include "platform.h"
#include "xparameters.h"
#include "xiomodule.h"
#include "xbasic_types.h"
#include "xil_cache.h"

u8 int_flag=0;

//interrupt servicing function
void gpi_isr(void);
void gpi_isr(void){
	int_flag=1;
	xil_printf("isr running.");//Just to debug
}
int main()
{

    init_platform();
    u16 num_rx_parameters =0;
    u32 data;
    u32 uDevId= XPAR_IOMODULE_0_DEVICE_ID;
    u8 uIntrId= XIN_IOMODULE_GPI_3_INTERRUPT_INTR;
    u32 del;
    u32 res_low,res_high;
    const int REQUIRED_PARAMETERS=4;

XIOModule iomodule;
	XIOModule_Initialize(&iomodule,uDevId);
	microblaze_register_handler(XIOModule_DeviceInterruptHandler,uDevId);
	XIOModule_Start(&iomodule);
	XIOModule_Connect(&iomodule,uIntrId,(XInterruptHandler)gpi_isr,uDevId);
	XIOModule_Enable(&iomodule,uIntrId);
	microblaze_enable_interrupts();
	int_flag=0;
// Need to call CfgInitialize to use UART Send and Recv functions
   int XIOModule_CfgInitialize(XIOModule *InstancePtr, XIOModule_Config *Config,u32 EffectiveAddr); 
  // note config and effective address arguments are not used
  data = XIOModule_CfgInitialize(&iomodule, NULL, 1);

     xil_printf("-------------------------------------------\n\r");
     while (1){
	 num_rx_parameters=0;
		while (num_rx_parameters< REQUIRED_PARAMETERS){
//in this part parameters are received from uart } while(int_flag==0){}; //exit loop when interrupt arrives // instruction to do when int_flag = 1 } cleanup_platform(); return 0; }

I realy can't see why the isr is not running. If anyone as any idea...

 

Thank you in advance for the help,

clmnt_lbrr

0 Kudos
1 Reply
Highlighted
Observer
Observer
6,421 Views
Registered: ‎05-28-2015

I have double check my code with this thread : link

 

I want to check if register of the ISR are right, how could I see them? I have search on the SDK a way but I only see work register (r<number>)

 

I have read that the memoru location of the branch instruction must be 0x10 in order to branch a interrupt to interrupt handling routine, where can I check this?

 

Thank you for your time,

clmnt_lbrr

0 Kudos