Thank you so much Mark,
I'm going through your answer and testing.
As for the UART I was trying to send instead of receiving, that's probably why I couldn't make it work? I will try to rx and see what happens.
Besides all the functionalities (UART, SPI etc), at the moment I'm having trouble to actually enter a low power stop or low leakage state as my current consumption is always around 0.9mA or higher. It's like I'm always in WAIT mode.
I tried to run from HIRC or from LIRC with these configs
//#define RUN_FROM_HIRC // clock from internal 48MHz RC clock
#define RUN_FROM_LIRC // clock from internal 8MHz/2MHz RC clock
#if defined RUN_FROM_HIRC
#define SYSTEM_CLOCK_DIVIDE 16 // 1..16
#define BUS_CLOCK_DIVIDE 4 // 1..8 (valid for bus/flash and divisor is after the system clock divider)
#elif defined RUN_FROM_LIRC
#define RUN_FROM_LIRC_2M // selet 2MHz rather than 8MHz
#define SLOW_CLOCK_DIVIDE 2 // optionally divide the slow clock output (1, 2, 4, 8, 16, 32, 64 or 128)
#define SYSTEM_CLOCK_DIVIDE 8 // 1..16
#define BUS_CLOCK_DIVIDE 2 // 1..8 (valid for bus/flash and divisor is after the system clock divider)
Plus, I have
#define SUPPORT_LOW_POWER
#define SUPPORT_PORT_INTERRUPTS (I will need it for LLWU)
{"lowPower", fnLowPower, NO_QUEUE, 0, 0, UTASKER_GO} is activated in taskConfig.c
As soon as I enter my TASK I run fnSetLowPowerMode(RUN_MODE) or WAIT_MODE, or VLPR_MODE (and it works), but after that all other modes like VLPS_MODE, VLLS0_MODE, I think are entered because I see the current decreasing, but it's no lower than 0.9mA.
Is there any other settings/define or wrong clock I am missing?