Thanks, I will start from that for the LP modes.
In the meanwhile, I tried to lower the clock speed of the MCU while in run or wait mode. I don't need the 48MHz, I would like to go down to 1MHz.
As a first step, I am trying to go down to 8MHz.
In app_hw_kinetis.h I have
// #define RUN_FROM_HIRC // clock from internal 48MHz RC clock
#define RUN_FROM_LIRC // clock from internal 8MHz RC clock
and
// #define LPUART_IRC48M // if the 48MHz clock is available clock the LPUART from it
//#define LPUART_OSCERCLK // clock the LPUART from the external clock
#define LPUART_MCGIRCLK // clock the LPUART from MCGIRCLK (IRC8M/FCRDIV/LIRC_DIV2)
However, when I power the MCU it kind of freeze and I can see the green light getting stuck. I did some debug and it looks like the board is resetting (fnInitHw is called repeatedly). I see some similarity to what you have experienced here
https://community.freescale.com/thread/335304Any idea of what am I doing wrong?
Another interesting aspect is that, If i connect the SPI clk pin of the MCU (master) to ground, than the core start running and the LED blinking (and lower energy consumption because of the reduced clock). If I deactivate the SPI module, then connecting to ground the clk pin does not have any effect.
Thanks,
Enrico