This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK11: Error 4 when calling ble_dfu_init()

I have an application with my own custom service with a 128-bit UUID (including 4 characteristics). The application has worked so far. Now I try to add DFU service support to my application.

But when calling ble_dfu_init() I get error 4.

I tried to increment p_ble_enable_params->common_enable_params.vs_uuid_count to 2 (in softdevice_enable_get_default_config)

But that doesn't solve the problem. Someone can help me Thanks

Parents
  • The new softdevices support dynamic RAM allocation, which means that you need to allocate more RAM memory if you add additional services to the examples. This is described in more detail in the migration document included with the softdevice.

    In addition to increasing the size of the GATT table (might not be required) you also need to increase the UUID buffer count by increasing the .vs_uuid_count to the number of UUIDs you are using.

    E.g.,

    ble_enable_params_t ble_enable_params;
    
    err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,    
                                                    PERIPHERAL_LINK_COUNT,
                                                    &ble_enable_params);
    
    APP_ERROR_CHECK(err_code);
    
    ble_enable_params.common_enable_params.vs_uuid_count = NUMBER OF UUIDs;
    

    Note that sd_ble_enable returns the app RAM base that should be used with current configuration.

    Update:

    Have you tried to increase the size of the GATT table as well?

Reply
  • The new softdevices support dynamic RAM allocation, which means that you need to allocate more RAM memory if you add additional services to the examples. This is described in more detail in the migration document included with the softdevice.

    In addition to increasing the size of the GATT table (might not be required) you also need to increase the UUID buffer count by increasing the .vs_uuid_count to the number of UUIDs you are using.

    E.g.,

    ble_enable_params_t ble_enable_params;
    
    err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,    
                                                    PERIPHERAL_LINK_COUNT,
                                                    &ble_enable_params);
    
    APP_ERROR_CHECK(err_code);
    
    ble_enable_params.common_enable_params.vs_uuid_count = NUMBER OF UUIDs;
    

    Note that sd_ble_enable returns the app RAM base that should be used with current configuration.

    Update:

    Have you tried to increase the size of the GATT table as well?

Children
Related