Forums - CSRMeshSwitch - Reduce power consumption

31 posts / 0 new
Last post
CSRMeshSwitch - Reduce power consumption
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Wed, 2016-06-08 02:53

Hi,

I am trying to reduce the power consumption of the development board running the CSRMesh Switch application. Eventually I want to the light switch to be powered by batteries, so I want to achieve as low power consumption as possible. The light switch doesn't have relay messages in the mesh.

Loading the default example application I am observing periodic current consumption even after the Switch has been associated. Here is a graph of the current consumption.

Anyone can help me on this? It seems like this is broadcasting at a regular interval or something.

 

http://i65.tinypic.com/5xsdiv.jpg

Image and video hosting by TinyPic

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Thu, 2016-06-09 22:08

The CSRmesh did not been design to be low Power since mesh need to be alive to get and send RF Bluetooth Smart command. Moreover if the switch will sleep, it will not detect the user hand. You can make the scan interval longer to reduce power consumption and use PIO interrupt to wake from sleep once the user activate the switch.
Call my Skype nissim.test I will try to help how to wake

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Thu, 2016-06-09 02:32

Thank for the reply Dr Nissim.

I just need the light switch to be sending commands when the button is pressed. It does not need to receive or help forward messages from other nodes in the mesh.

Yes, I was thinking about doing a PIO interrupt that wakes up the light switch, transmit a packet, and goes back to sleep again. What are the modifications needed to the example CSRMesh Switch application provided by CSR to implement this?

 

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Thu, 2016-06-09 22:04
Since the CSRmesh core source code is closed bin lib, I do not have a good advice. Just try to keep the switch alive after click till the next scan will occur . (probably 4 sec will be a good window)
  • Up0
  • Down0
v.svistelnikov
Join Date: 6 Jun 16
Location: Kharkov
Posts: 13
Posted: Fri, 2016-06-10 00:55

The issue that makes your mesh switch waken up in your first post is wathchdog model implemented in default CSR example. It beahves like this - 2 seconds as ordinary node (listens to mesh and retransmitts mesh messages), 3 sleeps (default configuration).

Check user_config.h and undefine it if don't need such behavior.

 

Check for CsrMeshEnableListening(bool) and adv_scan_param.scan_duty_cycle. I've implemented switch with stream model that normally sleeps, wakes up on button event, enables mesh listening, sends data, receives confirmation, disables listening and goes back to sleep mode.

 

Added: REALY_ENABLE is FALSE for mesh messages

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Fri, 2016-06-10 05:31

Dear v.svistelnikov,

Thanks for the information. Sorry I am very new to programming on the CSR module.

I tried to disable the WatchDogModel in user_config.h

/* Enable Watchdog Model. */

/*#define ENABLE_WATCHDOG_MODEL*/

 

However, it seems like it didn't work and its drawing more current now. I am attach an image of the current profile.

 

http://tinypic.com/r/2yxhoxy/9

 

Also, I don't understand what you mean by Check for CsrMeshEnableListening(bool) and adv_scan_param.scan_duty_cycle? Where do they appear and do I have to disable them too?

 

Do I also need to call the function SleepRequest(sleep_mode_deep,FALSE,NULL) somewhere? If so, where should I put it? When a button event occurs, which function is being call? So I guess I need to put CsrMeshEnableListening(TRUE) inside this function? What do you mean by receive confirmation? Where do I receive the confirmation? After receiving the confirmation, I guess I need to call  CsrMeshEnableListening(FALSE) followed by SleepRequest(sleep_mode_deep,FALSE,NULL) ?

 

I also don't understand what you mean by REALY_ENABLE is false? I think you mean RELAY_ENABLE. Where is this REALY_ENABLE located? I tried searching all the C files and Header files, but just can't find this variable. The closest match I found is inside csr_mesh_switch.c, 

 

/* Used for permanently Enabling/Disabling Relay */

#define RELAY_ENABLE_MASK (0x0002)

 

Thanks in advance and sorry for the many questions.

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Fri, 2016-06-10 17:54

Just another thought, I am looking at the example code for CSRMeshTempSensor application which implements low power application and dynamic scan duty cycles.

It might make sense for me to modify this example and implement the Power Model, Switch Model and Light Model so that instead of a button press changing the temperature setting, it sends a light related command instead.

Any comments on this method? Or its still easier to modify from the original CSRMeshSwitch application?

I am using CSRMesh1.3.

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Sun, 2016-06-12 04:19

I guess I found the solution:

https://forum.csr.com/forum/main-category/main-forum/csrmesh/29280-reduc...

Hope this helps anyone else who has this problem too.

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Sun, 2016-06-12 20:23

Hi all,

This is what I have done so far:

1. Disable watchdog timer in the user_config.h file

/* Enable Watchdog Model. */

/*#define ENABLE_WATCHDOG_MODEL*/

 

2. In the AppProcessCsrMeshEvent function in csr_mesh_switch.c file, add the following:

 

extern void AppProcessCsrMeshEvent(csr_mesh_event_t event_code, uint8* data,

uint16 length, void **state_data)

{

     switch(event_code)

     {

        ......

        case CSR_MESH_KEY_DISTRIBUTION:

        {

           .....

           g_switchapp_data.bearer_data.bearerEnabled &= ~(BLE_GATT_SERVER_BEARER_MASK);

           CsrMeshEnableListening(FALSE);

           .......

 

3. In the AppInit function in csr_mesh_switch.c file, add the following:

void AppInit(sleep_state last_sleep_state)

{

    .......

    #ifdef ENABLE_WATCHDOG_MODEL

    /* Start Watchdog. */

    AppWatchdogStart();

    #endif /* ENABLE_WATCHDOG_MODEL */

    }

 

    if (g_switchapp_data.assoc_state == app_state_associated)

   {

        g_switchapp_data.bearer_data.bearerEnabled &= ~(BLE_GATT_SERVER_BEARER_MASK);

   }

   

 

I managed to bring down the current to about 50uA. However, it still not as low as what others have got in the forum. They were able to get the current down to less than 10uA. Anyone knows what I am missing?

 

Also, I noticed that there is some event happening every 15 secs. Please see the image below. What is happening event 15 secs? Is it important? If not, how can I disable it?

 

http://tinypic.com/r/168j5ew/9

 

 

  • Up0
  • Down0
v.svistelnikov
Join Date: 6 Jun 16
Location: Kharkov
Posts: 13
Posted: Tue, 2016-06-14 00:02

Hi kian !

I managed to bring down the current to about 50uA. However, it still not as low as what others have got in the forum. They were able to get the current down to less than 10uA. Anyone knows what I am missing?

I don't have appropriate measuring equipment now so I cannot tell how much current sinks my device

Also, I noticed that there is some event happening every 15 secs. Please see the image below. What is happening event 15 secs? Is it important? If not, how can I disable it

It is watchdog event - chips wakes up on this event. It can be configured through .keyr file (value is in milliseconds). I am not sure you can completely disable it. Min value is 1000 ms while max value is 65535 ms

 

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Tue, 2016-06-14 01:09
It seems that the watchdog event is not disabled at your code.
  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Tue, 2016-06-14 07:39

Hi Dr Nissim,

Thanks for the reply. I am pretty sure the WatchDog is disabled. Previously it was waking up for 1 second in every 5 seconds interval. After I disable watchdog, this does not happen anymore. It was mentioned in the old forum:

https://forum.csr.com/forum/main-category/main-forum/csrmesh/29280-reduc...

Unless there is another watchdog schedule for every 15 seconds, but I don't see it any where in the codes. It only wakes up for a short while every 15 seconds, so not that much of an issue in current consumption. I am just curious to know what is the cause of it and what is this short pulse every 15 seconds used for.

The more pressing problem I have is still the 50uA current consumption even though I had disable watchdog and CSRMesh relay. When I measured the current consumption, the SPI_PIO is pull down to low with a 47k resistor and the I disconnected all the debugger pins. I read in the old forum about disabling UART, and  setting sleep mode to deep sleep. I have done that too....

Inside the csr_mesh_switch.c file, in the AppInit function, I added these lines just before calling IOTSwitchInit.

********************************************************************************************************* 

/* Set the UART Rx PIO to user mode */

PioSetModes( 0x01UL << 9, pio_mode_user );

/* Set the UART Rx PIO direction as input */

PioSetDir( 9, PIO_DIRECTION_INPUT );

/* Pull up the PIO to save power*/

PioSetPullModes( 0x01UL << 9, pio_mode_strong_pull_up );

/* Disable any events arising out of this PIO */

PioSetEventMask( 0x01UL << 9, pio_event_mode_disable );

 

SleepModeChange(sleep_mode_deep);

 

/* Initialise the Switch Hardware */

IOTSwitchInit();

*********************************************************************************************************

 

Am I still missing anything? Do I need to configure unused PIO pins? Can they be left floating or they need to be tied to ground if unsued?

 

Hope someone can help.

 

Thanks so much!!

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Tue, 2016-06-14 21:47

if some on the pios on your design is configured as interrupts. I presume it is OK. And in any way ,if  it auto wake up every 15 sec. I believe it defiantly some timer that did not be disabled. My offer, do not disable the UART and add code in every procedure you suspect been called on that 15 sec. and debug it. Another option is more as hacking. Inquire and disable all timers, even the ones you did not open.

  • Up0
  • Down0
liem
Join Date: 6 Jun 16
Posts: 14
Posted: Tue, 2016-06-14 20:46

Hi,

 

Regarding the question of the chipset waking up every 15 sec, that is expected.  The chipset wakes periodically at 15 sec interval to do internal calibrations, read the chipset temperature, etc...  This activity should not be disabled.

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Tue, 2016-06-14 21:55

kian,

To verify the source of the 15 sec problem. as in chip hardware level or user application level, as in CSRmesh. Just flash other application, not the CSRemsh, and see if the current consumption jumps every 15 sec.

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Tue, 2016-06-14 22:06

Hi all,

Thanks for the feedback.

I had earlier commented about disabling the UART. Actually in the MeshSwitch application example, UART is already disabled by default as PIO0 (TX)and PIO1(RX) is used by SW2 and SW3 on the development board and they are both configured to be inputs with strong pull up. This can be found in the IOTSwitchInit function inside csr_mesh_switch.c file.

The only problem now is to figure out how to bring the current consumption down from 50uA. When there is no event, the board is still consuming 50uA of current.

 

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Wed, 2016-06-15 01:04
Just flash other application, not the CSRemsh, and see if the current consumption jumps every 15 sec Or call my Skype nissim.test I will help.
  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Thu, 2016-06-16 01:04

Hi all,

I solved the problem. It was a hardware problem. I forgot that had a voltage regulator in my design that was consuming current.

If you just follow my method above to disable WatchDog and also to disable message forwarding then you should be able to get about 7-8uA current consumption in the idle state.

Hope it helps whoever has the same problem.

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Thu, 2016-06-16 03:53
:)
  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Tue, 2016-06-21 03:19

I have another related problem now.

Since I have disabled the watchdog timer and also disabled mesh listening, I can't have the mobile app assign a group to the switch since the switch is no longer listening to messages.

Anyone has any suggestions on how to overcome this? Maybe a low duty cycle listening mode? Or when I press a button on the switch, it enables listening for X seconds before disabling listening and going back to sleep?

 

I also like to know what does each of the following does:

1. What is the watchdog timer used for? 
2. What does this line do?     g_switchapp_data.bearer_data.bearerEnabled &= ~(BLE_GATT_SERVER_BEARER_MASK);

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Sat, 2016-09-03 06:21

Hi all,

I have recently migrated to CSRMesh 2.0 and I am again facing the same problem with reducing power consumption. As the codes are now quite different between CSRMesh 1.3 and CSRMesh 2.0 (some of the APIs have been replaced) and the codes are now organised differently.

Just a recap of what I am trying to acheive:

I would like to send a customed message from a switch device to a light device whenever the push button switch is pressed, and I need to achieve this with the lowest current consumption possible. I do not need this switch device to relay messages.

What I had done previously with CSRMesh 1.3 was to disable the WatchDog and also disable CSRMesh listening by calling: CsrMeshEnableListening(FALSE);

I also set this, although I still don't know what it does:  g_switchapp_data.bearer_data.bearerEnabled &= ~(BLE_GATT_SERVER_BEARER_MASK);

But with these settings, I was able to achieve very low power consumption.

Now with CSRMesh2.0, the codes are organised very differently and the API function CsrMeshEnableListening is no longer available. Can someone advise me on what I should do? 

 

Thanks in advance

 

 

  • Up0
  • Down0
Loris
Join Date: 27 Jul 16
Posts: 35
Posted: Tue, 2016-09-06 01:28

Hi, Kian,

  Are you sure that "he API function CsrMeshEnableListening is no longer available"? I'm also use CSRmesh  and I have used this API in my program, and it works fine to decrease power consumption

  • Up0
  • Down0
kian
Join Date: 8 Jun 16
Posts: 43
Posted: Tue, 2016-09-06 02:07

Hi Loris,

CsrMeshEnableListening  is no longer in the CSRMesh 2.0 documentation.

Instead, I am now using CSRSchedEnableListening  which is to replace the previous function.

I am using the CSRMesh Switch application. I made the following changes to the original example:

1.       Disable watchdog timer.

2.       Change the DEFAULT_RX_DUTY_CYCLE to 2 (original is 5)

3.       Call CSRSchedEnableListening(FALSE) after assoicated in a network.

My aim is to reduce power consumption as much as possible. After make these changes, the CSR1010 seems to have some activity that is consuming high current at every 1 second interval. Please see the link below for the plot of current consumption over time.

http://i63.tinypic.com/jsy7ah.jpg

Do you know what activity  is causing this? What are the modifications required to make this happen less often? Last time with CSRMesh1.3, I was able to totally remove this by calling CsrMeshEnableListening(FALSE) and also setting this:

g_switchapp_data.bearer_data.bearerEnabled &= ~(BLE_GATT_SERVER_BEARER_MASK);      // I don’t know what this does, but it help to reduce current

 

Hope someone can help.

 

Cheers,

Kian

  • Up0
  • Down0
Loris
Join Date: 27 Jul 16
Posts: 35
Posted: Tue, 2016-09-06 02:36

Hi Kian,

   yes ,you can use CSRSchedEnableListening(false) to disable scan activity and use CSRSchedEnableListening(true) to enable scaning. I think the 1s is due to advertising. Try to comment CSRSchedStart() In the AppInit(). It should work. Check do you set the state to app_state_connected when it associated to a network to close the advertising.

  • Up0
  • Down0
Acutetech
Join Date: 29 Jul 16
Posts: 25
Posted: Sat, 2016-12-10 08:13

I used this discussion as an aid to looking at power on my own design. After some work I get c. 4.5uA while sleeping (1uA is possible in Dormant mode). Key points for me were disabling the UART and ensuring there is a pull-down on the SPI_PIO# pin as well as WAKE (the data sheet says there is one, but there seems not to be). For investigation I suggest creating a minimal hello, world project to test power consumption befopre going further. Here is the code in my main.c:

void AppInit(sleep_state last_sleep_state) {
    uint8 i;
    
#define UART_TX_PIO            (0)
#define UART_RX_PIO            (1)
#define PWR_PIO                (2)
#define CLOCKOUT_PIO        (11)
#define PIO_DIRECTION_INPUT (FALSE)
#define PIO_DIRECTION_OUTPUT (TRUE)
#define    UNUSED_PIOS            (0x7F8)        /* all except PIOs 0, 1, 2, 11 */
    
    /* route 16MHz osc to a pin to see when we sleep */
    PioSetMode(CLOCKOUT_PIO, pio_mode_ana_mon_clk_pio);
    PioSetAnaMonClk(pio_ana_mon_clk_16m);
    //PioSetAnaMonClk(pio_ana_mon_clk_32k);

    /* Initialise communications */
    DebugInit(1, uartRxDataCallback, NULL);
    
    /* a little code to keep us busy for a while before dropping into a low power state */
    
    for (i=0; i<100; i++) {
        DebugWriteUint16(i);    
        DebugWriteString(" Hello, world.\r\n");
    }
    /* I believe this is the default */
    SleepModeChange(sleep_mode_deep);

    /* Let's default to all PIOs being inputs with p.d.s */

    /* Set unused PIOs to user mode */
    PioSetModes(UNUSED_PIOS, pio_mode_user );
    /* Set unused PIOs direction as input */
    PioSetDirs( UNUSED_PIOS, PIO_DIRECTION_INPUT );
    /* Pull up/down unused PIOs to save power*/
    PioSetPullModes( UNUSED_PIOS, pio_mode_strong_pull_down );

    /* It seems to be essential to disable the UART to get low power */
    UartEnable(FALSE);

    /* Set the UART Tx, Rx PIO to user mode */
    PioSetModes( (0x01UL << UART_RX_PIO) | (0x01UL << UART_TX_PIO), pio_mode_user );
    /* Set the UART Tx, Rx PIO direction as input */
    PioSetDirs( (0x01UL << UART_RX_PIO) | (0x01UL << UART_TX_PIO), PIO_DIRECTION_INPUT );
    /* Pull up the pins high to save power*/
    PioSetPullModes( (0x01UL << UART_RX_PIO) | (0x01UL << UART_TX_PIO), pio_mode_strong_pull_up );
    /* Disable any events arising out of all PIOs */
    PioSetEventMask( 0xfff, pio_event_mode_disable );

    /* Remove power from EEPROM */
    NvmDisable();
    PioSetI2CPullMode(pio_i2c_pull_mode_strong_pull_down);

    /* The next line will put the chip into dormant state, which requires a high on WAKE to wake it.
     * Current is c. 1uA. All PIO pins go to 0V. */
    //SleepRequest(sleep_state_dormant, TRUE, 0 );
}

  • Up0
  • Down0
charles
Join Date: 27 Dec 16
Posts: 7
Posted: Mon, 2017-01-16 00:52

Hello, All

I hope control light system with switch model like remote controller. So, according to "kian" note, I tried to evalutate switch model on CSR1010 EVK with CSRMesh1.3 version.

I almost got the same result, but two events happens every 1 sec and 15 sec and idle current is 40uA. 

I really don't know how to down consumption current to below 10uA and elemenate  two events.

Anybody help me.

BR

Thanks.

 

 

 

  • Up0
  • Down0
aircable
Join Date: 8 Jun 16
Location: San Jose
Posts: 25
Posted: Thu, 2017-01-26 09:27

We got the CSR1012 running at much lower power consumption (<1uA). The trick is to pull SPI_PIO_SEL to GND.

We have a light switch with batteries, calculated and measured to 10 years life with two AAA. I have many of those in my house already.

Let me know if you want to cooperate. 

  • Up0
  • Down0
charles
Join Date: 27 Dec 16
Posts: 7
Posted: Thu, 2017-01-26 19:05

Thanks, aircable

I currently had board with CSR1010 to test idle current under mesh network such light node, switch node and controller(android phone).

The schematic I did is below.

http://i63.tinypic.com/35dbz91.jpg

And I followed the guide of "kian" and "Acutetech".

But I hadn't good result and had 40uA idle current and periodcally current consumption every 1sec, 15sec.

http://tinypic.com/view.php?pic=nqa2o6&s=9#.WIq4nBg69mA

BR

 

  • Up0
  • Down0
aircable
Join Date: 8 Jun 16
Location: San Jose
Posts: 25
Posted: Sun, 2017-01-29 14:01

Can't see anything wrong. Our modules are about the same. Check some different firmware, maybe it's the way you initialize the hardware. I also know that if you use the UART you will end up with MUCH higher base current.

The 15 seconds are from the watchdog, btw. The 1 sec is your code.

Can you tell me what tools you use to plot the power consumption. Looks like better stuff than we have. Link?

  • Up0
  • Down0
mforest
Join Date: 25 Nov 16
Posts: 2
Posted: Sun, 2017-01-29 18:14

I noticed that your LED is using reverse logic (output LOW to turn ON the LED). We found that this could often cause leakage current especially if you intend to use the Hibernate or Dormant sleep mode. These modes will disable the VDD_PADS and can create a leakage path thru your LED since your LED anode is connected 3V.
You can try removing your LED as a quick test and see if the current comes down. If this is the problem, the you can connect the LED anode to the PIO and the cathode to GND and drive the LED with positive logic (output HIGH to turn ON).

Best,
-Martin

 

  • Up0
  • Down0
jec
Join Date: 20 Nov 16
Posts: 2
Posted: Wed, 2017-05-10 02:55

Hi

I have the same problem on the Mesh2.1(CSR1024), I tried every method to reduce the power consumption, but failed:

1.      I stopped the MESH and connectable advertisement when the Switch is associated:

In function appProcessMeshEvent of core_mesh_handler.c, adding:

case CSR_MESH_ASSOC_COMPLETE_EVENT:

case CSR_MESH_SEND_ASSOC_COMPLETE_EVENT:

{

    ……

    AppHandleAssociationComplete();

    // If it is the switch model, disable the adv when it is assotiated.

p_mesh_hdlr_data->bearer_tx_state.bearerEnabled  &= ~(GATT_SERVER_BEARER_ACTIVE);

CSRmeshStop();                // See comment1

    CSRSchedEnableListening(FALSE);

}

   Comment 1: If CSRmeshStop(); is added here, the association will be stuck at 46%, (so question 1: why? )so I deleted this statement: ->

 

case CSR_MESH_ASSOC_COMPLETE_EVENT:

case CSR_MESH_SEND_ASSOC_COMPLETE_EVENT:

{

    ……

    AppHandleAssociationComplete();

    // If it is the switch model, disable the adv when it is assotiated.

p_mesh_hdlr_data->bearer_tx_state.bearerEnabled  &= ~(GATT_SERVER_BEARER_ACTIVE);  // See comment2

    CSRSchedEnableListening(FALSE);

}

Comment 2: this statement is used to stop the connectable advertisement:

In function GattTriggerConnectableAdverts of advertisement_handler.c,

{

#ifdef GAIA_OTAU_RELAY_SUPPORT

    if(!scanning_ongoing)

#endif  

    { 

    CSRSchedResult result = CSR_SCHED_RESULT_FAILURE;

    CSR_SCHED_ADV_DATA_T gatt_adv_data;

 

#ifndef DISABLE_BEARER_SETTINGS

    /* Bridge is disabled do not send user adverts */

    if(!IsGattBearerEnabled())    // This statement asserts the GATT_SERVER_BEARER_ACTIVE bit. See comment3

    {

        AppSetState(app_state_idle); 

        return;               // It skips the connectable advertisement.

}

……

}

 

comment3: The GattTriggerConnectableAdverts is triggered about every 1245ms: 

#define GATT_ADVERT_GROSS_INTERVAL   (1245 * MILLISECOND)

But when association is started even association is finished, it takes long time to trigger even doesn’t trigger (Not sure about this, as I waited for 10minutes, but maybe more than 10minutes,) this statement:

if(!IsGattBearerEnabled())    // This statement asserts the GATT_SERVER_BEARER_ACTIVE bit.

   {

        AppSetState(app_state_idle);

        return;              // It skips the connectable advertisement.

}

Because the GattTriggerConnectableAdverts is triggered by a timer (or an interrupt), so question 2: during this long time(no triggering time), what happened? Does something else hidden disable the interrupt ?

 

2.      When the association is finished, the MESH is also stopped, and the connectable advertisement is disabled, but the current is also as large as about 240uA, so I stopped the MESH when power on:

In function AppMeshInit of App_mesh_hander.c

   extern void AppMeshInit(void)

{

   …..

       AppUpdateBearerState(&g_mesh_handler_data.bearer_tx_state);

 

       /* Update the TTL value onto mesh stack */

       CSRmeshSetDefaultTTL(g_mesh_handler_data.ttl_value);

      }

     if(g_mesh_handler_data.assoc_state == app_state_associated)  // Stopped the MESH to save power.

     {

            CSRmeshStop();

           CSRSchedEnableListening(FALSE);

           SetScanDutyCycle(1);

     }

    }

    else

    {

        /* Registration has failed */

    }

}

When the association is finished, I reset the program, the current can go down to about 15uA, which is acceptable for us. But when I activated the MESH to be grouped( I start the WATCHDOG model in the PIO event ), the system resets unexpectedly but if I don’t restart the program, during the grouping/removing, it is OK.

so question 3: Is there anything wrong if I restart the program after the association is finished?

I can hardly get a technolegy support from CSR, I write a lot of emails, but always no reply, I wonder how can we get a solid technolegy support?!

Hope I can get help here. thank you! 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.