- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Folks,
I'm trying to get the most basic of BLE demos up and running with WICED on custom hardware. We're using a module that has a CYW4343W device on it.
I want to get custom service and characteristics going, completely failed writing my own code, so thought I'd have a go with ble_hello_sensor. If I understamd this correctly, this should advertise to a phone and I should be able to connect and see its custom charcteristc and be able to write/read those characteristics. However, I cannot make any headway on this. Took me a day of battling with WICED just to get it cimpiled and running, but I'm finding that:
hello_sensor_management_callback
Is never getting called so hello_sensor_application_init() is never getting called, which I guess is why it's not advertising, because that is where a lot of this setup seems to go on.
What causes hello_sensor_management_callback to get called? I have imported ble_hello_sensor into my project, I have not run the project as a stand alone program and very much doubt it's possible on custom hardware. I slightly modded the ble_hello_sensor.c file as blow
void ble_application_start( void )
{
const wiced_bt_cfg_buf_pool_t *wiced_bt_cfg_buf_pools;
wiced_bt_cfg_buf_pools = diplo_ble_config_get_config_buf_pool(); // Need to get these values form a different file
wiced_bt_cfg_settings = diplo_ble_config_get_config_settings();
// wiced_core_init(); //<-This is commented out as it's already been called
WPRINT_APP_INFO( ( "Hello Sensor Start\n" ) );
/* Register call back and configuration with stack */
wiced_bt_stack_init( hello_sensor_management_callback , wiced_bt_cfg_settings, wiced_bt_cfg_buf_pools );
}
I get these messages from the serial port/debugger we have setup.
Hello Sensor Start
00:00:00.035000 GKI_create_task func=0x8017191 id=1 name=BTU stack=0x0 stackSize=4096
00:00:00.038000 GKI_create_task func=0x80188cd id=0 name=HCISU stack=0x0 stackSize=3072
Would some one confirm what I am tryingf to do with ble_hello_sensor should do what I want and can any pooint me in the direction of how to get this working, why hello_sensor_management_callback is never getting called? I haven;t hacked the ble_hello_sensor.c code other than commenting out wiced_core_init() and adding the calls to get wiced_bt_cfg_buf_pools and wiced_bt_cfg_settings.
Many thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We've sorted it. There must be a hardware problem on that board as a different one works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi RoWo_4704901,
It is important to call wiced_core_init() at the start itself as it contains call to different functions for platform, RTOS initialization. Where are you calling it? I think that can be one reason because of which hello_sensor_management_callback is not getting called. Unless your management callback don't get called, device will not advertise and connect with client.
Have you configured correct buffer pools as that of wiced_bt_cfg.c? Also, please make sure that wiced buffer pools and its setting are getting called correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi SheetalJ_96
Many thanks for the reply.
As I said in the source code snippet, wiced_core_init() is already called which is why it is commented out.. I am calling it directly before ble_application_start is called.
On thing I do not understand at all is how you tell the BLE stack which UART is needs to talk to the module with. Where is this defined please? Can't find anything about this anywhere. I'm guessing if this is not set up properly it will never work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We've sorted it. There must be a hardware problem on that board as a different one works.