diff --git a/porting/examples/linux/main.c b/porting/examples/linux/main.c index 86b6fb955..a2e255d08 100644 --- a/porting/examples/linux/main.c +++ b/porting/examples/linux/main.c @@ -65,8 +65,8 @@ int main(int argc, char *argv[]) ble_hci_sock_set_device(atoi(argv[1])); } - ble_hci_sock_init(); nimble_port_init(); + ble_hci_sock_init(); /* This example provides GATT Alert service */ ble_svc_gap_init(); diff --git a/porting/examples/linux_blemesh/main.c b/porting/examples/linux_blemesh/main.c index 0913551e8..f5c5e4f04 100644 --- a/porting/examples/linux_blemesh/main.c +++ b/porting/examples/linux_blemesh/main.c @@ -77,8 +77,8 @@ int main(int argc, char *argv[]) ble_hci_sock_set_device(atoi(argv[1])); } - ble_hci_sock_init(); nimble_port_init(); + ble_hci_sock_init(); ble_svc_gap_init(); ble_svc_gatt_init(); diff --git a/porting/examples/nuttx/main.c b/porting/examples/nuttx/main.c index acfc9fcd1..82582573a 100644 --- a/porting/examples/nuttx/main.c +++ b/porting/examples/nuttx/main.c @@ -71,11 +71,12 @@ int main(int argc, char *argv[]) ble_hci_sock_set_device(atoi(argv[1])); } - printf("hci init\n"); - ble_hci_sock_init(); printf("port init\n"); nimble_port_init(); + printf("hci init\n"); + ble_hci_sock_init(); + /* This example provides GATT Alert service */ printf("gap init\n"); ble_svc_gap_init(); diff --git a/porting/nimble/src/nimble_port.c b/porting/nimble/src/nimble_port.c index 06b5f6df9..484e37995 100644 --- a/porting/nimble/src/nimble_port.c +++ b/porting/nimble/src/nimble_port.c @@ -30,6 +30,7 @@ static struct ble_npl_eventq g_eventq_dflt; extern void os_msys_init(void); +extern void os_mempool_module_init(void); void nimble_port_init(void) @@ -37,6 +38,7 @@ nimble_port_init(void) /* Initialize default event queue */ ble_npl_eventq_init(&g_eventq_dflt); /* Initialize the global memory pool */ + os_mempool_module_init(); os_msys_init(); /* Initialize the host */ ble_hs_init();