Unable to set properly priority level to interrupts (S32K144 )

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

Unable to set properly priority level to interrupts (S32K144 )

Jump to solution
1,585 Views
chicheportichen
Contributor II

Hello

I'm currently working with the S32K144EVB with Design Studio for ARM. Without the SDK, because I'm new to programming and I want to learn.

I'm trying set prority to several interruptions. It seems that it has no effect : to check it I've used one LPIT to open a popup menu in a console when a button is pushed and waits for an answer for the user (reuse from LPUART example in the coockbook), and another LPIT channel to blink a LED.

Once entered in the first interrupt handler, the second one doesn't occur anymore, i.e. the LED stops blinking.

Extract from the code is : 

For the IRQs :

void LPIT0_init_IRQs(void)
{
// interrupt for push button
S32_NVIC->ICPR[1] |= 1 << (48 % 32); // IRQ48-LPIT0 ch0: clr any pending IRQ
S32_NVIC->ISER[1] |= 1 << (48 % 32); // IRQ48-LPIT0 ch0: enable IRQ
S32_NVIC->IP[48] = 0xA; // IRQ48-LPIT0 ch0: priority 10 of 0-15

//interrupt for LED blinking
S32_NVIC->ICPR[1] |= 1 << (49 % 32); // IRQ48-LPIT0 ch1: clr any pending IRQ
S32_NVIC->ISER[1] |= 1 << (49 % 32); // IRQ48-LPIT0 ch1: enable IRQ
S32_NVIC->IP[49] = 0x0; // IRQ48-LPIT0 ch1: priority 4 of 0-15
}

For the handlers :

void LPIT0_Ch0_IRQHandler(void)
{
global_counter++; /* Increment LPIT0 timeout counter */

if ( SW2_PUSHED )
menu_display(uart_string,id_buff);

LPIT0->MSR |= LPIT_MSR_TIF0_MASK; // Clear LPIT0 timer flag 0
}


void LPIT0_Ch1_IRQHandler(void)
{
/PTD->PTOR |= 1<<0; //Toggle output on port D0 (blue LED)
ready = 1;
LPIT0->MSR |= LPIT_MSR_TIF1_MASK; // Clear LPIT0 timer flag 0
}

Does-anyone know what I'm doing wrong ?

Thanks,

nicolas

0 Kudos
1 Solution
1,461 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Nicolas,

I believe it was answered here:

https://community.nxp.com/message/1247761 

BR, Daniel

View solution in original post

0 Kudos
2 Replies
1,462 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Nicolas,

I believe it was answered here:

https://community.nxp.com/message/1247761 

BR, Daniel

0 Kudos
1,461 Views
chicheportichen
Contributor II

Hello Daniel

Yes, you've already answered. It is now clear to me. The coockbook was tricky.

Thanks for your answer.

BR,

Nicolas

0 Kudos