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

Studio Bluetooth

user_2112781
Level 4
10 likes received 10 likes given 5 likes given
Level 4

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.

0 Likes
1 Solution
Anonymous
Not applicable

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

View solution in original post

5 Replies
JeGu_2199941
Level 5
25 likes received 10 likes received 10 likes given
Level 5

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?)

0 Likes
user_2112781
Level 4
10 likes received 10 likes given 5 likes given
Level 4

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

Anonymous
Not applicable

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


Thanks,
Dharam

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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