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
Anonymous
Not applicable

Hi j.t,

How about this?

1. Please build a hello_sensor HEX image which you said it resolved the spike under SDK2.2.2.

2. Upload it to this thread and let me verify the image with the TAG03 in my side.

3. I will download it under my Windows 10 by ChipLoad.exe

If it really works, I will ask you to compress your SDK2.2.2 folder and have a diff check if there is something wrong with my environment.

Thanks.

0 Likes

I just tried this at home (at work we only use Windows 7) on my son's Windows 10, x64, Home Version machine and it worked without any issues.

Saved the new SDK to the desktop, then double-clicked the executable.

I have to admit that I was skeptical at first because I had spent hours on the same machine trying to get the previous version of the SDK to install with no luck, but the new version installed without a hitch.

There is nothing special about this machine other than it's an older Windows XP Dell unit that I recently upgraded to 10 when the free upgrade became available.  Java is the latest, version 8 - build 66.

I'm not sure why yours is hanging.

0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

Detail of my windows version as below:

Name: Microsoft Windows 10 PRO

Version: 10.0.10586 N/A build 10586

Hotfixes:

[01]: KB3103688

[02]: KB3116908

[03]: KB3122947

0 Likes
Anonymous
Not applicable

Hi, henryubnt:

     Did you install JAVA (32bits) installed and add the path(eg: C:\Program Files (x86)\Java\jdk1.7.0_80\bin) in your environment $PATH?

0 Likes
Anonymous
Not applicable

Hi, henryubnt:

     You may need to set the configuration for the builder, like below picture. The configuration is located in properties of the project. Those works for WCIED v2.2.1 and v2.2.2 on OSX environment. Thanks.

Screen Shot 2015-12-14 at 02.55.49.png

Anonymous
Not applicable

Hi forrest.chien & mwf_mmfae,

Thanks about the OS X importing help, you made me got 1 step more, but met another compile problem. Is there any other setting that either mentioned by the import tutorial? Below is my compile errors:

17:05:27 **** Build of configuration Default for project WICED-Smart-SDK-2.2.2 ****

/Users/henry/Documents/WICED/WICED-Smart-SDK-2.2.2/make hello_sensor-BCM920736TAG_Q32 download

dyld: Library not loaded: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/libperl.dylib

  Referenced from: /Users/henry/Documents/WICED/WICED-Smart-SDK-2.2.2/Wiced-Smart/spar/../../Tools/common/OSX/perl

  Reason: image not found

dyld: Library not loaded: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/libperl.dylib

  Referenced from: /Users/henry/Documents/WICED/WICED-Smart-SDK-2.2.2/Wiced-Smart/spar/../../Tools/common/OSX/perl

  Reason: image not found

dyld: Library not loaded: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/libperl.dylib

  Referenced from: /Users/henry/Documents/WICED/WICED-Smart-SDK-2.2.2/Wiced-Smart/spar/../../Tools/common/OSX/perl

  Reason: image not found

Compiling spar_setup.c

Compiling hello_sensor.c

Compiling sparinit.c

make[2]: *** No rule to make target `base'.  Stop.

make[1]: *** [../tier2/brcm/mandatory/bld//patch.symdefs] Error 2

make[1]: *** Waiting for unfinished jobs....

make: *** [hello_sensor-BCM920736TAG_Q32] Error 2

17:05:28 Build Finished (took 900ms)

Thanks.

0 Likes
Anonymous
Not applicable

Hi forrest.chien & mwf_mmfae,

After observing the err msg, I check my system and found there is no lib for perl 5.12, just 5.16 and 5.18.

WICED-Smart-SDK-2.2.2 henry$ ls /System/Library/Perl/

5.16 5.18 Extras

How do I solve this?

0 Likes
Anonymous
Not applicable

Hi, henryubnt:

     You may create a symbolic link to solve this issue: (Here is the reference: I installed WICED Smart IDE 2.1.1 on OSX Yosemite - Problems)

     # cd /System/Library/Perl

     # sudo ln -s 5.18 5.12

    

Forrest

Anonymous
Not applicable

Hi forrest.chien,

Thanks for the solution. Now I successfully compiled the image under OSX with SDK 2.2.2.

Then back to the fine timer problem.

I modified the code with below steps:

1. default_adv = 0 in hello_sensor_cfg

2. comment out the "bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE)" related code.

3. comment our the functions named with "Timer"

4. Add "APP_PATCHES_AND_LIBS += disable_sw_timer_as_wake_source.a" in makefile.mk

The TAG03 still has the spikes with it.

2.2.2_hello_sensor_OSX.png

If I un-comment the Timer related code, the spikes will become twice height.

Please help to check this.

Thanks.

0 Likes
Anonymous
Not applicable

Hello Henry,

Does your measurement indicate 700uA?

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

Not sure if you check the graph in above post or not. I show you by my marks:

2.2.2_hello_sensor_marked.png

You can see the average height of the spikes are about 700uA.

So I think the answer for your question is "YES"

Thanks.

0 Likes
Anonymous
Not applicable

Henry,

1.  What is the period of the spikes?

2.  They appear to be 500ms?

3.  The 700uA spikes are too small and are not from the Broadcom device.

4.  Where are you measuring this current?

5.  How do you measure current on the TAG3?

6.  If you are measuring on USB, then this has to do with the USB device

7.  A schematic will help us determine how you are measuring the current

8.  Chip is running - 3mA

9.  The 24MHz crystal is 400uA, but the crystal would NOT show spikes.

Hope this helps

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

Since we set the fine_timer=1000, the period is 1s. Honestly our power meter is not precise, so I am not sure if it is really 700uA or higher.

But one thing we can confirm that, if we change the fine_timer period, the spike will also change, so we can make sure it came from BCM20737.

The below test are using TAG03 with hello_sensor project:

TEST0: Originally we used the below code: (just show my modified part.)

const BLE_PROFILE_CFG hello_sensor_cfg =

{

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

    /*.default_adv                    =*/ 0,    // HIGH_UNDIRECTED_DISCOVERABLE

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

........


// Create hello sensor

void hello_sensor_create(void)

{

........

//    bleprofile_regTimerCb(hello_sensor_fine_timeout, hello_sensor_timeout);

//    bleprofile_StartTimer();

........

//    bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, hello_sensor_remote_addr);

}

Then the current graph like this--(700uA spikes in 1s period.)

01_No_timer_No_ADV.png

TEST1: Then we enable the Timer callbacks

const BLE_PROFILE_CFG hello_sensor_cfg =

{

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

    /*.default_adv                    =*/ 0,    // HIGH_UNDIRECTED_DISCOVERABLE

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

........

// Create hello sensor

void hello_sensor_create(void)

{

........

    bleprofile_regTimerCb(hello_sensor_fine_timeout, hello_sensor_timeout);

    bleprofile_StartTimer();

........

//    bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, hello_sensor_remote_addr);

}

The current graph will become higher--(From 1.5mA~5mA)

02_1_Timer_No_ADV.png

Zoom-in the graph--

02_2_Timer_No_ADV.png

TEST2: Let back to TEST0 to disable timer and advertising, just change the fine_timer_timeout

const BLE_PROFILE_CFG hello_sensor_cfg =

{

    /*.fine_timer_interval            =*/ 700, // ms

    /*.default_adv                    =*/ 0,    // HIGH_UNDIRECTED_DISCOVERABLE

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

........

// Create hello sensor

void hello_sensor_create(void)

{

........

//    bleprofile_regTimerCb(hello_sensor_fine_timeout, hello_sensor_timeout);

//    bleprofile_StartTimer();

........

//    bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, hello_sensor_remote_addr);

}

Here is the current spike graph--(700uA with 700ms period)

03_No_timer_No_ADV.png

TEST3: Now, change the fine_timer_timeout to 100ms

const BLE_PROFILE_CFG hello_sensor_cfg =

{

    /*.fine_timer_interval            =*/ 100, // ms

    /*.default_adv                    =*/ 0,    // HIGH_UNDIRECTED_DISCOVERABLE

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

........

// Create hello sensor

void hello_sensor_create(void)

{

........

//    bleprofile_regTimerCb(hello_sensor_fine_timeout, hello_sensor_timeout);

//    bleprofile_StartTimer();

........

//    bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, hello_sensor_remote_addr);

}

The current graph like below--(700uA with 100ms period)

04_No_timer_No_ADV.png

Do you get my point?

1. It seems the spike period related to fine_timeout setting.

2. The spike exist even the timerStart() and timerCB() was disabled.

Since I am using TAG03 (I have 4 pcs TAG03 and all the same result), and using the hello_sensor project. And you said the spikes are not from Broadcom device. Please tell me where are they from?

j.t: How about using TAG03 by yourself and using a better power meter to measure the current? (I use the COIN cell HW setting when testing.)

Thanks.

0 Likes
Anonymous
Not applicable

And you used the disable patch?

And before you build you did a clean?

JT

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

Hi j.t,

Of course,

1. Attached the source again for you reference. Please kindly check if I include the patch lib in the makefile correctly or not.

2. I double clicked "clean" in Make Target when doing the above tests each time. Is there other way to make it more clean?

Thanks.

0 Likes

Hi Henry,

This may not apply to you, but you may want to look into the power source, some of my boards didn't respond to the disable fine timer patch until I had reprogrammed them, did a SDA/ reset and switched the power supply from USB to battery.

-AN

0 Likes
Anonymous
Not applicable

Hi anavalgund,

Thanks for updating

1. About the SDA/reset, did you mean you used the "Recovery Mode" for re-programming?

2. How is your "Make Target" command line looks like? Currently mine is like below--

hello_sensor-BCM920737TAG_Q32 download

Thanks.

0 Likes

1. Yes for the boards which were having an issue, I did a recovery mode by holding the SDA to ground at first connect of the USB power and then downloading the code.

2. We have a modified heart_rate_monitor and we use the 20736S Module chip so ours is similar to what you have :  heart_rate_monitor-BCM920736TAG_Q32 download.

you can of course similarly create a Make Target for any folder you have in the Apps folder.

There is another patch related to advertisement you can try in the Makefile ( I am not sure what is entailed in that though)

APP_PATCHES_AND_LIBS += disable_sw_timer_as_wake_source.a

#APP_PATCHES_AND_LIBS += additional_advertisement_control.a

Thanks,

AN

0 Likes
Anonymous
Not applicable

Hi anavalgund,

Thank you for the information, I am still no luck to solve the problem.

j.t, is there any difference between download mode and recovery mode of BCM20737? I mean if the recovery mode of ROM code allow to program extra data for the patches or something?

Thanks.

0 Likes