BT central sample has the following code
-------------------------
BT central sample has the following code
Update
1. Calling bt_enable from a thread crashes the program - is this expected?
2.Enabled logging, called from main thread, see this message after bt_enable
[00:01:03.757,263] <inf> sdc_hci_driver: SoftDevice Controller build revision:
0e e7 c5 66 67 18 3c ac b3 d2 cc 81 a3 dc f1 c0 |...fg.<. ........
c0 36 02 22 |.6."
[00:01:03.763,702] <inf> bt_hci_core: No ID address. App must call settings_load()
Perhaps this is a clue.
Any ideas?
Thanks
Thread was defined as follows
Hi Andy,
Could you provide a simplified example that we can test here ?
I tried with the ble_peripheral_lbs_coex and didn't see the issue.
I replaced main() function with this:
#define STACKSIZE 1024 void ble_write_thread(void) { int err; printk("Thread..\n"); err = bt_enable(bt_ready); if (err) { printk("Bluetooth init failed (err %d)\n", err); } } void blink_LED(void) { for (;;) { printk("LED\n"); k_sleep(K_MSEC(1000)); } } K_THREAD_DEFINE(ble_write_thread_id, STACKSIZE, ble_write_thread, NULL, NULL, NULL, 7, 0, 0); K_THREAD_DEFINE(blink_LED_id, STACKSIZE, blink_LED, NULL, NULL, NULL, 7, 0, 0);
Hi Andy,
Could you provide a simplified example that we can test here ?
I tried with the ble_peripheral_lbs_coex and didn't see the issue.
I replaced main() function with this:
#define STACKSIZE 1024 void ble_write_thread(void) { int err; printk("Thread..\n"); err = bt_enable(bt_ready); if (err) { printk("Bluetooth init failed (err %d)\n", err); } } void blink_LED(void) { for (;;) { printk("LED\n"); k_sleep(K_MSEC(1000)); } } K_THREAD_DEFINE(ble_write_thread_id, STACKSIZE, ble_write_thread, NULL, NULL, NULL, 7, 0, 0); K_THREAD_DEFINE(blink_LED_id, STACKSIZE, blink_LED, NULL, NULL, NULL, 7, 0, 0);