Project #38: Low-Power Startup

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I've been working on implementing the Low Power Startup process as outlined in Project #38: Low-Power Startup.  I was successful in building and testing the code in that project and have verified the current draw improvement as expected.  After integrating into my project, I have been unable to successfully stay connected to the PSoC 4 BLE when in Peripheral Mode.  

   

I've made similar change to Project #38 code with a modification to the BLE module and am getting the same behavior.  Please find it attached.

   

I'm also including the log from CySmart 1.1.

   

I'd appreciate any assistance to correct the issue.

0 Likes
1 Solution
Anonymous
Not applicable

For anyone who may view this thread and wonder on the outcome:

   

An issue was found in the Project #38 code that was causing the issue.  A Cypress employee stated the project code would be updated at some point in the future.  The change consists of 2 additional lines of code.  I've checked and verified that it fixes my issue, so hopefully this will work universally.

   

The change is located in the file Init.c, in the function WCO_ECO_LowPowerStart(), the new lines of code should be inserted before line 143 and after line 145 so that the code block looks like this:

   

/* Start code snippet */

   
    CySysWdtUnlock();     (void)CySysClkWcoSetPowerMode(CY_SYS_CLK_WCO_LPM);      /* Switch WCO to the low power mode after startup */     CySysClkSetLfclkSource(CY_SYS_CLK_LFCLK_SRC_WCO);       /* LFCLK is now driven by WCO */     CySysClkIloStop();                                      /* WCO is running, shut down the ILO */     CySysWdtLock();  /* End code snippet */
   

 

   

The explanation is as follows, the code on those lines was not taking affect due to the Watchdog Timer (WDT) subsystem lock system preventing the modifications.  No changes can be made to the low frequency (LF) clock with the WDT subsystem lock enabled as the WDT clock uses the LF clock.

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable

Matt,

   

I see a Connection Termination Notification event received, but we don;t know the reason from where this came from.

   

Do you have a BLE Sniffer? If yes, that may help us to know the exact reason for the disconnection (master initiating it, supervision timeout, internal firmware event).

   

If no, I would suggest creating a technical support case at www.cypress.com -> "Design Support" -> "Support" -> "Create a Support Case". You need to be registered to create the case. The technical team will help you with solving the issue.

0 Likes
Anonymous
Not applicable

For anyone who may view this thread and wonder on the outcome:

   

An issue was found in the Project #38 code that was causing the issue.  A Cypress employee stated the project code would be updated at some point in the future.  The change consists of 2 additional lines of code.  I've checked and verified that it fixes my issue, so hopefully this will work universally.

   

The change is located in the file Init.c, in the function WCO_ECO_LowPowerStart(), the new lines of code should be inserted before line 143 and after line 145 so that the code block looks like this:

   

/* Start code snippet */

   
    CySysWdtUnlock();     (void)CySysClkWcoSetPowerMode(CY_SYS_CLK_WCO_LPM);      /* Switch WCO to the low power mode after startup */     CySysClkSetLfclkSource(CY_SYS_CLK_LFCLK_SRC_WCO);       /* LFCLK is now driven by WCO */     CySysClkIloStop();                                      /* WCO is running, shut down the ILO */     CySysWdtLock();  /* End code snippet */
   

 

   

The explanation is as follows, the code on those lines was not taking affect due to the Watchdog Timer (WDT) subsystem lock system preventing the modifications.  No changes can be made to the low frequency (LF) clock with the WDT subsystem lock enabled as the WDT clock uses the LF clock.

0 Likes
Anonymous
Not applicable

I think it should be after the line 143 and before line 145, unless You have two code snippets

   

Otherwise it's unlogic

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I double checked the code insertion locations and found them to be correct, the code snippet is correct as well.  For clarity, I've attached the modified file.

0 Likes
Anonymous
Not applicable

I've modified the original code like You described above. Programmed the kit. And still not able to debug. The stack is full of hidden functions.

   

And the end is CySysPmSleep(void). Start of stack is  CyBle_ProcessEvents().

   

Sometimes the call stack end on CY_ISR(CyBLE_Bless_Interrupt);

   

I'm not able to catch breakpoint anywhere else.

0 Likes
Anonymous
Not applicable

The fix to this project was to correct an issue that prevented proper BLE connections when changing the BLE role from unconnectable broadcaster to connectable peripheral.  This was not about a debug issue.

   

If you have a debug issue, I suggest you submit a new thread to make it more likely for others to see your issue and assist.  It is also usually helpful to attach your project so others can recreate your issue.

   

Good luck!