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

softdevice error code 0x0000000D1

Hi all

I am using S130 SDK12, nRF51822 

This is the error I am getting - line_num 0x07C0, p_file_name 0x06D1, error code 0x00D1, fault id 0x0001, pc 0x83CC (a print-screen from the debugger is also below)

The error occurred repeatedly in the same scenario

I added a notification characteristic to an existing custom service, and when the central subscribe to the notification and it is being sent the error occurs.

The error occurs only when I compile with optimization (I optimized to level 3)

The notification was sent (using sd_ble_gatts_hvx) from a function invoked by at timer interrupt (timer_timeouts_check()), so I changed it to be sent from the event scheduler, and this apparently resolved the issue, partly, I still wish to 

1. Understand what happened, to assure the problem or bug is not still hiding somewhere

2. Return to my original implementation simply because it saves me important flash memory. 

Would appreciate any help

Thanks

  • Hi,

      

    Ron said:

    I think I found the problem, it was in the definition and creation of the notification characteristic, specifically I had the following configuration ble_add_char_params.is_value_user = 1 

    is_value_user was configured as 0x01, when calling characteristic_add  that resulted at attr_md.vloc to be configured as 0x02, meaning BLE_GATTS_VLOC_USER, before passing it to sd_ble_gatts_characteristic_add

    BLE_GATTS_VLOC_USER - Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack will read and write directly to the memory using the pointer provided in the APIs.

    When I set it is_value_user to 0x00, vloc was set to 0x01 - BLE_GATTS_VLOC_STACKattribute Value is located in stack memory, no user memory is required. 

    Good work on finding this issue! I am very glad to hear that  its working as expected now.

    Cheers,

    Håkon

Related