AnsweredAssumed Answered

Unable to set properly priority level to interrupts (S32K144 )

Question asked by chicheportiche nicolas on Dec 26, 2019
Latest reply on Jan 2, 2020 by chicheportiche nicolas

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

Outcomes