KSDK 1.2 + MQX and LLWU

cancel
Showing results for 
Search instead for 
Did you mean: 

KSDK 1.2 + MQX and LLWU

449 Views
voider
Contributor II

We are working on K64 and we need to put in LLS mode. We are also using RTC to wakeup.

All is working, the processor wakeup from rtc and from 4 gpio pins, but sometimes the processor hangs and we cant wake.

Reading the manual we found a possible problem:

The LLWU interrupt must not be masked by the interrupt controller to avoid a scenario where the system does not fully exit Stop mode on an LLS recovery.

We use PEx to generate the fsl_power_manager and MQX need to install interrupt, PEx show a message "Warning: MQX needs install component interrupt service routines" if interrupt is disable.

From MQX manual we found: 

Non-Maskable Interrupts (NMI) are defined as interrupts that cannot be disabled (masked) by software. It is possible to use such interrupts in MQX RTOS applications, but NMI service routines must be installed directly to vector table as kernel ISRs (use _int_install_kernel_isr()  instead of _int_install_isr()). The NMI service routines are not allowed to call any MQX RTOS API function.

Part of our code Events.c:

void pwrMan1_llwuIRQHandler(void)

{

    if( (LLWU_F2 & LLWU_F2_WUF14_MASK) == LLWU_F2_WUF14_MASK)

    {

        LLWU_F2 = LLWU_F2_WUF14_MASK;

    }

    if( (LLWU_F2 & LLWU_F2_WUF15_MASK) == LLWU_F2_WUF15_MASK)

    {

        LLWU_F2 = LLWU_F2_WUF15_MASK;

    }

   

etc

}

So our question is:  PEx is doing LLWU interrupt in the right way? Some one have an example how to use LLWU in MQX with KSDK ?

thanks

0 Kudos
1 Reply

93 Views
soledad
NXP Employee
NXP Employee

Hello voider,

MQX for KSDK requires the driver’s interrupts to be installed. When working with MQX for KSDK and Processor Expert, there are two critical steps required:

1- Check the box for “Install interrupt”.

2- Make sure the IRQ entry names have the MQX_ prefix.

Please check the below documents:

Interrupt handling with KSDK and Kinetis Design Studio

How To: Using Interrupt Handlers in MQX with KSDK

How To: use Kinetis SDK drivers within MQX apps - handling interrupts


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos