This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NXP KL82 RTX low power mode

Hi there,

Is there anybody know where I can find some example code for NXP KL82 processor running in low power mode on RTX?

I already have a working project setup by colleague. but there is no os_idle_thread implemented. I searched on internet and get some clue on how to do it. I know I have to setup a lptmr, llwu, and then put the mcu into lls mode. I saw an example code write for TI's msp430 chip. I did some modification it seems not working properly.

here is my code


void os_idle_demon (void) {

  for (;;) {

          tc_weakup = os_suspend();
          if (tc_weakup > 0)
          {
                  tc = 0;
                  lp_sleep = 1;

          /* Do not wake up on exit from ISR */
                  SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk;
                  /* Setting the sleep deep bit */
                  SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);
                  __WFI();

          }

          os_resume(tc);

  }
}

void systime_tick()
{


        if (tc++ > tc_weakup && lp_sleep)
        {
                lp_sleep = 0;
                scb->scr &= ~scb_scr_sleeponexit_msk;

                return;
        }
    ++systime_ms;
}


any insight would be grateful.
thank you