You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Service re-registration leads to increasingly large allocs #896
hi! I'm from the MicroPython project. We provide a Python API around NimBLE, but we've run into a problem due to the fact that the Python program can be restarted without the board restarting. We do what we can (via the public API) to shutdown and reset NimBLE across these "program resets" but I've just noticed an issue that during service registration we see increasingly large calls to malloc() from ble_gatts_count_cfg().
The cause is that although we call gatts_reset(), nothing resets ble_hs_max_servicesble_hs_max_attrs and ble_hs_max_client_configs. I am currently working around this by resetting them from our code.
I think the feature we really want is a global "nimble_reset" function that clears/resets all global variables (i.e. zeros .bss variables and resets .data variables back to default values, as if the board has just restarted).
I understand this is a bit of a weird requirement -- not many implementors of NimBLE would need to register services more than once per hard reset, but would appreciate any suggestions. Thanks!
Reactions are currently unavailable
Activity
ghost added a commit that references this issue on Dec 22, 2020
Activity
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
extmod/nimble: Reset NimBLE BSS in mp_bluetooth_init.
nimble/host: reset resource counts in ble_gatts_reset()
nimble/host: reset resource counts in ble_gatts_reset()