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

ble_app_interactive example crashes

Hi - I built and flashed the ble_app_interactive example from both SDK 15.3 and then from 16.0 on to my nrf52840 DK (PCA10056). I connect to a Thingy52, issue the gatt services command, and then the nrf52840 faults. I've been trying to step through in the SES debugger to find where it is, but haven't had much success. Note that this is the example from the SDK unmodified. Any thoughts on what to try next?

uart_cli:~$ connect F7:C8:CD:5E:19:DF

app: CENTRAL: Connecting...

Connected to address: F7 C8 CD 5E 19 DF

app: CENTRAL: Connected, handle: 0.

Current MTU: 276

MTU changed successfully

app: Data length updated to 251 bytes.

Connection parameters update success

uart_cli:~$ gatt services F7:C8:CD:5E:19:DF

hardfault: HARD FAULT at 0x0003A9D4

hardfault: R0: 0x2000ABDC R1: 0x20040000 R2: 0x0007FD18 R3: 0xFFFFFFFF

hardfault: R12: 0x2000A8FC LR: 0x00030F7B PSR: 0x21000226

hardfault: Cause: Data bus error (PC value stacked for the exception return points to the instruction that caused the fault).

hardfault: Bus Fault Address: 0x20040000

BLE app with command line interface example started.

Press Tab to view all available commands.

Parents
  • Hi,

    I was able to reproduce this. Turns out the app will hardfault if it discovers more than "MAX_SERVICE_COUNT" services on the device it's connected to. You can increase the MAX_SERVICE_COUNT and MAX_CHARACTERISTIC_COUNT values in the sdk_config.h header to fix this. 

    Where the fault occurred in my case (happens as soon as the offset value becomes larger than the MAX_SERVICE_COUNT setting):

Reply
  • Hi,

    I was able to reproduce this. Turns out the app will hardfault if it discovers more than "MAX_SERVICE_COUNT" services on the device it's connected to. You can increase the MAX_SERVICE_COUNT and MAX_CHARACTERISTIC_COUNT values in the sdk_config.h header to fix this. 

    Where the fault occurred in my case (happens as soon as the offset value becomes larger than the MAX_SERVICE_COUNT setting):

Children
Related