9 Replies Latest reply on Aug 9, 2015 10:52 AM by userc_13286

    Why wiced sense advertising stop before completing durations ?

      Hi everyone,



      I noticed that the wiced sense stops sending advertising sometimes after one or two seconds and do always complete the advertising durations of 10 seconds + 10 seconds.

      Test description:

      Note that there is no connection happening, as the connection stops the gpio interrupt and stops the led from blinking and make a buzz.

      The led keeps blinking, without packets sent, once it stops after 10+10 seconds, the wake up wakes it and another test of counting advertised packets start.


      Advertisement recapitulation:

      This is a reminder and also to chekc if I have something wrong.

      On wake up, the wiced sense tag will be sending advertisement at high rate for one duration, then at a lower rate for another duration.

      in the "wiced_sense_cfg" table:

      - high_undirect_adv_interval : 32 => 32 x 625 us => one every 20 ms

      - high_undirect_adv_duration : 10 => 10 seconds, so we would expect 500 advertisements during this period

      - low_undirect_adv_interval : 1024 => one every 640 ms

      - low_undirect_adv_duration : 10 seconds, so we would expect about 15


      Issue description and logs:

      1) High at 32 slots

      with 20 ms delay, the advertisements are very unsteady, and stop sometimes much sooner than expected. So for 500 packets expected, I made multiple retries and here is the list of how many I get every time :

      Number of Adv Packets received on every test







      Note that the advertisements were interrupted even after the run following the build without battery, so totally powered from usb, so I don't think this is a battery issue.


      2) High at 160 slots

      with 160 slots which take us up to 100 ms, the advertising is much more stable, but sometimes (once every two to three tests), I still get interruptions and no more advertising.

      The attached file adv_160_Good.txt, shows the good case, where no problems happen, just to confirm the numbers

      The attached file adv_160_Bad-Stop.txt, simply shows one example of when the advertising was stopped


      3) High at 320 slots

      everything is working fine


      Issue uncertainties:

      I would totally agree with any one criticizing this test as not using a billion euro official testing equipment, but a simple tool. However, statistically speaking, I made multiple crosss validations, used different devices, the tool might skip some packets, some times, but it is very unlikely that it get 100% of packets till time t, then 0% afterwards. And that is why I am asking for other opinions maybe some others have a better explanation.


      Reference binary:

      These deep tests were lead with a modified source, but a similar behavior was observed with all binaries, I hereby would ask if any binary can be used for reference. If I use an out of the box tag (I do have one), maybe someone will ask, no do the update, which update ?  My latest tests included wiced_sense.c.From_WICED_Sense_SDK 2.1_1.3Final and wiced_sense.c.From_WICED-Smart-SDK-2.2.1


      Thank you already for reading so far, your comments are appreciated.



        • 1. Re: Why wiced sense advertising stop before completing durations ?

          Hi userc_13286,


          So based on what you just posted, this doesn't seem like an Android problem anymore, more of your WICED sense kit itself. 


          Couple questions about your WICED sense kit:


          1. Have you tried a recovery step on your WICED sense kit? I'm a bit skeptical this will help but just wondering.

          2. Have you made any modifications to your WICED sense kit,such as removing the resistor for debug?

          3. Have you tried a different WICED sense kit? or are you just using 1 to do all the testing




          1 of 1 people found this helpful
          • 2. Re: Why wiced sense advertising stop before completing durations ?

            Hi kwang,


            I have so big trust in Broadcom that I bought 4 of them to start.

            So I do have one out of the box. I tried it, it was correctly advertising on all three channels during the full duration.

            When I tried it with the app, it asked me to update the firmware but I didn't want so that I keep it for reference.


            Back to the non working one, I admit it is a modified SW, I will attach it as soon as I figure out how.

            We can say that I mistreated it by connecting disconnecting multiple times, enable too much uart log that it might have drawn some current, so that it didn't work well when it was printing on uart, so I didn't kept it.

            I also did open it while the anti-static equipment is still not delivered, but I didn't modify anything in the HW.


            So current pending questions related to this issue :

            - if my used tag had any permanent failure ?

            - if, I use my modified SW on the new, it would have the same behavior ?

            - which SW version should I use as a reference, and if there is any debug/release configuration difference, and if possible to flash an unmodified binary you would provide, or if it has to be compiled ?


            Issue Update:

            with 320 slots, the problem totally disappears.



            - try the recovery step, on the old tag

            • 3. Re: Why wiced sense advertising stop before completing durations ?

              Haha thanks for trusting us so much.


              1) As for your WICED sense kit, I do not believe that it would cause any permanent failures, like you said on your todo list, best step would be to do a recovery step, try reloading the original FW on it and see if it is advertising properly, that way we can see if you actually do have a bad device. 

              2) I would try ^ first to see if the old tag is working properly, I think that would be a good way to see if it is the code or if it is the device itself. It would also be helpful to see your code.  To attach code, I think what most people do is Zip the file and then you can post it.

              3)  Not quite sure what you mean by SW version, if you are asking about the SDK version, I would go with 2.2.1


              However, if you are doing major developing I would recommend using a tag3.




              • 4. Re: Why wiced sense advertising stop before completing durations ?

                Hi Kevin,


                3) thanks for reminding basic points, well I started by retrying an unmodified SW from (WICED-Smart-SDK-2.2.1) and it was advertising correctly, so now I can debug this myself until I find the modif that makes it stop behaving correctly.

                1) So it does not have a permanent failure as you said (they're quite robust), but nevertheless I didn't manage to succeed the recovery procedure, it failed every time, it is not that important for now but just to be sure. In the video they show com 35 on top and 36 below, and they select 35. I do have com 5 on top and 4 under it, so should I select the smaller one or the one on top ? and what is the difference between both and how to identify which is which?

                2) I provided my modified source, you can have a look and make a diff, but you don't have to investigate, I'll have a look at it.


                I will consider the tag3, but current strategy is to target minor SW modifications and already a validation on the final platform which is the wiced_sense.




                • 5. Re: Why wiced sense advertising stop before completing durations ?

                  Hi userc_13286,


                  So I assume when you say that you didn't manage to recover you are getting an error similar to this recovery fail.PNG

                  2 causes I can think of on the spot is that you didn't perform the button pressing step correctly, (the one which involves cracking open the case and pressing down the reset and hitting the boot button)

                  the other cause is not having the right com port.  In your device manager, you should see something along the lines of sillicon labs.PNG


                  You need to pick the one with Enhanced.


                  Hope this helps,



                  • 6. Re: Why wiced sense advertising stop before completing durations ?

                    Hi Kevin,


                    thanks for the good quality of your support, I always believed into putting more images and formatting in wikis and forums, when printing images below, I found my mistake, I let you have a look at the images, then the answer is below*.


                    recovery Make Target.png


                    *You see then the result of messing AZERTY and QWERTY keyboards.


                    After that, the recovery was complete.


                    So I will now recheck my modified program, and I'll update this post as soon as I find the smallest difference that reproduces this issue of not sending advertising. Knowing that this issue is not blocking for me as I have the workaround of sending less advertising which I also think is better as it saves battery as long as it is working fine.



                    • 7. Re: Why wiced sense advertising stop before completing durations ?



                      kwang, thanks for mentioning me, when trying the solution recommended on that post, I found more hints :


                      • Every time the advertising packets from the wiced_sense stops, I find a capture packet with a different source address.
                      • It is a source address starting with 68:d9:3c and has multiple cases. Note that my correct wiced_sense kit address starts with 20:73:7a.
                        • Sometimes it stops with a packet having address 68:d9:3c, the CRC is correct.
                        • Sometimes it stops with a packet having address 68:d9:bc and I have a comment [malformed packet]
                        • Sometimes it stops with a packet having address, 68:d9:3f and then, only the CRC is detected as incorrect
                      • I repeated the test about six or seven times, I only get these foreign address malformed packets when the wiced sense is advertising. True, but also when making a walk around the test place, I managed to scan that foreign address with my phone when for sure the wiced_sense was not advertising.
                      • When the wiced_sense stops advertising, my capture do not get any foreign advertising detected. This is not confirmed.
                      • My capture device detects these foreign packets with meta info and with RSSI -96 or -97 while the wiced advertising is rather -66.


                      So the question is now, why is the wiced_sense intimidated by other advertising ? Is that a fair advertising policy to stop when collisions are detected ?


                      userc_14409, I tried your solution of wiced_sense_device_lpm_queriable() to deny sleep decisions, it didn't help for my case.



                      • 8. Re: Why wiced sense advertising stop before completing durations ?

                        Hello Wassim,


                        Have you checked to BD_ADDR of the each of the WICED Sense kits?


                        There is also a Crystal Warm Up Time workaround that you do in the cgs file:


                        ENTRY "PMU Crystal Warm up Time"


                           "Crystal warm up time" = 5000



                        ENTRY "I2C Speed"



                            "Speed" = "100 KHz"



                        See cgs file location here:



                        Hope this helps,




                        • 9. Re: Why wiced sense advertising stop before completing durations ?

                          Thank you jota_1939431 for your recommendation about the Crystal warmup, even if I did not note a difference, I assume that this is something influencing startup conditions, so I'm definitely going to keep it.


                          Regarding the answer to this question, the advertising was definitely interrupted by bluetooth noise coming from neighboring advertisers. Not any neighboring advertiser results in the wiced sense stopping advertising, but this lead to another investigation I am not going to lead because it is hardly reproducible.


                          Nevertheless for the use case I'm having, I switched to beacon mode where advertising has the useful data of temperature and so on, that has the advantages of

                          • minimizing the battery consumption considerably, as device does not need to stay connected or reconnect every time.
                          • Is much more robust in noisy environment.
                          • Can monitor an unlimited number of sensors not just 8.


                          Thank you again for your support