Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

br10101
Posts: 15
Joined: Thu Nov 24, 2022 11:08 am

Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby br10101 » Tue Sep 17, 2024 8:50 am

I am trying to set up multiple advertisements using NimBLE on ESP32-C3 but I receive error 0x207 (BLE_ERR_MEM_CAPACITY) when I set up the third advertising. I have set the following configuration:

CONFIG_BT_NIMBLE_EXT_ADV=y
CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=4

Using ESP-IDF v5.1.5. The example ble_multi_adv runs fine, but I am using many more resources (GATT server, BLE scanning, wifi, etc..).

Do I need to increase memory somewhere? Any hints?

br10101
Posts: 15
Joined: Thu Nov 24, 2022 11:08 am

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby br10101 » Tue Sep 17, 2024 12:31 pm

It seems to have to do with the advertising parameters (ble_gap_ext_adv_params).

Is there a limit to the combinations of connectable, scannable, and legacy_pdu combinations?

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

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby irahul » Tue Sep 17, 2024 12:36 pm

Can you share your sample application or console log to narrow down which function is returning this error. Also, can you share your complete sdkconfig ?

MicroController
Posts: 1736
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby MicroController » Tue Sep 17, 2024 1:37 pm

You can try and change the "Memory Settings" for NimBLE via menuconfig, e.g. adding more "blocks" to one or more of the memory pools.

br10101
Posts: 15
Joined: Thu Nov 24, 2022 11:08 am

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby br10101 » Wed Sep 18, 2024 8:36 am

The function returning the error is ble_gap_ext_adv_start(). I attached the sdkconfig.
Attachments
sdkconfig.txt
(62.4 KiB) Downloaded 95 times

br10101
Posts: 15
Joined: Thu Nov 24, 2022 11:08 am

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby br10101 » Wed Sep 18, 2024 8:42 am

I doubled MSYS_1 Block count from 24 to 48 and MSYS_2 Block count from 32 to 64 without any success

br10101
Posts: 15
Joined: Thu Nov 24, 2022 11:08 am

Re: Multiple advertisements out of memory (BLE_ERR_MEM_CAPACITY)

Postby br10101 » Wed Sep 18, 2024 12:31 pm

I could solve this by setting CONFIG_BT_CTRL_BLE_MAX_ACT=9

I wonder why 9? I would assume I need 7: 4x adv + 1x scan + 1x central + 1x periph

Who is online

Users browsing this forum: Majestic-12 [Bot] and 52 guests