Other Parts Discussed in Thread: CC3220SF, INA3221
Dear Support:
I have been working on trying to use my CC3220SF LP using SDK v1.50 to get the CPU to go to sleep on command using either hibernate mode (i.e. Power_shutdown(...)) or LPDS mode (i.e., Power_enablePolicy()). I have been using the power_measurement example from the SDK to understand how to do this and have been able to get this example to boot up from hibernate mode and execute the callback method as well as entering LPDS mode and having it come out as a result of a GPIO transition for LPDS mode. However upon taking this code and getting it to work with my larger project, I am running into problems getting the same code to come out of LPDS mode with the same GPIO that is being used with the power_measurement example that I am using. I have noticed in my power_measurement example that when it goes into LPDS mode, that the current draw from the CC3220SF is pretty much zero. And it comes out of LPDS mode with a GPIO (currently using the pushbutton on the LP) and resumes operation - as expected and no issues. In the power_measurement example the WiFi is not running since sl_Start(...) has not been called prior to going into LPDS which I assume explains why the current is pretty much zero.
However when I do the same operation with pretty much the same method of going into LPDS as is done with my power_measurent example, I notice that the current does not go to zero, but instead drops by about 10 mA (i.e. from 80 mA prior to LPDS being initiated to 70 mA) after LPDS being initiated. And the callback routine that was working with the power_measurement example is not being called when the GPIO (i.e. pushbutton is pressed) is toggled. In this larger project, I have the I2S, I2C and UART, peripherals running as well as WiFi and several other TI-RTOS tasks, whereas with the power_measurement example, only the UART is running. So do you know what is wrong here as to why the current doesn't go to zero with this larger project, but it does go to zero with the power_measurement example? I assume it has to do with WiFi running and other driver peripherals being opened. Is that the case?
But my more bigger issue is why doesn't the LPDS callback routine get entered like it does with the power_measurement example? Below is the PowerCC32XX_config definition I am using:
void gpioButtonFxn1(uint32_t index);
const PowerCC32XX_ConfigV1 PowerCC32XX_config = {
.policyInitFxn = &PowerCC32XX_initPolicy,
.policyFxn = &PowerCC32XX_sleepPolicy,
.enterLPDSHookFxn = NULL,
.resumeLPDSHookFxn = NULL,
.enablePolicy = false,
.enableGPIOWakeupLPDS = true,
.enableGPIOWakeupShutdown = true,
.enableNetworkWakeupLPDS = true,
.wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,
.wakeupGPIOTypeLPDS = PRCM_LPDS_FALL_EDGE,
.wakeupGPIOFxnLPDS = gpioButtonFxn1,
.wakeupGPIOFxnLPDSArg = 3,
.wakeupGPIOSourceShutdown = 0,
.wakeupGPIOTypeShutdown = 0,
.ramRetentionMaskLPDS = PRCM_SRAM_COL_1 | PRCM_SRAM_COL_2 |
PRCM_SRAM_COL_3 | PRCM_SRAM_COL_4,
.keepDebugActiveDuringLPDS = false,
.ioRetentionShutdown = PRCM_IO_RET_GRP_1,
.pinParkDefs = parkInfo,
.numPins = sizeof(parkInfo) / sizeof(PowerCC32XX_ParkInfo)
};
So although the current drops by 10 mA by going into LPDS, it's a long ways from zero (~70 mA), the callback routine of gpioButtonFxn1 does not get called like it does with power_measurement and that's a problem. Please advise as to what may be the problem.
Also when going into hibernate mode, there is an element in the PowerCC32XX_config structure defined as such:
.enableGPIOWakeupShutdown = true,
which suggests that the hibernate mode can be exited with a GPIO pin. However from the reading of the documentation, this suggests otherwise. From the power_measurement example that I have been using, the power_shutdown(...) call is only exited by a timeout by entering a non-zero value for the shutdownTime in the argument list of this function call. This works fine with the power_measurement example as well as with the larger project that I am using, but would really like to go into hibernate mode indefinitely until a specific GPIO pin transition is detected and then come out as a result of a falling or rising edge of the GPIO pin. Is this possible? And if not, then what is the purpose of the element:
.enableGPIOWakeupShutdown
in the PowerCC32XX_config structure defined in the file CC3220SF_LAUNCHXL.c? Please advise.
Thanks,
Tim