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

Application crash after disconnection

Hi,

I have an application with an accelerometer. This one communicate in I2C (TWI ). The accelerometer send a "data ready" signal every 20ms. I'm using the GPIOTE module to detect this signal and read the acceleration (I2C).

Each time I disconnect the Bluetooth, my application crash. I don't have any information to help me to debug on my app_error_handler. When this error happens, the execution stop at "Unknown funtion 0x000006B0".

  1. I tried to disable data ready interuption on the accelerometer and the error disappear (seems to be related to a priority issue with GPIOTE / TWI and SoftDevice).
  2. I thought that this issue was realated to a timing issue due to the GPIOTE interuption and TWI read during advertising start so I tried to disable GPIOTE on the data ready input when I have a disconnection event but that doesn't solve the problem.

I already saw another topic about that but the fix is not clear and I don't understand the root cause (devzone.nordicsemi.com/.../).

What I have understood from this topic is that I should use the ble_debug_assert_handler but I don't understand how to link this one with the app_error_handler. Do you have any example?

Any idea to help me to solve this issue? I'm on it since a while ...

Thanks

Parents
  • at address 0x6B0 in the SoftDevice is code for handling HardFaults. Both HardFaults generated by the application and the SoftDevice will be handled first by code at this address.

    So, the first question is, what generated the HardFault. That should be possible to see by examining the callstack to see what was running before the HardFault happened.

    Second question is why the SoftDevice is not handling it as expected. If it was a application hardfault, it should of forwarded it to the application.

    When this happens, and you are debugging, could you tell me the value of address 0x20000000, ie the first word in ram? And also could you tell me the value at address 0x1B00C (should be the applications HardFault handler)?

    Are you using a bootloader?

Reply
  • at address 0x6B0 in the SoftDevice is code for handling HardFaults. Both HardFaults generated by the application and the SoftDevice will be handled first by code at this address.

    So, the first question is, what generated the HardFault. That should be possible to see by examining the callstack to see what was running before the HardFault happened.

    Second question is why the SoftDevice is not handling it as expected. If it was a application hardfault, it should of forwarded it to the application.

    When this happens, and you are debugging, could you tell me the value of address 0x20000000, ie the first word in ram? And also could you tell me the value at address 0x1B00C (should be the applications HardFault handler)?

    Are you using a bootloader?

Children
No Data
Related