embassy-rs / nrf-softdevice

Apache License 2.0
256 stars 76 forks source link

Switch examples to use default `gatts_attr_tab_size` ? #209

Closed plaes closed 7 months ago

plaes commented 7 months ago

Most (if not all) examples currently set attr_tab_size to 32768 bytes, which in some cases pushes softdevice's memory usage over 64k, making them unusable for nrf52832.

Default value for s132 is 0x580 == 1408 bytes (while minimum is 248 bytes), which cuts Softdevice's RAM requirement around ~30k for most cases.

Could we switch to use BLE_GATTS_ATTR_TAB_SIZE_DEFAULT or even BLE_GATTS_ATTR_TAB_SIZE_MIN instead?

-        gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t { attr_tab_size: 32768 }),
+        gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t {
+            attr_tab_size: raw::BLE_GATTS_ATTR_TAB_SIZE_MIN,
+        }),

cc: @lulf (same (copy-paste?) issue for your watchful project) :)

lulf commented 7 months ago

@plaes good catch, I think it makes sense for these examples.