When dynamically allocating BLE GATT services and characteristics using custom structures and Zephyr’s dynamic memory functions (e.g., k_malloc, k_calloc), the service registration using bt_gatt_service_register function reports success and the internal GATT database enumeration (via bt_gatt_foreach_attr) shows all attributes with correct UUIDs and permissions. However, the dynamically allocated service does not appear in external BLE scanning tools (e.g., nRF Connect for mobile).
Additional Notes:
The issue does not occur with statically defined services (using BT_GATT_SERVICE_DEFINE), but I'm asking about dynamic allocation and if there any example show steps of dynamic service allocation