How to really disable fine timer in BCM20737?

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

cross mob
Anonymous
Not applicable

Currently we have fine timer interval defined as 250ms like below:

const BLE_PROFILE_CFG ir_sensor_cfg = {

    /*.fine_timer_interval            =*/250,   // ms 12-1000

.......

For a test, we comment out our timer callback reg like below:

//    bleprofile_regTimerCb(sensor_fine_timeout, sensor_timeout);

//    bleprofile_StartTimer();


And we can observe the mini pulse every 250ms

PIR_on_PIRHW.png

Please check the red arrow, the small pulse means the 250ms fine timer is still counting, if we change the fine_timer_interval = 0, the base current will move to 6mA. Seems not the correct way to disable it.

If we change the fine timer interval to 1000ms, the period will become 1 second, but we didn't use the fine timer now!

So please kindly tell us how to disable the fine timer in real to prevent the pulse.

Thanks.

0 Likes
58 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received
0 Likes
Anonymous
Not applicable

Hi Boont,

I made a focus test about this, in my sensor_create function()

Disable the timer callback and set the sensor_cfg like below:

const BLE_PROFILE_CFG sensor_cfg = {

    /*.fine_timer_interval            =*/250,   // ms 12-1000

    /*.default_adv                    =*/0,    // NO_DISCOVERABLE

    /*.button_adv_toggle              =*/0, // pairing button make adv toggle (if 1) or always on (if 0)

.........

};

void sensor_create(void) {

.........

//    bleprofile_regTimerCb(sensor_fine_timeout, sensor_timeout);

//    bleprofile_StartTimer();

.........

}

The Power Meter record the pulse like below:

250ms.png

Then Change the fine timer interval to 1000ms like below:

const BLE_PROFILE_CFG sensor_cfg = {

    /*.fine_timer_interval            =*/1000,   // ms 12-1000

    /*.default_adv                    =*/0,    // NO_DISCOVERABLE

    /*.button_adv_toggle              =*/0, // pairing button make adv toggle (if 1) or always on (if 0)

.........

};

void sensor_create(void) {

.........

//    bleprofile_regTimerCb(sensor_fine_timeout, sensor_timeout);

//    bleprofile_StartTimer();

.........

}

The observed graph like below:

1000ms.png

It seems if there is a value in fine_timer_interval, not matter you call StartTimer or not, the timer still work. But there is not right to set fine_timer_interval=0 (The base current will raise 3 more mA) That's why I ask how to REALLLY stop the SW timers. Any other suggestion? Or there is something I forgot to call for turn OFF the timers?

0 Likes
Anonymous
Not applicable

Below is the graph I set fine_timer_interval = 0

0ms.png

0 Likes

There are some discussion on how to turn off those timers. Let me know if it helps...

Turning off the timers in BCM20736S

0 Likes
Anonymous
Not applicable

Hi Boont,

Unfortunately I didn't make it work by those suggestions. There always are spikes even I set the fine timer interval = 1000ms.

and comment the timer start function like below:

//    bleprofile_regTimerCb(sensor_fine_timeout, sensor_timeout);

//    bleprofile_StartTimer();

Any other suggestion?

0 Likes
Anonymous
Not applicable

Henry,

We have talked with the developers and they have said that there will be a patch in the next version of the SDK (2.2.2) that will fix this problem.

-Lucy

0 Likes
Anonymous
Not applicable

Hi Lucy,

Thanks for the response, here is a feedback from my testing.

If I set the start timer function, the spike will be higher than if I never call the StartTimer(). I think it works but not works properly.

I will close this issue until I got the fix with latest SDK. Thanks.

0 Likes
Anonymous
Not applicable

Hi Lucy,

Please kindly ask developers to release the MAC version first, I got a lot of trouble to install the SDK under Windows 10 env and gave up.

Thanks.

0 Likes

Can you install this older version for the Mac: WICED-Smart-SDK-2.0.1-IDE-Installer.pkg

Then use these instructions: How to Import a New SDK into an Existing WICED Smart IDE

To install the current version via the .zip file here: WICED-Smart-SDK-2.2-IDE-Installer.zip

0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

I mean the SDK (2.2.2) Lucy mentioned, which will have the fine timer spike fixing. Currently I am using 2.1.1 under Mac OS X and works well.

Thanks.

Yes, a (.7z) version would also be equally appreciated, I believe we could install the SDK 2.2.2 with the (.7z) in our existing WICED Smart IDE on the Mac.

0 Likes
Anonymous
Not applicable

Dear all,

Thank you for the replying, so when is the schedule about the SDK 2.2.2 release?

0 Likes

SDK 2.2.2 has been released to SVT, so it should be released to production soon.

0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

We will have a production run in next month, this issue become urgent now. When will the SDK 2.2.2 be release?

Please kindly provide the correct upgrade step once it released. My currently SDK is 2.1.1, MAC version.

Thanks.

0 Likes

We are optimistic that SDK 2.2.2 will be released shortly; We are close.

I am not sure if the OSX version will also be updated/tested, but there will be a .7z version, so you should be able to use these instructions to upgrade your existing OSX install: How to Import a New SDK into an Existing WICED Smart IDE

If not, the Windows version of SDK 2.2.2 will support Win 8-10.

manojch victorz j.t

Anonymous
Not applicable

Hi mwf_mmfae,

Thank you for updating, if the Windows version will be released first, please note SDK team to support 64 bit OS. Currently we are all stuck at this point. You can check the related discussion in this forum.

0 Likes

Hi mwf_mmfae,

Similar to Henryubnt, we have a production run that we need to get going on and we are waiting for the SDK 2.2.2.  The major issue we are hoping will get solved with the new SDK is the unexplained resets/disconnects that we observe when programmed with the SDK 2.2.0/SDK 2.2.1. The difference between SDK 2.2.0 and SDK 2.2.1 is that with SDK 2.2.0  we don't see the disconnects but we see unexplained resets. SDK 2.2.2 is proposed to resolve that. We have run several experiments and know that these resets/disconnects are causing a significant loss in our battery lifetime up to 20%.  The 20% is critical for the product. Please do convey the urgency.

Thanks,

Anand

0 Likes
Anonymous
Not applicable

Hi anavalgund,

I will suggest not using the SDK for the production directly. You can use the utilities in the SDK. Though there is no documentation to talk about it, I think your local FAE may has some support about this. (Well, I thinks this service may need to be confirmed by mwf_mmfae or somebody from Broadcom. Sorry~)

0 Likes

anavalgund henryubnt

I checked with the developers last night and they are targeting the SDK 2.2.2 release for middle to late next week.

0 Likes

Thanks mwf_mmfae for the update.

Henry, To clarify we are building a small number of patches now and these will get programmed through the SDK. Once we are happy with its performance primarily the disconnect/reset issues, then we will get them built in larger numbers and in that case we will definitely go a different route (command line + BD_ADDR assignment as has been suggested in the Factory Production page and not through the SDK). Did you have something else in mind ?

0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

I have try it about 5 times, my system is Windows 10 PRO 64bit. The installer didn't work and the file manager will become forever sandglass...

0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

BTW, how to use the 7z version of SDK 2.2.2?

Any tutorial can step by step tell me how to use it?

Thanks.

0 Likes

This method relies on you already having an Eclipse IDE to install the new SDK into on the machine.

How to Import a New SDK into an Existing WICED Smart IDE

Anonymous
Not applicable

Hi forrest.chien and mwf_mmfae,

I passed the installation, share with you below:

1. Disable "Windows SmartScreen Filter" in the security of control panel.

2. Disable Antivirus protection temporality.

3. Run installer.

You even don't need to install the JRE this time, I removed and forgot to install the one you mentioned, but the installation still passed. Seems the SDK contain it own.

Still pity that the 7z version only has windows and Linux version, the OS X is not ready in the compression package.

I will continue the topic main line without talking about the installation.

Thanks.

0 Likes
Anonymous
Not applicable

Hi, henryubnt:

   I will show you how to import the SDK into previous Eclipse in OSX environment.

0 Likes
Anonymous
Not applicable

Hi all,

After j.t's suggestion from below thread:

Re: OOB sample code of SDK 2.2.1,SDK 2.2.0 and SDK 2.1.0

I modify the makefile as below:

########################################################################

################ DO NOT MODIFY FILE BELOW THIS LINE ####################

########################################################################

APP_PATCHES_AND_LIBS += disable_sw_timer_as_wake_source.a

But the spike still the same, should I add some more flag or option to enable the lib?

2.2.2.png

Thanks.

0 Likes
Anonymous
Not applicable

Make sure that you do a clean first - it didn't work for me either the first time.

We just sent it to another customer and it worked

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

I did clean every build, you mentioned it didn't work for you either at the first time. What did you do for solve it? Just clean? Which project you did? I am now back to verify the lib with hello_sensor and your TAG03 board to see if it's still not work.

Thanks.

0 Likes
Anonymous
Not applicable

I just did a clean and did a build.

I was using hello sensor with SDK 2.2.2

Make sure that your build included the patch.

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

Just double check with you the Makefile of hello_sensor:

#

# Copyright 2015, Broadcom Corporation

# All Rights Reserved.

#

# This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;

# the contents of this file may not be disclosed to third parties, copied

# or duplicated in any form, in whole or in part, without the prior

# written permission of Broadcom Corporation.

#

########################################################################

# Add Application sources here.

########################################################################

APP_SRC = hello_sensor.c


########################################################################

################ DO NOT MODIFY FILE BELOW THIS LINE ####################

########################################################################

APP_PATCHES_AND_LIBS += disable_sw_timer_as_wake_source.a

Should I have any other modification to the hello_sensor.c?

Thanks.

0 Likes
Anonymous
Not applicable

No your make file is correct.

JT

0 Likes
Anonymous
Not applicable

What does your scope show AFTER your HIGH Advertising rate.

Do you see the 1 second fine timer.

Did you set your fine timer to "1000" in the code?

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

The graph I post 2 hours ago is measure through our customized board. Which is:

1. No advertising.

2. Set the fine timeout = 250ms

3. No timer CB and timer start.

Thanks.

0 Likes
Anonymous
Not applicable

Hi j.t,

I have clean and rebuilt the target to be one second fine timeout. No advertising, no timer callback reg, no start the timer. But we can still see the spike every 1 second.

Here is the BLE_PROFILE_CFG

const BLE_PROFILE_CFG iot_sensor_cfg = {

    /*.fine_timer_interval            =*/1000,  // ms 12-1000

    /*.default_adv                    =*/0,    // NO_DISCOVERABLE

    /*.button_adv_toggle              =*/0, // pairing button make adv toggle (if 1) or always on (if 0)

    /*.high_undirect_adv_interval    =*/160,  // 160 slots = 100ms

    /*.low_undirect_adv_interval      =*/1600, // 1600 slots = 1s

    /*.high_undirect_adv_duration    =*/2,  // seconds

    /*.low_undirect_adv_duration      =*/300,  // seconds

    /*.high_direct_adv_interval      =*/0,    // seconds

    /*.low_direct_adv_interval        =*/0,    // seconds

    /*.high_direct_adv_duration      =*/0,    // seconds

    /*.low_direct_adv_duration        =*/0,    // seconds

2.2.2_1sec.png

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

Hi j.t,

Below is the test with the TAG03 board using hello_sensor in SDK 2.2.2. It also has the spikes like our board. All my modification is just disabled the adv, disable the timer.

The measured current like below:

2.2.2_hello_sensor.png

Also attached the hello_sensor.c, hello_sensor.h and makefile for you test in your side.

Thanks.

0 Likes
Anonymous
Not applicable

Hello Henry,

FYI - We are running SDK 2.2.2 on a Windows machine

1.  Your make file is correct.

2.  Make sure you are including the library file in the list file or .asm file:

../tier2/brcm/libraries/lib/20736/disable_sw_timer_as_wake_source.a(disable_sw_timer_as_wake_source.o

  ../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/lib_installer.o (install_patch_lm_ostimer_getTimeToSleep)

3.  We also added a KillTimer() function, but found out that it wasn't needed.

void hello_sensor_timeout(UINT32 arg)

  ble_trace1("hello_sensor_timeout:%d\n", hello_sensor_timer_count);

  switch(arg)

  case BLEPROFILE_GENERIC_APP_TIMER:

  break;

  }

  bleprofile_KillTimer();

Hope this helps

JT

0 Likes
Anonymous
Not applicable

Hi j.t,


I am also running SDK 2.2.2 on Windows 10 PRO, brand new installation.

#2: I have this line in my "A_20736A1-hello_sensor-rom-ram-spar.list":(Line3)

../tier2/brcm/libraries/lib/20736/disable_sw_timer_as_wake_source.a(disable_sw_timer_as_wake_source.o)

                              ../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/lib_installer.o (install_patch_lm_ostimer_getTimeToSleep)

#3: It seems the KillTimer() didn't have any help about it, should I include any header for the disable library? The below graph is the measure with KillTimer in hello_sensor_create()

2.2.2_hello_sensor_KillTimer.png

Thanks.

0 Likes