AnsweredAssumed Answered

KSDK 1.2  + MQX and LLWU

Question asked by voider on Feb 10, 2016
Latest reply on Feb 23, 2016 by soledad

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;


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 ?