Jump to content
Sign in to follow this  

How to set up LPDS for CC3200 in Energia?

Recommended Posts


I would like to utilize LPDS mode for CC3200. I am following TI SDK idle_profile_nonos example. However, since my code was developed in Energia environment, I am trying to add PM related functions into my code. However, it doesn't enter sleep mode. 

Here is what I did. I really appreciate if anyone who is familiar with LPDS can share their experience.  

One issue I can think of now is, according to TI, they mentioned that we need to set up SimpleLinkSyncWaitLoopCallback to put MCU to sleep when it is idle. However, I am not sure how SimpleLinkSyncWaitLoopCallback is invoked in Energia  



1. I am using Energia IDE to develop my code. In setup(), I include PM Initialization

struct platform_pm_ops lp3p0_pm_ops;

/* Initialize the PM framework */
if (cc_pm_framework_init()){
   Serial.println("Error: PM framework init failed");
/* Get the SOC specific platform operations */

/* Register PM ops with framework */
Serial.println("Error: PM framework init failed");

/* Register the interrupt with the global interrupt handler */
MAP_IntRegister(INT_PRCM, prcm_interrupt_handler);

/* Enable the interrupt */

2. In loop(), if GP28 is LOW, then I do the following

if (sl_WlanPolicySet(SL_POLICY_PM, SL_NORMAL_POLICY, NULL, 0) < 0)
   Serial.println("Error: unable to configure network power policy\n\r");
// set up gpio handler
lp3p0_setup_power_policy(1); // 0: POWER_POLICY_SLEEP; 1: POWER_POLICY_STANDBY

// just to clear any pending event

set_gpio_as_wk_src(0, 0x3, 0); // WK_LPDS = 0x0, GPIO_SRC_WKUP = 0x3, PRCM_LPDS_HIGH_LEVEL = 0x0


3. The functions above are directly from lp3p0_plat_ops.c. However, since I only want to use GPIO as the wake up source, I modify the interrupt handler as follows 

void prcm_interrupt_handler() {
   int status;

/* Read the interrupt status, also clears the status */
   status = MAP_PRCMIntStatus();

   if (0 == status) {
/* Invoke the wake from LPDS interrupt handler */
   } else {

4. Since my wake up source is GPIO, I comment out Host IRQ and RTC portions in set_wkup_srcs


May I know if I am missing anything else?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this