Crash when calling bt_gatt_dm_start

I have build many applications using the NRF5 SDK. I have a custom service that works fine on all my applications written using NRF5.

I am now trying to port these applications to NRF Connect. In creating the Client service for my application, I used NUS as the template and created my client service.

I have tried but I cannot get a sample application work. The Service responds to a Server advertising and connects to it. However when initiating service discovery it crashes.

I include several files which contain the Client service and the application I am using to test with.

I am using NCS 2.0 on a nrf52840dk_nrf52840 dev kit.

The attached file Application.zip contains the files used to build the application and error.txt shows the error I get. It simply appears to crash

*** Booting Zephyr OS build v3.0.99-ncs1  ***
Starting/r/n[00:00:02.742,492] <inf> sdc_hci_driver: SoftDevice Controller build revision:
                                         33 78 2a 18 20 f5 61 61  a6 8b 77 60 62 83 39 2a |3x*. .aa ..w`b.9*
                                         7c f1 14 e4                                      ||...
[00:00:02.746,246] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:02.746,276] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:02.746,307] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 51.10872 Build 1643454488
[00:00:02.747,833] <inf> bt_hci_core: Identity: C7:5F:AC:1B:5C:63 (random)
[00:00:02.747,833] <inf> bt_hci_core: HCI: version 5.3 (0x0c) revision 0x1136, manufacturer 0x0059
[00:00:02.747,863] <inf> bt_hci_core: LMP: version 5.3 (0x0c) subver 0x1136
[00:00:02.747,863] <inf> central_besecure: Bluetooth initialized
[00:00:02.747,863] <inf> central_besecure: BSC Client module initialized
[00:00:02.747,924] <inf> central_besecure: Scan module initialized
[00:00:02.748,840] <inf> central_besecure: Scanning successfully started
[00:00:07.934,570] <inf> central_besecure: Filters matched. Address: C2:64:98:9A:1D:28 (random) connectable: 1
[00:00:07.979,370] <inf> central_besecure: Connected: C2:64:98:9A:1D:28 (random)

bt_gatt_dm_start is called here

[00:00:08.030,914] <err> os: ***** MPU FAULT *****
[00:00:08.030,944] <err> os:   Stacking error (context area might be not valid)
[00:00:08.030,944] <err> os:   Data Access Violation
[00:00:08.030,944] <err> os:   MMFAR Address: 0x20004890
[00:00:08.030,975] <err> os: r0/a1:  0x17f775af  r1/a2:  0x882802a4  r2/a3:  0x6797faf7
[00:00:08.030,975] <err> os: r3/a4:  0x300d0063 r12/ip:  0xff7b57ff r14/lr:  0x0148211a
[00:00:08.031,005] <err> os:  xpsr:  0x01995800
[00:00:08.031,005] <err> os: Faulting instruction address (r15/pc): 0x5defb775
[00:00:08.031,036] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:00:08.031,066] <err> os: Current thread: 0x20001b28 (BT RX)
[00:00:08.161,193] <err> fatal_error: Resetting system
0083.Application.zip

Related