How to disable IRQ7?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to disable IRQ7?

Jump to solution
1,050 Views
oscar
Contributor I

Hi,

I read that IRQ7 can't be masked in MQX because of priority (level 7). I tried to use this IRQ7 but it didn't work properly.

Now, I want to disable the IRQ7 and use this pin as GPIO.

I wrote in bsp_init.c:

mcf5225_init()

{

....

reg_ptr->GPIO.PNQPAR = 0x1555; //Disable IRQ7

....

}

But nothing was changed. When I change the pin value, the MQX hangs (seems that execute "spurious interrupt")

Any idea?

0 Kudos
1 Solution
716 Views
DavidS
NXP Employee
NXP Employee

Hi Oscar,

Out of reset the IRQ7 is the default pin definintion but the EPORT has not been configured to generate an interrupt.

I'm using MQX4.0 and the M52259EVB as a test bed with the MQX4.0\mqx\examples\gpio project.

I'll attach the code but here is a picture of it:

ScreenHunter_08 Feb. 25 14.04.gif

Also I had to add a #define in the BSP m52259evb.h header as follows:

BSP_IRQ7     (GPIO_PORT_NQ | GPIO_PIN7) //DES added


I used oscope on J1 pin 39 (IRQ7) to see pin toggle..

Regards,

David



View solution in original post

0 Kudos
5 Replies
717 Views
DavidS
NXP Employee
NXP Employee

Hi Oscar,

Out of reset the IRQ7 is the default pin definintion but the EPORT has not been configured to generate an interrupt.

I'm using MQX4.0 and the M52259EVB as a test bed with the MQX4.0\mqx\examples\gpio project.

I'll attach the code but here is a picture of it:

ScreenHunter_08 Feb. 25 14.04.gif

Also I had to add a #define in the BSP m52259evb.h header as follows:

BSP_IRQ7     (GPIO_PORT_NQ | GPIO_PIN7) //DES added


I used oscope on J1 pin 39 (IRQ7) to see pin toggle..

Regards,

David



0 Kudos
716 Views
oscar
Contributor I

Hi David,

Thx for your quick answer. I'm using the MCF52259 with MQX 3.7 version.

My design has the SD_CARD detection wired to the IRQ7 line (as tower design).

Now, the IRQ7 interrupt is disabled and I'm detecting the card by polling.

The design is in production. The first production serie was OK. Now, we have

a issue: In some boards, if we extract and insert the SD card several times, in the

SD card insertion process, the MQX seems to execute "spurious interrupt" process,

but I don't how to catch and debug this problem. Any idea?

At the beginning I thought that the source code was not OK, but the code runs perfect

in the first production boards. I know that seems a hardware problem, but I'm trying to help

our PCB supplier to fix the problem (he made X-ray test and seems that all are OK)....:smileysad:

0 Kudos
716 Views
DavidS
NXP Employee
NXP Employee

Hi Oscar,

From our MQX release notes:

Spurious interrupt occurs when interrupt source is being disabled by software while the interrupt flag is being set by hardware. As a consequence, interrupt controller looses the information about what was the source of the interrupt.


ColdFire processor documentation reccomends to temporarily disable all interrupts each time any interrupt source is being masked in interrupt controller or in peripheral module register.


User application or custom user drivers need to follow this procedure to avoid spurious interrupts to occur. The interrupt-driven I2C I/O driver was updated accordingly in MQX 3.6.

Hope this helps.

Regards,

David

0 Kudos
716 Views
prvermas
Contributor I

Hi David,

I am also facing the exact problem, I am working on a MCF52259 & MQX 3.6  based design

I configure the IRQ7 pin in my (func mcf5225_init) as GPIO as

reg_ptr->GPIO.PNQPAR &= 0xBFFF;

I use following code in my application to initialize this IO pin

#define IRQ7  GPIO_PORT_NQ | GPIO_PIN7;


GPIO_PIN_STRUCT ss_gpio_rdrIRQ[] = { IRQ7 | GPIO_PIN_STATUS_0,

                                                              GPIO_LIST_END};

rdrIRQio_fh = fopen("gpio:read", (char_ptr) &ss_gpio_rdrIRQ);

ioctl( rdrIRQio_fh, GPIO_IOCTL_READ, (char_ptr) &ss_gpio_rdrIRQ );

(I am excluding the checks for simplicity sake)

Now whenever I try to read the status of the pin, MQX goes into Dummy fnc, & error report shows that the un handled interrupt in the task.

tempIRQStatus =  ss_gpio_rdrIRQ[0];


I appreciate response on this, thanks in advance.


Best Regards,

Pradeep

0 Kudos
716 Views
trailman
Contributor V

Hi all,

I had the same problem of a device connected to IRQ7 and I had to do polling instead on IRQ7 pin configured as GPIO, but I worked for me on MCF52254 (same as MCF52259) with MQX34 and MQX37.

However I didn't use the gpio driver but directly accessed the registers.

I configured the IRQ7 pin as follows :

  VMCF5225_GPIO_STRUCT_PTR gpioregs;

  VMCF522XX_EPORT_STRUCT_PTR eportregs;

  gpioregs = &((VMCF5225_STRUCT_PTR)_PSP_GET_IPSBAR())->GPIO;

  eportregs = &((VMCF5225_STRUCT_PTR)_PSP_GET_IPSBAR())->EPORT[0];

  gpioregs->DDRNQ &= ~(1 << 7); /* input */

  eportregs->EPIER &= ~(1 << 7); /* disable interrupt */

  gpioregs->PNQPAR &= ~(3 << (7 << 1)); /* GPIO mode */

and to read the level :

  level = (gpioregs->PORTNQP_SETNQ & (1 << 7)) ? 1 : 0;

I hope this will help...

0 Kudos