Nimble os_msys_init fail on multiple examples

FreyaRose
Posts: 4
Joined: Fri Sep 13, 2019 8:25 pm

Nimble os_msys_init fail on multiple examples

Postby FreyaRose » Mon Jul 25, 2022 7:33 pm

I am trying to use the Nimble examples for the Esp32S3 and the Esp32C3.

I am trying both the "ble_spp" and "bleprph" examples.

Both examples fail on this line:

Code: Select all

nimble_port_init();
The error is:
assert failed: os_msys_init_once os_msys_init.c:56 (rc == 0)
I believe this failing here :

Code: Select all

void
os_msys_init(void)
{
    os_msys_reset();

    (void)os_msys_init_once;
#if MYNEWT_VAL(MSYS_1_BLOCK_COUNT) > 0
    os_msys_init_once(os_msys_init_1_data,
                      &os_msys_init_1_mempool,
                      &os_msys_init_1_mbuf_pool,
                      MYNEWT_VAL(MSYS_1_BLOCK_COUNT),
                      SYSINIT_MSYS_1_MEMBLOCK_SIZE,
                      "msys_1");
#endif

#if MYNEWT_VAL(MSYS_2_BLOCK_COUNT) > 0
    os_msys_init_once(os_msys_init_2_data,
                      &os_msys_init_2_mempool,
                      &os_msys_init_2_mbuf_pool,
                      MYNEWT_VAL(MSYS_2_BLOCK_COUNT),
                      SYSINIT_MSYS_2_MEMBLOCK_SIZE,
                      "msys_2");
#endif
}
Has anyone seen this? Is there a workaround or something I am setting up incorrecly fo the Nimble port on these chips?

Thanks!

jeremy
Posts: 4
Joined: Tue Jan 15, 2019 11:36 pm

Re: Nimble os_msys_init fail on multiple examples

Postby jeremy » Wed Jul 27, 2022 5:51 am

I don't have a solution I'm afraid, but I have the same problem. Have you filed a bug on the esp-idf repo?

irahul
Posts: 36
Joined: Fri Jun 18, 2021 10:07 am

Re: Nimble os_msys_init fail on multiple examples

Postby irahul » Wed Jul 27, 2022 6:07 am

Hi @jeremy , @FreyaRose,

It looks like initial memory pool init itself has failed. Can you share some more information:
1. Which IDF branch you observing this issue on ?
2. Are there any other changes done with respect to configuration? If possible, please share your sdkconfig.

Thanks

makermatty
Posts: 1
Joined: Fri Aug 12, 2022 4:26 pm

Re: Nimble os_msys_init fail on multiple examples

Postby makermatty » Fri Aug 12, 2022 4:35 pm

Also came across this issue in nimble example.

os_msys_init_once os_msys_init.c:56 (rc == 0)

Code: Select all

I (209) cpu_start: cpu freq: 160000000
I (209) cpu_start: Application information:
I (209) cpu_start: Project name:     NimBLE_Test
I (209) cpu_start: App version:      32c0022-dirty
I (210) cpu_start: Compile time:     Aug 12 2022 18:20:30
I (210) cpu_start: ELF file SHA256:  6bd44ca39c78fa7e...
I (211) cpu_start: ESP-IDF:          4.4.1
I (212) heap_init: Initializing. RAM available for dynamic allocation:
I (212) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (213) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (213) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (214) heap_init: At 3FFC47A8 len 0001B858 (110 KiB): DRAM
I (214) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (215) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (216) heap_init: At 40094284 len 0000BD7C (47 KiB): IRAM
I (218) spi_flash: detected chip: generic
I (218) spi_flash: flash io: dio
Here is my sdkconfig of NIMBLE

Code: Select all


# CONFIG_BT_BLUEDROID_ENABLED is not set
CONFIG_BT_NIMBLE_ENABLED=y
# CONFIG_BT_CONTROLLER_ONLY is not set

#
# NimBLE Options
#
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y
# CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set
# CONFIG_BT_NIMBLE_LOG_LEVEL_NONE is not set
# CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR is not set
# CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING is not set
CONFIG_BT_NIMBLE_LOG_LEVEL_INFO=y
# CONFIG_BT_NIMBLE_LOG_LEVEL_DEBUG is not set
CONFIG_BT_NIMBLE_LOG_LEVEL=1
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3
CONFIG_BT_NIMBLE_MAX_BONDS=3
CONFIG_BT_NIMBLE_MAX_CCCDS=8
CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0
CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=y
# CONFIG_BT_NIMBLE_PINNED_TO_CORE_1 is not set
CONFIG_BT_NIMBLE_PINNED_TO_CORE=0
CONFIG_BT_NIMBLE_TASK_STACK_SIZE=4096
# CONFIG_BT_NIMBLE_ROLE_CENTRAL is not set
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
# CONFIG_BT_NIMBLE_ROLE_BROADCASTER is not set
# CONFIG_BT_NIMBLE_ROLE_OBSERVER is not set
CONFIG_BT_NIMBLE_NVS_PERSIST=y
CONFIG_BT_NIMBLE_SM_LEGACY=y
CONFIG_BT_NIMBLE_SM_SC=y
# CONFIG_BT_NIMBLE_DEBUG is not set
# CONFIG_BT_NIMBLE_SM_SC_DEBUG_KEYS is not set
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="spectoda"
CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31
CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=512
CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0
CONFIG_BT_NIMBLE_ACL_BUF_COUNT=20
CONFIG_BT_NIMBLE_ACL_BUF_SIZE=255
CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70
CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT=30
CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT=8
CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12
CONFIG_BT_NIMBLE_HS_FLOW_CTRL=y
CONFIG_BT_NIMBLE_HS_FLOW_CTRL_ITVL=1000
CONFIG_BT_NIMBLE_HS_FLOW_CTRL_THRESH=2
CONFIG_BT_NIMBLE_HS_FLOW_CTRL_TX_ON_DISCONNECT=y
CONFIG_BT_NIMBLE_RPA_TIMEOUT=900
# CONFIG_BT_NIMBLE_MESH is not set
CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y
CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000
# CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT is not set
# CONFIG_BT_NIMBLE_BLUFI_ENABLE is not set
CONFIG_BT_NIMBLE_USE_ESP_TIMER=y
# end of NimBLE Options
# end of Bluetooth

# CONFIG_BLE_MESH is not set

Btw, this is my first post ever to this forum

pyaillet
Posts: 1
Joined: Wed Aug 24, 2022 6:18 pm

Re: Nimble os_msys_init fail on multiple examples

Postby pyaillet » Wed Aug 24, 2022 6:26 pm

Hi !

I faced the same problem and was able to solve it by calling

Code: Select all

esp_nimble_hci_and_controller_init()
before

Code: Select all

nimble_port_init()
for esp-idf-4.4 as explained here : https://docs.espressif.com/projects/esp ... g-sequence

Hope that helps !

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 131 guests