continuously read GATTS not working esp_ble_gatts_send_response after some time

Amol_design
Posts: 3
Joined: Tue Nov 12, 2019 5:05 am

continuously read GATTS not working esp_ble_gatts_send_response after some time

Postby Amol_design » Tue Nov 12, 2019 5:32 am

After using continuously send read characteristics from android to BLE GATTS server it shows following error message reset Esp32 .



I (778476) Read UHF: Wrote 7 bytes
I (778676) Config_ble: 36
I (778676) Config_ble: gatts_if 4
I (778766) Config_ble: GATT_READ_EVT, conn_id 0, trans_id 730, handle 46

I (778766) Read UHF: Wrote 7 bytes
I (778966) Config_ble: 36
I (778966) Config_ble: gatts_if 4
E (778966) BT_GATT: No resources
I (779046) Config_ble: GATT_READ_EVT, conn_id 0, trans_id 731, handle 46

I (779046) Read UHF: Wrote 7 bytes
I (779246) Config_ble: 36
I (779246) Config_ble: gatts_if 4
E (779246) BT_GATT: No resources
I (779326) Config_ble: GATT_READ_EVT, conn_id 0, trans_id 732, handle 46

I (779326) Read UHF: Wrote 7 bytes
I (779526) Config_ble: 36
I (779526) Config_ble: gatts_if 4
E (779526) BT_BTC: btc_gatts_arg_deep_copy 11 no mem

E (779526) BT_GATT: Invalid parameters in attp_build_sr_msg, op_code=0xb, the p_msg should not be NULL.
I (779636) Config_ble: GATT_READ_EVT, conn_id 0, trans_id 733, handle 46

I (779636) Read UHF: Wrote 7 bytes
I (779836) Config_ble: 36
I (779836) Config_ble: gatts_if 4
E (779836) BT_BTC: btc_gatts_arg_deep_copy 11 no mem

E (779836) BT_GATT: Invalid parameters in attp_build_sr_msg, op_code=0xb, the p_msg should not be NULL.
E (779916) BT_BTC: btc_gatts_cb_param_copy_req 1 no mem

Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400eb962 PS : 0x00060d30 A0 : 0x800e6b09 A1 : 0x3ffc3c40
0x400eb962: btc_gatts_cb_handler at /home/design/esp/esp-idf/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c:776

A2 : 0x3ffba764 A3 : 0x3ffff850 A4 : 0x00000004 A5 : 0x000002de
A6 : 0x3ffbd7dc A7 : 0x00001000 A8 : 0x00000000 A9 : 0x3ffc3c30
A10 : 0x3ffc3c48 A11 : 0x3ffff857 A12 : 0x00000006 A13 : 0x3ffc3c4e
A14 : 0x00000055 A15 : 0x00000034 SAR : 0x00000008 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff

ELF file SHA256: 2e8a0019e315367fc18d1b06ec84f4e1f4637b4b836724d3108ad623d8961cb5

Backtrace: 0x400eb95f:0x3ffc3c40 0x400e6b06:0x3ffc3c80 0x40107725:0x3ffc3ca0 0x400910a9:0x3ffc3cc0
0x400eb95f: btc_gatts_cb_handler at /home/design/esp/esp-idf/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c:775

0x400e6b06: btc_thread_handler at /home/design/esp/esp-idf/components/bt/common/btc/core/btc_task.c:154

0x40107725: osi_thread_run at /home/design/esp/esp-idf/components/bt/common/osi/thread.c:68

0x400910a9: vPortTaskWrapper at /home/design/esp/esp-idf/components/freertos/port.c:143

chegewara
Posts: 2238
Joined: Wed Jun 14, 2017 9:00 pm

Re: continuously read GATTS not working esp_ble_gatts_send_response after some time

Postby chegewara » Tue Nov 12, 2019 7:32 am

BT_BTC: btc_gatts_arg_deep_copy 11 no mem
No memory is a clue.

Amol_design
Posts: 3
Joined: Tue Nov 12, 2019 5:05 am

Re: continuously read GATTS not working esp_ble_gatts_send_response after some time

Postby Amol_design » Tue Nov 19, 2019 5:40 am

chegewara wrote:
Tue Nov 12, 2019 7:32 am
BT_BTC: btc_gatts_arg_deep_copy 11 no mem
No memory is a clue.
How to resolve this issue ?

chegewara
Posts: 2238
Joined: Wed Jun 14, 2017 9:00 pm

Re: continuously read GATTS not working esp_ble_gatts_send_response after some time

Postby chegewara » Wed Nov 20, 2019 6:16 pm

Most likely you have memory leak in code, find it.

Amol_design
Posts: 3
Joined: Tue Nov 12, 2019 5:05 am

Re: continuously read GATTS not working esp_ble_gatts_send_response after some time

Postby Amol_design » Sat Nov 23, 2019 6:53 am

chegewara wrote:
Wed Nov 20, 2019 6:16 pm
Most likely you have memory leak in code, find it.
i am using GATT server example as it is .i use it for continuously read response from esp32 .i had gone trough application code and esp-idf components after each ESP_GATTS_READ_EVT i see in function
void btc_gatts_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) at
case BTC_GATTS_ACT_SEND_RESPONSE: memory allocation for
dst->send_rsp.rsp = (esp_gatt_rsp_t *) osi_malloc(sizeof(esp_gatt_rsp_t));

vary for each ESP_GATTS_READ_EVT and its gets incremented and after some time its gets beyond the arg address form the
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)

i had try out to do osi_free (dst->send_rsp.rsp ) but it not work rather it crashes often .please help me out from it any one has solution on it

Who is online

Users browsing this forum: Bing [Bot] and 148 guests