BCM20736S slow and inconsistent operation of the fast timer callback

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

cross mob
Anonymous
Not applicable

I am running a simple application on the BCM20736S, and I am hoping for a fast startup. I am not using BLE at all in my application for  now. It is a long story, but for the moment I am just using the fast timer callback, I2C, PUART and a some simple logic in the code.

My problem is that I see slow and inconsistent operation of the fast timer callback, especially at startup. It gets called a few times a second, sometimes once every few seconds. The rate is currently set to 10ms, which should give me 80Hz call rate for the best case. Here is my debug output where I simply print a counter value from the fast timer interrupt.

Hours:Minutes:Seconds - Counter

15:30:49 - 29

15:30:49 - 30

15:30:49 - 31

15:30:49 - 32

15:30:50 - 33

15:30:53 - 34

15:30:53 - 35

15:30:54 - 36

15:30:54 - 37

15:30:54 - 38

15:30:55 - 39

15:30:55 - 40

15:30:55 - 41

15:31:08 - 42

After I run for awhile, this slow behavior will sometimes go away, and sometimes not. When it is working well, I see a consistent 80Hz rate of timer callbacks. I am hoping for this behavior all the time.

My questions are:

1. Is there a way to turn off the BLE tasks (or other processor hungry tasks) that are keeping the fast timer callback from running? I have a simple application, so do not need BLE at this point.

2. Is this normal behavior for this part? Is there a way to improve it?

Thanks in advance,

     Aaron

0 Likes
1 Solution
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

If you keep your fine timeout above 12.5ms, you will maintain much more consistency in addition to the ability to enter sleep. You were likely experiencing issues as a result of contention between sleep and the timer. A possible second option is to utilize the patch called bt_clock_based_timer.h which allows for a much lower smaller interval than 12.5ms. Please see the patch for details of its use.

Jacob

View solution in original post

4 Replies
Anonymous
Not applicable

Hello Aaron,

1.  The BLE Tasks cannot be turned off.

2.  Which application did you start from in your test?

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi JT,

Thanks for your quick response.

My application was based on an I2C application, on the I2C temperature sensor, I think.

1. Is it possible to turn off the BLE receiver, so that it does not get any input over wireless?

2. Is it normal for the timer callbacks (fine and 1 second) to be inconsistently called during startup? I am seeing this behavior every time I startup, but sometimes it improves and sometimes it does not.

Thanks,

     Aaron

0 Likes
Anonymous
Not applicable

I am still interested in an answer to my question #1 above, but as for question #2:

The timer callbacks seem to be coming much more consistently now that I turned off sleep by the recommended method as:

    // Setup sleep control callback

    devlpm_registerForLowPowerQueries(preventSleep); // Where preventSleep() is a callback that returns 0

I am now getting consistent callbacks! This is critical for my application, and I can live with the greater draw on the battery.

-Aaron

0 Likes
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

If you keep your fine timeout above 12.5ms, you will maintain much more consistency in addition to the ability to enter sleep. You were likely experiencing issues as a result of contention between sleep and the timer. A possible second option is to utilize the patch called bt_clock_based_timer.h which allows for a much lower smaller interval than 12.5ms. Please see the patch for details of its use.

Jacob