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

Hardfault happening in the SDK with BLE

I understand there is a hard fault happening in the SDK.

I am using SDK 15.3.0, I am not on a sdk example, but on a specific program I am doing I can't share.

It happens a few seconds after BLE connection. Not all the time, just one time out of many.
I just added prints to understand, and it seems : "nrf_section_iter_get(&iter);" returns a bad address :

The log, and The stack in attached zip file (I cant post image ?) : LogStack.zip

I did not look further because I realised nrf_section_iter is in an "experimental_section_var" repertory ... so I imagine it is not mature ...

But there is no any stable version in the SDK ?

Regards,

Parents
  • Hi,

     

    The sections are located in RO data (ie: in flash), and the section_var library would then fetch a pointer to these and execute it.

    Since you see a corruption in the p_observer (thus, possibly the "iter" variable), it points to a stack corruption of some kind.

    Q1: Do you have a log / picture of the cpu registers when this occurred? In your screenshot, I am not seeing the SP (R13) content.

    Since this occurs quite early in the process, it might not be a stack corruption, but a free running pointer (array going out-of-bounds or something) that happens to corrupt global memory.

    Q2: Is the sections handled in the linker script? Could you share your linker script?

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    The sections are located in RO data (ie: in flash), and the section_var library would then fetch a pointer to these and execute it.

    Since you see a corruption in the p_observer (thus, possibly the "iter" variable), it points to a stack corruption of some kind.

    Q1: Do you have a log / picture of the cpu registers when this occurred? In your screenshot, I am not seeing the SP (R13) content.

    Since this occurs quite early in the process, it might not be a stack corruption, but a free running pointer (array going out-of-bounds or something) that happens to corrupt global memory.

    Q2: Is the sections handled in the linker script? Could you share your linker script?

     

    Kind regards,

    Håkon

Children
Related