LPC4337 and interupts on M0app

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

LPC4337 and interupts on M0app

730 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by karpis on Mon Sep 01 05:24:21 MST 2014
Hi all,
I have NGX  LPC4337-Xplorer board and try unsuccessfully to make M0 interupts work on it. I want GPIO interrupt and on M4 core it works on PIN_INT0_IRQn. From manual it is impossible to have PIN_INT0_IRQn so I switched to PIN_INT4_IRQn. All GPIO Pin Interrupt registers look the same (except M0 uses (1<<4) while M4 (1<<0) mask). So I'm guessing that something is wrong with my vector table. So simple question has anyone successfully launched interrupts from M0 core?
Labels (1)
0 Kudos
5 Replies

479 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Witte on Thu Sep 11 07:43:13 MST 2014
Hey Karpis,

I had problem with PIN_INT4_IRQn either.

How lpcxpresso-support's says, there are many examples with PIN_INT interrupts on "Peripheral Driver Library" project.
With these examples I found my mistakes.

Look my code:

#define TEST_INPUT_PIN          7/* GPIO pin number mapped to PININT */
#define TEST_INPUT_PORT         0/* GPIO port number mapped to PININT */
#define TEST_INPUT_PIN_PORT     2
#define TEST_INPUT_PIN_BIT      7
#define TEST_INPUT_MODE_FUNC    SCU_MODE_FUNC0
#define PININT_INDEX   4/* PININT index used for GPIO mapping */
#define PININT_NVIC_NAME    PIN_INT4_IRQn/* GPIO interrupt NVIC interrupt name */


void GPIO4_IRQHandler(void)
{
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(PININT_INDEX));
}

int main()
{
Chip_SCU_PinMuxSet(TEST_INPUT_PIN_PORT, TEST_INPUT_PIN_BIT,
(SCU_MODE_INBUFF_EN | SCU_MODE_INACT | TEST_INPUT_MODE_FUNC) );

/* Configure GPIO pin as input */
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, TEST_INPUT_PORT, TEST_INPUT_PIN);

/* Configure interrupt channel for the GPIO pin in SysCon block */
Chip_SCU_GPIOIntPinSel(PININT_INDEX, TEST_INPUT_PORT, TEST_INPUT_PIN);

/* Configure channel interrupt as edge sensitive and falling edge interrupt */
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(PININT_INDEX));
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(PININT_INDEX));
Chip_PININT_EnableIntLow(LPC_GPIO_PIN_INT, PININTCH(PININT_INDEX));

/* Enable interrupt in the NVIC */
NVIC_ClearPendingIRQ(PININT_NVIC_NAME);
NVIC_EnableIRQ(PININT_NVIC_NAME);

while(1)
{
__no_operation();
}
}


It works with me...
This code is the "main_CoreM0.c".
0 Kudos

479 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Tue Sep 09 01:58:34 MST 2014
The code attached to this app note

      http://www.lpcware.com/content/nxpfile/an11177-inter-processor-communication-lpc43xx

realizes a communication between the M4 and the M0 with the core-2-core interrupt mechanism.
It is a an older code example which will maybe not run as is with new compiler versions and/or on the board you have, but it might provide you with the right ideas how to setup the chip in such a way that the M0a interrupt works.

There are examples in the LPCOpen software package which should work as well, but maybe it's easier to find the missing setting in this app note than in the big LPCOpen package.


Regards,
NXP Support Team.
0 Kudos

479 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Sep 03 00:25:47 MST 2014
Have you looked at the LPCOpen examples for LPC43xx?

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages

For the multicore examples, you should also look at:

http://www.lpcware.com/content/faq/how-run-multicore-examples-provided-lpcopen-lpc43xx-packages

If you are using LPCXpresso, then there are also some simple multicore examples using the old "Peripheral Driver Library" (which LPCOpen has replaced) in the LPC43xx examples directory.

Regards,
LPCXpresso Support
0 Kudos

479 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by karpis on Tue Sep 02 01:49:07 MST 2014
Yes I looked up for correct handlers. Is there any possibility you could provide example of working interrupts on M0? Today I have tried with Timer0 interrupt on both cores and only M4 seems to work. I'm running out of ideas  :~
0 Kudos

478 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Mon Sep 01 06:56:55 MST 2014
I've certainly had interrupts working on the LPC43 M0. Have you double checked that the names of your handlers match those in your M0 startup code?

http://www.lpcware.com/content/faq/lpcxpresso/startup-code-interrupt-handlers

HTH!
0 Kudos