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

Parents
  • Hi,

     

    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 pointers p_* are NULL, so the content is not valid as assertion info.

    The address of the assert, 0x83CC, is inside the softdevice flash area, and it is asserting on a check to see if you still have a connection.

      

    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 

      The SoftDevice interrupt handler (SD_EVT_IRQn / SD_EVT_IRQHandler) runs in the lowest priority (APP_IRQ_PRIORITY_LOWEST), and if a disconnect event occurs while you're in the timer interrupt handler, it will be serviced after the timer is done. It looks like there's a race condition. Is it expected that you get disconnected in this scenario?

     

    Kind regards,

    Håkon

  • Hi Håkon

    Thanks for your Help

    No there is no disconnection, I do not plan one and I don't see any such Disconnection occurring when I debug.

    The sd_ble_gatts_hvx apparently still causes the same problem when I compile on a 0 optimization level, If I optimize to level 3, the HardFault is avoided.

    As I said I am no longer calling the function from an interrupt, but rather via the scheduler 

    Any other ideas?

    Thanks!

  • Hi,

    I understand, if I remove the irq disable, the call stack only shows the following:

    And, no, I am not using it elsewhere.

    I now also observed that the order in which I add the characteristics is significant, when I initialize, if I add the notification characteristic after the a write characteristic , it fails, if the notification characteristic  initialize at first, it works. any idea why?

    How would you suggest to proceed?

    Thanks!

  • In another configuration of the project it does not go into Hardfault, but returns error code 0x0003 when calling for the sd_ble_gatts_hvx function

  • Hi,

     

    Ron said:
    In another configuration of the project it does not go into Hardfault, but returns error code 0x0003 when calling for the sd_ble_gatts_hvx function
    Ron said:

    I understand, if I remove the irq disable, the call stack only shows the following:

    And, no, I am not using it elsewhere.

    If you get a bit of different result with small changes of the application, it might point to a corrupted pointer or stack overflow.

    The second issue looks to be a null-pointer being executed.

     

    Can you try to increase the stack size (asm symbol __STACK_SIZE) to see if this still happens?

     

    Kind regards,

    Håkon

  • Hi,

    Do you mean as defined in arm_startup_nrf51.s

    IF :DEF: __STARTUP_CONFIG
    Stack_Size EQU __STARTUP_CONFIG_STACK_SIZE
    ELIF :DEF: __STACK_SIZE
    Stack_Size EQU __STACK_SIZE
    ELSE
    Stack_Size EQU 2048
    ENDIF

    Currently 2048? to what size stack should it be increased? what is the maximum?

    Kind regards and thanks!

  • Changes to the application code to change the effect on the sd_ble_gatts_hvx ,the error occurs when calling sd_ble_gatts_hvx which is a softdevice function, so, if the problem is a corrupted or null pointer, can I assume that it is a corrupted pointer that I have passed to the sd_ble_gatts_hvx function? throughout the code I have other notification service-characteristics without any issues.

    If the problem is a stack overflow, what is the best way to verify it?

    Thanks again

Reply
  • Changes to the application code to change the effect on the sd_ble_gatts_hvx ,the error occurs when calling sd_ble_gatts_hvx which is a softdevice function, so, if the problem is a corrupted or null pointer, can I assume that it is a corrupted pointer that I have passed to the sd_ble_gatts_hvx function? throughout the code I have other notification service-characteristics without any issues.

    If the problem is a stack overflow, what is the best way to verify it?

    Thanks again

Children
No Data
Related