AnsweredAssumed Answered

KL27 - KSDK - LLWU problem

Question asked by Thomas Haugen on May 3, 2017
Latest reply on May 9, 2017 by Robin_Shen

Hi,

 

I'm currently working on a project that requires a LLWU pin to wakeup the KL27 from LLS STOP mode. When in sleepdeep mode I trigger the interrupt with a pushbutton (with pullup), The LLWU pin goes low. But instead of running my LLWU interrupt handler it fires the DefaulISR(). I Know this because I toggle a LED inside this ISR.

 

I have struggled with this for days now and I'm not able find any "clear" answers online..

 

I using KDS 3.2.0 & PE with KSDK 1.3.0 to setup LLWU pin 8 (GPIOC, pin 4) as a wakeup source. Negative edge triggered.

 

This is the setup code generated by PE:

 

From hardware_init.c

void hardware_init(void) {

 

  /* Enable clock for PORTs */

  SIM_HAL_EnableClock(SIM,kSimClockGatePortA);

  SIM_HAL_EnableClock(SIM,kSimClockGatePortB);

  SIM_HAL_EnableClock(SIM,kSimClockGatePortC);

  SIM_HAL_EnableClock(SIM,kSimClockGatePortD);

  SIM_HAL_EnableClock(SIM,kSimClockGatePortE);

 

  /* Setup board clock source. */

  g_xtal0ClkFreq = 0U;                  /* System oscillator 0 is not enabled */

 

  init_coredebug_pins(CoreDebug_IDX);

  init_gpio_pins(GPIOA_IDX);

  init_gpio_pins(GPIOC_IDX);

  init_gpio_pins(GPIOD_IDX);

  init_gpio_pins(GPIOE_IDX);

  init_i2c_pins(I2C0_IDX);

  init_i2c_pins(I2C1_IDX);

  init_llwu_pins(LLWU_IDX);

  init_lpuart_pins(LPUART1_IDX);

  init_scb_pins(SCB_IDX);

  init_uart_pins(UART2_IDX);

}

 

 

From Cpu.c - Components_Init()

 

/*! gpio_llwu_pins Auto initialization start */

  GPIO_DRV_Init(gpio_llwu_pins_InpWakup,NULL);

  /*! gpio_llwu_pins Auto initialization end */

 

  /*! pwrMan1 Auto initialization start */

  NVIC_SetPriority(LLWU_IRQn, 1U);

  OSA_InstallIntHandler(LLWU_IRQn, &pwrMan1_llwuIRQHandler);

  POWER_SYS_Init(powerConfigsArr, 1U, NULL , 0U);

  POWER_SYS_SetWakeupPin(kPowerManagerWakeupPin8, kLlwuExternalPinFallingEdge, NULL);

  INT_SYS_EnableIRQ(LLWU_IRQn);

 

 

The Interrupt handler is automatically added to Events.c and the prototype in Events.h

 

void pwrMan1_llwuIRQHandler(void)

{

  /* Write your code here. For example clear LLWU wake up flags ... */

       //CheckModeButton();

       POWER_SYS_ClearWakeupPinFlag(kPowerManagerWakeupPin8);

       GPIO_DRV_ClearPinOutput(LED_GREEN2);

}

 

What am I missing?

 

Med vennlig hilsen,

Thomas Haugen

Software Development Engineer

 

GSM: +47 930 35 863

E-mail: thomas.haugen@7sense.no<mailto:thomas.haugen@7sense.no>

 

 

7Sense Technologies AS

Kongeveien 73               Tel:  +47 33 08 44 00

3188 Horten                    Fax: +47 33 08 44 01

Norway                           E-mail: sales@7sense.no<mailto:sales@7sense.no>

 

 

Attachments

Outcomes