Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,349 Views

MCI Interrupt issue

I have written the MCI driver with interrupt routine in Ecos but the interrupt is not getting enable. i have used eCos API to create interrupt. 

 

cyg_drv_interrupt_create(vector, //vector 

0, // priority 

0, 

&mci_lpc24xx_isr, //isr routine 

&mci_lpc24xx_dsr, // dsr routine 

&handle, // handle 

&interrupt // interrupt handle 

); 

 

cyg_drv_interrupt_attach(handle); 

cyg_drv_interrupt_unmask(vector); 

 

do i have to make some changes in ecos files since, this MCI related drivers are not there in the packages provided by ecos.  

 

please let me know if there is any change or modification required in any of the ecos files etc.. 

Is there any settings that need to be done in kernel/ HAL related files?
0 Kudos
7 Replies
Altera_Forum
Honored Contributor I
38 Views

no as far as I remember you did everything you needed to handle the interrupt. 

Are you sure you are using the right vector number? 

Are you sure the hardware is generating an interrupt? 

How do you check that the isr/dsr are actually called? You can only use a limited API in those routines. The ISR needs to return a special value if you want the DSR to run.
Altera_Forum
Honored Contributor I
38 Views

yes the vector no is proper. I have refer the ISR & DSR routine from the avialable packages like CAN & SPI but it still it is not working. I have checked by updating the value of a variable in ISR routine but the value is not updated. also i tried to use HAL functions but still not working. also it is not mentioned in any of the document about the interrupt for the drivers apart from the packages available. 

 

Please let me know if there exist any sample ode for the same or other peripheral so that i can get an idea about the code. also if there is any link apart from the Ecos document like Reference manual & Missa which wil give me some prioper information about the interrupt handling process. 

 

It is very important for me since i m struggling to use the interrupt in Ecos.
Altera_Forum
Honored Contributor I
38 Views

The eCos documentation is rather poor, the best way is to read the code from other drivers, as you did. 

Ensure that the variable you change in the isr is declared as volatile, to be sure that the compiler doesn't add optimisations that would make the variable read fail. Did you check with signaltap that the interrupt was actually fired? 

Did you check the return values of cyg_drv_interrupt_create, cyg_drv_interrupt_attach and cyg_drv_interrupt_unmask?
Altera_Forum
Honored Contributor I
38 Views

Yes Daixiwen 

 

I have checked the variable is volatile. but the cyg_interrupt_create function returns void, so not possible to know the status. also the interrupt will be generated while transferring the data like a serial port but its not happening. 

 

do you have any other possible solution or any sample code for the same then please let me know... 

 

i am trying in some other ways by understanding the existing drivers but it seems very critical also not able to understand, 

 

Thank you
Altera_Forum
Honored Contributor I
38 Views

Are there any registers in the component that you need to write to to enable the interrupt? Are you sure it is done? Did you check the irq signal with Signaltap?

Altera_Forum
Honored Contributor I
38 Views

hi Daixiwen 

 

I check but there is no such settings . Is there any way to register the interrupts in Vector.s or any other file so that the interrupt ISR & DSR can be added.  

 

I tried to find out for the sample code but unable to find .. 

 

please let me know if it is possible or any such sample code is available.
Altera_Forum
Honored Contributor I
38 Views

No as far as I know you need to go through those functions to use the eCos ISR infrastructure. 

Did you check the irq signal with Signaltap?
Reply