5 Replies Latest reply on Nov 22, 2016 2:19 AM by duduc_2128361 Branched to a new discussion.

    [BLE] wiced_bt_stack_init gets stucks

    user_2112781

      Sometimes the function wiced_bt_stack_init will not call my management callback function. The last output I see is:

       

      00000119 GKI_create_task func=0x4ada75  id=1  name=BTU  stack=0x0  stackSize=6144

      00000126 GKI_create_task func=0x4aef21  id=0  name=HCISU  stack=0x0  stackSize=4096

       

      But that's it, if I reboot the board it might work as usual, I get this issue around 20% of the time.

       

        • 1. Re: [BLE] wiced_bt_stack_init gets stucks
          JeGu_2199941

          What platform are you using?
          Can you check what you got at BTM_ENABLED_EVT?

          (maybe my post bluetooth stack init  is related to this one?)

          • 2. Re: [BLE] wiced_bt_stack_init gets stucks
            user_2112781

            I don't get any BTM_ENABLED_EVT event, the stack just doesn't call my callback at all.

            1 of 2 people found this helpful
            • 3. Re: [BLE] wiced_bt_stack_init gets stucks

              user_2112781  Can you provide details like platform/board, sdk-release being used etc?


              Thanks,
              Dharam

              • 4. Re: [BLE] wiced_bt_stack_init gets stucks

                I also encountered this issue, SDK 4.0.7.58, 20719-B0_Bluetooth.

                I created a new project through WICED Bluetooth Desginer by default with LE only mode, added a specific test service and characters for testing. After generated the code, I just set the debug_uart to PUART, and add the log before and after wiced_bt_stack_init() the function, and also at the start of the *_management_callback() callback function that input to wiced_bt_stack_init() function.

                After build, burn and run the image to the BCM920739EVAL2_0 board, I get the output log before and after the wiced_bt_stack_init() function, and check the return value of wiced_bt_stack_init() is 0. But the *_management_callback() callback function was not executed at all, the log message added at the start of the *_management_callback() callback function not output at all event after several times reset.

                Noramlly, the BTM_ENABLED_EVT event should be transfered into the *_management_callback() callback function after the BLE stack initialized. Though it returns 0 indicates success, but indeed the BLE stack seems has been out of work at that time.

                BTW, I built and burned the hello_sensor project image to the development board, it worked fine.

                 

                Thanks,

                Dudley

                • 5. Re: [BLE] wiced_bt_stack_init gets stucks

                  For SDK 4.0.7.58, 20719-B0_Bluetooth, the root cause of the no BTM_ENABLED_EVT issue I encounted was because the value of the maximum bumber of buffer pools was default set to 0 (uninitialized) in the wiced_bt_cfg_settings data structure when it was automatically generated.

                  We must manually add the code to set the value for .max_number_of_buffer_pools in wiced_bt_cfg_settings as below.

                  const wiced_bt_cfg_settings_t wiced_bt_cfg_settings =

                  {

                       ...

                       /* LE Address Resolution Database Settings */

                       .addr_resolution_db_size =    10,

                       ...             

                   

                  +     /* Maximum number of buffer pools */

                  +     .max_number_of_buffer_pools = 4,

                  }

                  After set the value of .max_number_of_buffer_pools, the application worked fine. :-)

                   

                  Thanks,

                  Dudley

                  2 of 2 people found this helpful