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
  • Thanks to my functional needs, I don't need the accelerometer when the device is connected in Bluetooth. I implemented a sequence to disable the data_ready interruption and GPIOTE and now it seems to work fine. I'm a little bit frustrated to not understand what's happened but I have to deliver this code ASAP so I will not try to go back to see what is happening.

    By "chance" (not sure that this is the word), I talked with a colleague which had the same behavior (same SDK and SD) but in a totally different project (nothing related with my project and product). I asked him to check the 2 registers that you asked for. He had : 0x1B00C -> C3 B0 01 0x20000000 -> 00 10 00 00 00 B0 01 00 01 00 08 00 87 00 59 00 03 00 05 00 07

Reply
  • Thanks to my functional needs, I don't need the accelerometer when the device is connected in Bluetooth. I implemented a sequence to disable the data_ready interruption and GPIOTE and now it seems to work fine. I'm a little bit frustrated to not understand what's happened but I have to deliver this code ASAP so I will not try to go back to see what is happening.

    By "chance" (not sure that this is the word), I talked with a colleague which had the same behavior (same SDK and SD) but in a totally different project (nothing related with my project and product). I asked him to check the 2 registers that you asked for. He had : 0x1B00C -> C3 B0 01 0x20000000 -> 00 10 00 00 00 B0 01 00 01 00 08 00 87 00 59 00 03 00 05 00 07

Children
No Data
Related