nrf52 DK Bluetooth Connection Lost Due to Low Memory?

Hi,

we are using nrf52 DK and our custom mobile application. We are trying to collect 15000 sensor samples and finally we are trying to send array to mobile app via BLE. We store those samples into array called data_to_send. Array is defined as:uint8_t data_to_send[NUMBER_OF_SAMPLES_TO_COLLECT]; where NUMBER_OF_SAMPLES_TO_COLLECT is 15000.At first when CONFIG_MAIN_STACK_SIZE and CONFIG_BT_RX_STACK_SIZE in proj.conf were 4096 then we get the following error message before we are able to collect those 15000 samples.


�*** Booting Zephyr OS build 28a3fca7da5c ***0x20001f00 (BT RX)

After that we decreased the NUMBER_OF_SAMPLES_TO_COLLECT to 5000 and got the following error message:

[00:01:14.032,989] <err> os: ***** MPU FAULT *****
[00:01:14.032,989] <err> os:   Data Access Violation
[00:01:14.033,020] <err> os:   MMFAR Address: 0x200048c0
[00:01:14.033,050] <err> os: r0/a1:  0x000000c7  r1/a2:  0x00000000  r2/a3:  0x200041a0
[00:01:14.033,050] <err> os: r3/a4:  0x00000721 r12/ip:  0x0002e5c0 r14/lr:  0x000225cb
[00:01:14.033,081] <err> os:  xpsr:  0x01000000
[00:01:14.033,081] <err> os: Faulting instruction address (r15/pc): 0x000123d2
[00:01:14.033,142] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:01:14.033,172] <err> os: Current thread: 0x20001f00 (BT RX)

Then we increased CONFIG_MAIN_STACK_SIZE and CONFIG_BT_RX_STACK_SIZE in proj.conf from 4096 to 8192.Right after when we have finished collecting 5000 samples we lose the BT connection. We get the following error message to terminal:
<err> bt_conn: not connected!
[00:01:21.406,860] <wrn> bt_hci_core: Not reporting packet for non-connected conn

Everything works just fine when we try to collect 4000 samples. Our current main stack size is 8192 and bt rx stack size is 8192. We tried to increase both to 10000 but the issue remains.

Parents Reply Children
No Data
Related