LPC4357 M0 GPIO pin_4 interrupt not work

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC4357 M0 GPIO pin_4 interrupt not work

123 Views
willgo
Contributor I

I use M0 of LPC4357 to create a project,
And use two interrupt timer0 and GPIO_4
In debug mode, only timer0 will trigger the interrupt regularly,
After GPIO4 received the signal, it did not execute the PIN_INT4_IRQHandler function.
The GPIO4 interrupt didn't work.
But use M4 to create a project and use the same settings, GPIO_4 will be triggered and enter PIN_INT4_IRQHandler,
The following is the setting of my GPIO_4.

Chip_SCU_PinMuxSet(0xF, 5, SCU_PINIO_FAST | SCU_MODE_FUNC4);
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT,7,19);
/* Configure interrupt channel for the GPIO pin in SysCon block */
Chip_SCU_GPIOIntPinSel(4, 7, 19);
/* Configure channel interrupt as edge sensitive and falling edge interrupt */
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(4));
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(4));
Chip_PININT_EnableIntLow(LPC_GPIO_PIN_INT, PININTCH(4));
/* preemption = 1, sub-priority = 1 */
NVIC_SetPriority(PIN_INT4_IRQn, 8);
/* Enable interrupt in the NVIC */
NVIC_ClearPendingIRQ(PIN_INT4_IRQn);
NVIC_EnableIRQ(PIN_INT4_IRQn);

0 Kudos
4 Replies

81 Views
willgo
Contributor I

Thank you for the reply.

When I use the M4 project contains M0 image, the M0 GPIO4 interrupt worked.

0 Kudos

116 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello willgo,

Please tell me more detail about which port , pin you used to generate interrupt?

Chip_SCU_PinMuxSet(0xF, 5, SCU_PINIO_FAST | SCU_MODE_FUNC4);

Is this you want?

And also please first delete the gpio code in M4 project .

 

BR

Alice

0 Kudos

109 Views
willgo
Contributor I

Hi Alice,

Chip_SCU_PinMuxSet(0xF, 5, SCU_PINIO_FAST | SCU_MODE_FUNC4);

Is this you want?

YES, PF_5, GPIO7[19],  General purpose digital input pin.

#define SCU_PINIO_FAST (SCU_MODE_INACT | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS)

It is used to detect the 15.625us periodic pulse wave.

And also please first delete the gpio code in M4 project .

In order to debug, Just only run the M0.

The M4 project will not start until M0 works normally, so M4 does not set this GPIO.

 

0 Kudos

93 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

How about delete

* preemption = 1, sub-priority = 1 */
NVIC_SetPriority(PIN_INT4_IRQn, 8);

to use default priority.

There is no error with your showed code,

If still can't work, you can send a simple project that can reproduce your issue.

 

BR

Alice

0 Kudos