This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI-RTOS
I am porting firmware from TI-RTOS to SimpleLink / POSIX API (with TI-RTOS as underlying RTOS).
In TI-RTOS before impleLink, you could configure that when no task was running, an idle task would run and move the controller to a lower power level (via the TI-RTOS configuration GUI).
Is that same functionality available in SimpleLink for MSP432?
Asking for this exercise on element14 community blog series:
Ah, I see that the RTOS project that's created has the idle functions set up:
When I built an example, the ULP logged in the console that there's no low power used:
remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
I'd expect that the ULP would not give this message if Power_idleFunc() calls low power status.
Got it sorted out now :
In the board file (in my case MSP_EXP432E401Y.c), the function that defines the power policy is registered in a static structure.
/* * =============================== Power =============================== */ #include <ti/drivers/power/PowerMSP432E4.h> const PowerMSP432E4_Config PowerMSP432E4_config = { .policyFxn = &PowerMSP432E4_sleepPolicy, .enablePolicy = true };
I've placed a breakpoint in that function to see if it gets called and what it's doing.
It gets called and here's the logic:
#define DHCSR (*(volatile uint32_t *)0xE000EDF0) #define C_DEBUGGEN 0x1 /* * ======== PowerMSP432E4_sleepPolicy ======== */ void PowerMSP432E4_sleepPolicy() { /* invoke WFI only if CPU is not in debug mode */ if (!(DHCSR & C_DEBUGGEN)) { __asm(" wfi"); } }
So if we're in debug mode, we don't sleep. When not in debug mode, the ARM WFI instruction is executed:
WFI
suspends execution until one of the following events occurs:**Attention** This is a public forum