espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.51k stars 7.26k forks source link

WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) #9241

Closed xueren-git closed 2 years ago

xueren-git commented 2 years ago

----------------------------- Delete above -----------------------------

Environment

Problem Description

Run ble gattc and wifi sta mode, Bluetooth is scanning all the time. A socket connects to the server and sends a packet of data every 10 seconds。

Expected Behavior

Actual Behavior

Steps to reproduce

Code to reproduce this issue

Debug Logs

I (2022-06-28 07:37:21.287) Health: recv size=8 I (2022-06-28 07:37:31.277) Health: send packet (keep alive) I (2022-06-28 07:37:31.278) Health: send packet size=8 I (2022-06-28 07:37:31.278) Health: send packet end 1 I (2022-06-28 07:37:31.310) Health: recv size=8 I (2022-06-28 07:37:41.277) Health: send packet (keep alive) I (2022-06-28 07:37:41.278) Health: send packet size=8 I (2022-06-28 07:37:41.279) Health: send packet end 1 I (2022-06-28 07:37:41.327) Health: recv size=8 I (2022-06-28 07:37:51.277) Health: send packet (keep alive) I (2022-06-28 07:37:51.278) Health: send packet size=8 I (2022-06-28 07:37:51.279) Health: send packet end 1 I (2022-06-28 07:37:51.319) Health: recv size=8 DIAG0 120be3a0 DIAG1 10000000 BB DIAG0: 000a4004 BB DIAG1: bc002602 BB DIAG2: 00000000 BB DIAG3: 8e89bed6 BB DIAG4: 00000000 BB DIAG5: 00000000 assert rwble.c 261, param 00020000 00000000 E (12800280) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (12800280) task_wdt: - IDLE (CPU 0) E (12800280) task_wdt: Tasks currently running: E (12800280) task_wdt: CPU 0: wifi E (12800280) task_wdt: wifi X 23 3928 11 0 esp_timer R 22 2488 2 0 BTU_TASK R 20 2432 15 0 tiT R 18 2228 9 0 PLRV R 12 1508 18 0 BleTask R 12 3388 16 0 Tmr Svc R 1 2236 5 0 IDLE R 0 1588 4 0 sys_evt B 20 604 10 0 AppTask B 12 900 8 0 PLSD B 12 588 17 0 BTC_TASK B 19 1280 13 0 btController B 23 1944 12 0 hciT B 22 1608 14 0 UartTask B 12 3244 7 0

E (12800280) task_wdt: wifi 985385013 23% esp_timer 33576316 <1% BTU_TASK 12654348 <1% tiT 20349269 <1% BleTask 1416408 <1% PLRV 12194173 <1% Tmr Svc 872985 <1% IDLE 3068596384 72% AppTask 10557 <1% PLSD 4430788 <1% BTC_TASK 3339249 <1% btController 31882690 <1% hciT 24688419 <1% UartTask 22 <1% sys_evt 12302 <1%

Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).

Stack dump detected Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 0x4038018a: _interrupt_handler at ??:?

0x4038014c: _interrupt_handler at ??:?

TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a 0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'm:\zjq\bhg\examples\hthealthgw\build\htHealthGW.elf', '-ex', 'target remote | "M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base\..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"', '-ex', 'bt']' returned non-zero exit status 1. b'M:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gdb.exe: warning: Couldn\'t determine a path for the index cache directory.\r\nerror starting child process \'"M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base\..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"\': CreateProcess: No such file or directory\r\nNo stack.\r\n'

Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a MHARTID : 0x00000000

Stack memory: 3fc93d10: 0x40002da4 0x40002d90 0x3ff1b000 0x3fce0000 0x3fc74564 0x7fffffff 0x00000000 0x00000002 3fc93d30: 0x00000100 0x3fce0000 0x0000002c 0x0000000a 0x3fc93ce0 0x00000001 0x00000001 0x3fcdf9f8 3fc93d50: 0x80000000 0x00000010 0x3fce0000 0x3fcdf96c 0x00081e89 0xfffbffff 0x83828180 0x3fce0000 3fc93d70: 0x3ff1b000 0x3fce0000 0x3fcdf934 0x00000000 0x00000000 0x00000000 0x00000001 0x00000002 3fc93d90: 0x8e89bed6 0x00000000 0x00000000 0x4002e924 0x00001881 0x3fc977ac 0x3fc977a4 0x3fce0000 3fc93db0: 0x3fce0000 0x3fce0000 0x3fcaadb8 0x00000001 0x00001881 0x80000005 0x3fce0000 0x40009b80 0x3fca372c 3fc93df0: 0x3fca372c 0x00000001 0x3fca4194 0xffffffff 0x3fca4194 0x3fca4194 0x00000000 0x3fc93e10 3fc93e10: 0xffffffff 0x3fc93e10 0x3fc93e10 0x00000000 0x3fc93e24 0xffffffff 0x3fc93e24 0x3fc93e24 3fc93e30: 0x00000000 0x3fc93e38 0xffffffff 0x3fc93e38 0x3fc93e38 0x00000000 0x3fc93e4c 0xffffffff 3fc93e50: 0x3fc93e4c 0x3fc93e4c 0x00000000 0x3fc93e60 0xffffffff 0x3fc93e60 0x3fc93e60 0x00000000 3fc93e70: 0x3fc93e74 0xffffffff 0x3fc93e74 0x3fc93e74 0x00000000 0x3fc93e88 0xffffffff 0x3fc93e88 3fc93e90: 0x3fc93e88 0x00000000 0x3fc93e9c 0xffffffff 0x3fc93e9c 0x3fc93e9c 0x00000000 0x3fc93eb0 3fc93eb0: 0xffffffff 0x3fc93eb0 0x3fc93eb0 0x00000000 0x3fc93ec4 0xffffffff 0x3fc93ec4 0x3fc93ec4 3fc93ed0: 0x00000002 0x3fcc4574 0xffffffff 0x3fcbfb1c 0x3fcc4574 0x00000000 0x3fc93eec 0xffffffff 3fc93ef0: 0x3fc93eec 0x3fc93eec 0x00000000 0x3fc93f00 0xffffffff 0x3fc93f00 0x3fc93f00 0x00000000 3fc93f10: 0x3fc93f14 0xffffffff 0x3fc93f14 0x3fc93f14 0x00000000 0x3fc93f28 0xffffffff 0x3fc93f28 3fc93f30: 0x3fc93f28 0x00000000 0x3fc93f3c 0xffffffff 0x3fc93f3c 0x3fc93f3c 0x00000001 0x3fca92e4 3fc93f50: 0xffffffff 0x3fca92e4 0x3fca92e4 0x00000000 0x3fc93f64 0xffffffff 0x3fc93f64 0x3fc93f64 3fc93f70: 0x00000001 0x3fcbcc44 0xffffffff 0x3fcbcc44 0x3fcbcc44 0x00000000 0x3fc93f8c 0xffffffff 3fc93f90: 0x3fc93f8c 0x3fc93f8c 0x00000001 0x3fca232c 0xffffffff 0x3fca232c 0x3fca232c 0x00000001 3fc93fb0: 0x3fcace9c 0xffffffff 0x3fcace9c 0x3fcace9c 0x00000000 0x3fc93fc8 0xffffffff 0x3fc93fc8 3fc93fd0: 0x3fc93fc8 0x00000000 0x3fc93fdc 0xffffffff 0x3fc93fdc 0x3fc93fdc 0x00000000 0x3fc93ff0 3fc93ff0: 0xffffffff 0x3fc93ff0 0x3fc93ff0 0x00000000 0x3fc94004 0xffffffff 0x3fc94004 0x3fc94004 3fc94010: 0x00000007 0x3fcaa2e8 0xffffffff 0x3fca08bc 0x3fcbb160 0x00000000 0x3fc9402c 0xffffffff 3fc94030: 0x3fc9402c 0x3fc9402c 0x00000001 0x00000789 0x3fcbe920 0x3fc9a678 0x00000000 0x00000000 3fc94050: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94070: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94090: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940d0: 0x00000000 0x00000000 0x00000001 0x3fc940e0 0xffffffff 0x3fcbe924 0x3fcbe924 0x00000000 3fc940f0: 0x3fc940f4 0xffffffff 0x3fc940f4 0x3fc940f4 0x3fc94038 0x3fc94048 0x3fc940d8 0x3fc94038

ELF file SHA256: d248eaa63d177410 ELF file SHA256: d248eaa63d177410

Rebooting... ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT) Saved PC:0x4038062a 0x4038062a: esp_restart_noos_dig at M:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/esp_system.c:44 (discriminator 1)

Other items if possible

sdkconfig file

nishanth-radja commented 2 years ago

@xueren-git can you pls give us the following. 1.SDK config 2.Are you using Nimble or bluedroid host? 3.After how long you are seeing the crash? 4.I see that you are mentioned gattc, Is there a active connection and dut continues to perform ble scan? 5.Can you attach you application which you are using.

xueren-git commented 2 years ago

Config Dual mode, but my application code only use ble. Time is no fixed, sometimes more than ten hours, sometimes an hour or two. esp_ble_gap_start_scanning(0), ble scanning all the time, and no ble device connection. Wifi config sta mode, an connection working, send several bytes every 10 seconds.

//===Ble init === bool BleStart(void) { esp_err_t err; esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();

LOG_INFO("Start ...");
gBleScaning = false;

err = esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
ERROR_ESP_RETURN(err, false, "Bt mem release ERROR");

err = esp_bt_controller_init(&bt_cfg);
ERROR_ESP_RETURN(err, false, "Bt controller init ERROR");

err = esp_bt_controller_enable(ESP_BT_MODE_BLE);
ERROR_ESP_RETURN(err, false, "Bt controller enable ERROR");

err = esp_bluedroid_init();
ERROR_ESP_RETURN(err, false, "Bluedroid init ERROR");

err = esp_bluedroid_enable();
ERROR_ESP_RETURN(err, false, "Bluetooth enable ERROR");

err = esp_ble_gap_register_callback(esp_gap_cb);
ERROR_ESP_RETURN(err, false, "Gap callback init ERROR");
err = esp_ble_gattc_register_callback(esp_gattc_cb);
ERROR_ESP_RETURN(err, false, "[Gattc] register callback ERROR");

#ifdef CONFIG_BLE_MUT
err = esp_ble_gatt_set_local_mtu(CONFIG_BLE_MUT);
LOG_ERROR_ESP_IF(err, "Set local mtu ERROR");
LOG_INFO("Set local mut %d", CONFIG_BLE_MUT);
#endif

esp_ble_gap_config_local_privacy(true);
esp_ble_auth_req_t      auth_req = ESP_LE_AUTH_REQ_SC_MITM_BOND;     // bonding with peer device after authentication
esp_ble_io_cap_t        iocap = ESP_IO_CAP_IN;
uint8_t key_size    = 16;   //the key size should be 7~16 bytes
uint8_t init_key    = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t rsp_key     = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t oob_support = ESP_BLE_OOB_DISABLE;
esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &auth_req, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_OOB_SUPPORT, &oob_support, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));

if(gBleTask == INVALID_TASK)
{
    gBleTask = task_create("BleTask", BLE_TASK_PRIORIYT, BLE_TASK_SIZE, 0, BleTaskFun, 0);
    if(gBleTask == INVALID_TASK)
    {
        LOG_ERROR("Task create ERROR");
        return false;
    }
}

LOG_INFO("Start ok");
return true;

}

//==== Ble scan param set ==== static bool Scan_SetParam(void) { esp_ble_scan_params_t tScanParam; memset(&tScanParam, 0, sizeof(tScanParam)); tScanParam.scan_type = BLE_SCAN_TYPE_ACTIVE; tScanParam.own_addr_type = BLE_ADDR_TYPE_PUBLIC; tScanParam.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL; tScanParam.scan_interval = 0x50; tScanParam.scan_window = 0x30; tScanParam.scan_duplicate = BLE_SCAN_DUPLICATE_DISABLE; esp_err_t err = esp_ble_gap_set_scan_params(&tScanParam); ERROR_ESP_RETURN(err, false, "Scan set param ERROR"); LOG_DEBUG("Sacn set param"); return true; }

//==== Ble scan start ==== static void Scan_Start(void) { esp_err_t err = esp_ble_gap_start_scanning(0); if(err == ESP_OK) { LOG_INFO("Scan start ..."); gBleScaning = true; } else { LOG_ERROR_ESP(err, "Scan start ERROR"); } gBleScanDelay = 0; }

//===Gap callbacks=== static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { switch (event) { case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: gBleInitOk = true; Scan_Start(); Adv_Config(); break;

    case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
        ERROR_BT_BREAK(param->scan_start_cmpl.status, "[Gap] SCAN_START_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SCAN_START_COMPLETE ok");
        gBleScaning = true;
        break;

    case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:
        ERROR_BT_BREAK(param->scan_stop_cmpl.status, "[Gap] SCAN_STOP_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SCAN_STOP_COMPLETE ok");
        gBleScaning = false;
        break;

    case ESP_GAP_BLE_SCAN_RESULT_EVT:
        switch (param->scan_rst.search_evt)
        {
            case ESP_GAP_SEARCH_INQ_RES_EVT:
            {
                // check mac,Determine whether to connect or no
                break;
            }

            default:
                LOG_WARN("[Gap] SCAN_RESULT (event=%d no do)", param->scan_rst.search_evt);
                break;
        }
        break;

    case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT:
        ERROR_BT_BREAK(param->local_privacy_cmpl.status, "[Gap] SET_LOCAL_PRIVACY_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SET_LOCAL_PRIVACY_COMPLETE ok");
        Scan_SetParam();
        break;

    case ESP_GAP_BLE_OOB_REQ_EVT:
    {
        uint8_t tk[16] = {1};
        esp_ble_oob_req_reply(param->ble_security.ble_req.bd_addr, tk, sizeof(tk));
        break;
    }

    case ESP_GAP_BLE_PASSKEY_REQ_EVT:

        break;

    case ESP_GAP_BLE_AUTH_CMPL_EVT:
        break;

    case ESP_GAP_BLE_SEC_REQ_EVT:
        esp_ble_gap_security_rsp(param->ble_security.ble_req.bd_addr, true);
        break;

    case ESP_GAP_BLE_NC_REQ_EVT:
        esp_ble_confirm_reply(param->ble_security.ble_req.bd_addr, true);
        break;

    case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT:
        gAdvConfigDone &= ~ADV_CONFIG_ADV;
        Adv_Start();
        break;

    case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT:
        gAdvConfigDone &= ~ADV_CONFIG_RSP;
        Adv_Start();
        break;

    default:
        break;
}

}

//===Gattc callbacks==== static void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t param) { BleProfileNode_T pProfile = NULL;

switch (event)
{
    case ESP_GATTC_REG_EVT:         pProfile = BleProfileList_FindRegId(param->reg.app_id);         break;
    case ESP_GATTC_CONNECT_EVT:     pProfile = BleProfileList_FindMac(param->connect.remote_bda);   break;
    case ESP_GATTC_DISCONNECT_EVT:  pProfile = BleProfileList_FindMac(param->disconnect.remote_bda);break;
    default:                        pProfile = BleProfileList_FindGattcIf(gattc_if);                break;
}

if(pProfile != NULL)
{
    esp_err_t err  = ESP_OK;
    bool needClose = false;

    switch (event)
    {
        case ESP_GATTC_REG_EVT:
            if (param->reg.status == ESP_GATT_OK)
            {
                pProfile->bIsReg = 1;
                pProfile->u8GattcIf = gattc_if;
                err = esp_ble_gattc_open(pProfile->u8GattcIf, pProfile->u8BleMac, pProfile->u8AddrType, true);
                if(err != ESP_OK)
                {
                    LOG_ERROR_ESP(err, "Profile[%d] Open ERROR", PROFILE_ID);
                    needClose = true;
                }
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] REG ERROR=%d", PROFILE_ID, param->reg.status);
                needClose = true;
            }
            break;

        case ESP_GATTC_CONNECT_EVT:
            break;

        case ESP_GATTC_OPEN_EVT:
            if (param->open.status == ESP_GATT_OK)
            {
                pProfile->bIsOpen = 1;
                pProfile->u16ConnId = param->open.conn_id;

                #ifdef CONFIG_BLE_MUT
                if((pProfile->pBleSupport->u32BleBitFlag & BBT_DIS_MTU_REQ) != 0)
                {
                    Profile_Search_Service(pProfile);
                }
                else
                {
                    err = esp_ble_gattc_send_mtu_req (gattc_if, param->open.conn_id);
                    LOG_ERROR_ESP_IF(err, "Profile[%d] Config mtu ERROR", PROFILE_ID);
                }
                #else
                Profile_Search_Service(pProfile);
                #endif
                pProfile->u16RecvTimeout = (uint16_t)(pProfile->pBleSupport->u8RecvTimeout) * 10;
            }
            else
            {
                LOG_ERROR("[Gattc] Profile[%d] OPEN ERROR=%d", PROFILE_ID, param->open.status);
                needClose = true;
            }
            break;

        case ESP_GATTC_CFG_MTU_EVT:
            ERROR_GATT_BREAK(param->cfg_mtu.status, "[Gattc] Profile[%d] CFG_MTU ERROR", PROFILE_ID)
            Profile_Search_Service(pProfile);
            break;

        case ESP_GATTC_SEARCH_RES_EVT:
        {
            uint32_t u32BitFlag = pProfile->pBleSupport->u32BleBitFlag & BBT_SVR_UUID_MASK;
            if(u32BitFlag == BBT_SVR_UUID_16)
            {
                if(param->search_res.srvc_id.uuid.len == ESP_UUID_LEN_16 && param->search_res.srvc_id.uuid.uuid.uuid16 == pProfile->pBleSupport->u16SvrUuid)
                {
                    LOG_DEBUG("Profile[%d] Service found (uuid16)", PROFILE_ID);
                    pProfile->bIsGetService     = 1;
                    pProfile->u16SvrStartHandle = param->search_res.start_handle;
                    pProfile->u16SvrEndHandle   = param->search_res.end_handle;
                }
            }
            else if(u32BitFlag == BBT_SVR_UUID_128)
            {
                if(param->search_res.srvc_id.uuid.len == ESP_UUID_LEN_128)
                {
                    LOG_DEBUG("Profile[%d] Service found (uuid128)", PROFILE_ID);
                    pProfile->bIsGetService   = 1;
                    pProfile->u16SvrStartHandle = param->search_res.start_handle;
                    pProfile->u16SvrEndHandle     = param->search_res.end_handle;
                }
            }
            break;
        }

        case ESP_GATTC_SEARCH_CMPL_EVT:
            if (param->search_cmpl.status != ESP_GATT_OK)
            {
                LOG_ERROR("[Gattc] Profile[%d] SEARCH_CMPL ERROR (%d)", PROFILE_ID, param->search_cmpl.status);
                needClose = true;
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] SEARCH_CMPL ok (connId=%d)", PROFILE_ID, param->search_cmpl.conn_id);
                if(pProfile->BleRegNotify)
                {
                    if(pProfile->BleRegNotify(pProfile) != 0)
                    {
                        needClose = true;
                        break;
                    }
                }
                pProfile->bIsCanScan = 1;
                Scan_Start();
            }
            break;

        case ESP_GATTC_REG_FOR_NOTIFY_EVT:
            if (param->reg_for_notify.status != ESP_GATT_OK)
            {
                LOG_ERROR("[Gattc] Profile[%d] REG_FOR_NOTIFY ERROR=%d", PROFILE_ID, param->reg_for_notify.status);
                needClose = true;
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] REG_FOR_NOTIFY ok", PROFILE_ID);
                pProfile->bIsCanScan = 1;
                Scan_Start();
            }
            break;

        case ESP_GATTC_NOTIFY_EVT:
            BleTranClient_Evt_Notify(param, pProfile);
            if((pProfile->BleParse != NULL) && (param->notify.value_len > 0))
            {
                if(pProfile->BleParse(pProfile, param->notify.handle, param->notify.value, param->notify.value_len) == 0)
                {
                    pProfile->u16RecvTimeout = (uint16_t)(pProfile->pBleSupport->u8RecvTimeout) * 10;
                }
            }
            break;

        case ESP_GATTC_WRITE_DESCR_EVT:
            if (param->write.status != ESP_GATT_OK)
            {
                if(param->write.status == ESP_GATT_INSUF_AUTHENTICATION)
                {
                    if(pProfile->bIsPairing == 0)
                    {
                        LOG_WARN("[Gattc] Profile[%d] WRITE_DESCR (need pair)", PROFILE_ID);
                        pProfile->bIsPairing = 1;
                        esp_ble_set_encryption(pProfile->u8BleMac, ESP_BLE_SEC_ENCRYPT_MITM);
                    }
                    else
                    {
                        LOG_WARN("[Gattc] Profile[%d] WRITE_DESCR (need pair but have do)", PROFILE_ID);
                    }
                }
                else
                {
                    LOG_ERROR("[Gattc] Profile[%d] WRITE_DESCR ERROR=%d", PROFILE_ID, param->write.status);
                }
            }
            else
            {
                if(pProfile->pBleSupport->u16ControlPointHandle && param->write.handle==pProfile->pBleSupport->u16ControlPointHandle+1)
                {
                    Profile_Request(pProfile);
                }
            }
            break;

        case ESP_GATTC_CLOSE_EVT:
            pProfile->bIsOpen = 0;
            break;

        case ESP_GATTC_DISCONNECT_EVT:
            pProfile->bIsOpen = 0;
            needClose = true;
            break;

        default:
            break;
    }

    if(needClose)
    {
        Profile_Close(pProfile);
    }
}

}

xueren-git commented 2 years ago

sdkconfig.txt

brunofgc commented 2 years ago

----------------------------- Delete above -----------------------------

Environment

  • Development Kit: ESP32-DevKitC
  • Kit version DevKitC: v1
  • Module or chip used: ESP32-C3
  • IDF version : esp-idf-v4.4.1
  • Build System: idf.py
  • Compiler version: (crosstool-NG esp-2021r2-patch3) 8.4.0
  • Operating System: Windows
  • (Windows only) environment type: PowerShell.
  • Using an IDE?: No
  • Power Supply: USB|external 3.3V|

Problem Description

Run ble gattc and wifi sta mode, Bluetooth is scanning all the time. A socket connects to the server and sends a packet of data every 10 seconds。

Expected Behavior

Actual Behavior

Steps to reproduce

Code to reproduce this issue

Debug Logs

I (2022-06-28 07:37:21.287) Health: recv size=8 I (2022-06-28 07:37:31.277) Health: send packet (keep alive) I (2022-06-28 07:37:31.278) Health: send packet size=8 I (2022-06-28 07:37:31.278) Health: send packet end 1 I (2022-06-28 07:37:31.310) Health: recv size=8 I (2022-06-28 07:37:41.277) Health: send packet (keep alive) I (2022-06-28 07:37:41.278) Health: send packet size=8 I (2022-06-28 07:37:41.279) Health: send packet end 1 I (2022-06-28 07:37:41.327) Health: recv size=8 I (2022-06-28 07:37:51.277) Health: send packet (keep alive) I (2022-06-28 07:37:51.278) Health: send packet size=8 I (2022-06-28 07:37:51.279) Health: send packet end 1 I (2022-06-28 07:37:51.319) Health: recv size=8 DIAG0 120be3a0 DIAG1 10000000 BB DIAG0: 000a4004 BB DIAG1: bc002602 BB DIAG2: 00000000 BB DIAG3: 8e89bed6 BB DIAG4: 00000000 BB DIAG5: 00000000 assert rwble.c 261, param 00020000 00000000 E (12800280) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (12800280) task_wdt: - IDLE (CPU 0) E (12800280) task_wdt: Tasks currently running: E (12800280) task_wdt: CPU 0: wifi E (12800280) task_wdt: wifi X 23 3928 11 0 esp_timer R 22 2488 2 0 BTU_TASK R 20 2432 15 0 tiT R 18 2228 9 0 PLRV R 12 1508 18 0 BleTask R 12 3388 16 0 Tmr Svc R 1 2236 5 0 IDLE R 0 1588 4 0 sys_evt B 20 604 10 0 AppTask B 12 900 8 0 PLSD B 12 588 17 0 BTC_TASK B 19 1280 13 0 btController B 23 1944 12 0 hciT B 22 1608 14 0 UartTask B 12 3244 7 0

E (12800280) task_wdt: wifi 985385013 23% esp_timer 33576316 <1% BTU_TASK 12654348 <1% tiT 20349269 <1% BleTask 1416408 <1% PLRV 12194173 <1% Tmr Svc 872985 <1% IDLE 3068596384 72% AppTask 10557 <1% PLSD 4430788 <1% BTC_TASK 3339249 <1% btController 31882690 <1% hciT 24688419 <1% UartTask 22 <1% sys_evt 12302 <1%

Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).

Stack dump detected Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 0x4038018a: _interrupt_handler at ??:?

0x4038014c: _interrupt_handler at ??:?

TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a 0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'm:\zjq\bhg\examples\hthealthgw\build\htHealthGW.elf', '-ex', 'target remote | "M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"', '-ex', 'bt']' returned non-zero exit status 1. b'M:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.\r\nerror starting child process '"M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"': CreateProcess: No such file or directory\r\nNo stack.\r\n'

Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a MHARTID : 0x00000000

Stack memory: 3fc93d10: 0x40002da4 0x40002d90 0x3ff1b000 0x3fce0000 0x3fc74564 0x7fffffff 0x00000000 0x00000002 3fc93d30: 0x00000100 0x3fce0000 0x0000002c 0x0000000a 0x3fc93ce0 0x00000001 0x00000001 0x3fcdf9f8 3fc93d50: 0x80000000 0x00000010 0x3fce0000 0x3fcdf96c 0x00081e89 0xfffbffff 0x83828180 0x3fce0000 3fc93d70: 0x3ff1b000 0x3fce0000 0x3fcdf934 0x00000000 0x00000000 0x00000000 0x00000001 0x00000002 3fc93d90: 0x8e89bed6 0x00000000 0x00000000 0x4002e924 0x00001881 0x3fc977ac 0x3fc977a4 0x3fce0000 3fc93db0: 0x3fce0000 0x3fce0000 0x3fcaadb8 0x00000001 0x00001881 0x80000005 0x3fce0000 0x40009b80 0x3fca372c 3fc93df0: 0x3fca372c 0x00000001 0x3fca4194 0xffffffff 0x3fca4194 0x3fca4194 0x00000000 0x3fc93e10 3fc93e10: 0xffffffff 0x3fc93e10 0x3fc93e10 0x00000000 0x3fc93e24 0xffffffff 0x3fc93e24 0x3fc93e24 3fc93e30: 0x00000000 0x3fc93e38 0xffffffff 0x3fc93e38 0x3fc93e38 0x00000000 0x3fc93e4c 0xffffffff 3fc93e50: 0x3fc93e4c 0x3fc93e4c 0x00000000 0x3fc93e60 0xffffffff 0x3fc93e60 0x3fc93e60 0x00000000 3fc93e70: 0x3fc93e74 0xffffffff 0x3fc93e74 0x3fc93e74 0x00000000 0x3fc93e88 0xffffffff 0x3fc93e88 3fc93e90: 0x3fc93e88 0x00000000 0x3fc93e9c 0xffffffff 0x3fc93e9c 0x3fc93e9c 0x00000000 0x3fc93eb0 3fc93eb0: 0xffffffff 0x3fc93eb0 0x3fc93eb0 0x00000000 0x3fc93ec4 0xffffffff 0x3fc93ec4 0x3fc93ec4 3fc93ed0: 0x00000002 0x3fcc4574 0xffffffff 0x3fcbfb1c 0x3fcc4574 0x00000000 0x3fc93eec 0xffffffff 3fc93ef0: 0x3fc93eec 0x3fc93eec 0x00000000 0x3fc93f00 0xffffffff 0x3fc93f00 0x3fc93f00 0x00000000 3fc93f10: 0x3fc93f14 0xffffffff 0x3fc93f14 0x3fc93f14 0x00000000 0x3fc93f28 0xffffffff 0x3fc93f28 3fc93f30: 0x3fc93f28 0x00000000 0x3fc93f3c 0xffffffff 0x3fc93f3c 0x3fc93f3c 0x00000001 0x3fca92e4 3fc93f50: 0xffffffff 0x3fca92e4 0x3fca92e4 0x00000000 0x3fc93f64 0xffffffff 0x3fc93f64 0x3fc93f64 3fc93f70: 0x00000001 0x3fcbcc44 0xffffffff 0x3fcbcc44 0x3fcbcc44 0x00000000 0x3fc93f8c 0xffffffff 3fc93f90: 0x3fc93f8c 0x3fc93f8c 0x00000001 0x3fca232c 0xffffffff 0x3fca232c 0x3fca232c 0x00000001 3fc93fb0: 0x3fcace9c 0xffffffff 0x3fcace9c 0x3fcace9c 0x00000000 0x3fc93fc8 0xffffffff 0x3fc93fc8 3fc93fd0: 0x3fc93fc8 0x00000000 0x3fc93fdc 0xffffffff 0x3fc93fdc 0x3fc93fdc 0x00000000 0x3fc93ff0 3fc93ff0: 0xffffffff 0x3fc93ff0 0x3fc93ff0 0x00000000 0x3fc94004 0xffffffff 0x3fc94004 0x3fc94004 3fc94010: 0x00000007 0x3fcaa2e8 0xffffffff 0x3fca08bc 0x3fcbb160 0x00000000 0x3fc9402c 0xffffffff 3fc94030: 0x3fc9402c 0x3fc9402c 0x00000001 0x00000789 0x3fcbe920 0x3fc9a678 0x00000000 0x00000000 3fc94050: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94070: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94090: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940d0: 0x00000000 0x00000000 0x00000001 0x3fc940e0 0xffffffff 0x3fcbe924 0x3fcbe924 0x00000000 3fc940f0: 0x3fc940f4 0xffffffff 0x3fc940f4 0x3fc940f4 0x3fc94038 0x3fc94048 0x3fc940d8 0x3fc94038

ELF file SHA256: d248eaa63d177410 ELF file SHA256: d248eaa63d177410

Rebooting... ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT) Saved PC:0x4038062a 0x4038062a: esp_restart_noos_dig at M:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/esp_system.c:44 (discriminator 1)

Other items if possible

sdkconfig file

Hi there. I'm facing the same issue but in my case I'm not connecting to a BT Device. Only doing the "Advertisement Scan". I have another big concern, the processor is not "reseting" after watchdog get triggered. It means my device get stuck and doesn't recover from this state.

Could you please try help me on that? Have you ever seen this before?

Please See bellow the output:

DIAG0 1000e3a0 DIAG1 120b0000 BB DIAG0: 000a5384 BB DIAG1: ca000c82 BB DIAG2: 00000000 BB DIAG3: 8e89bed6 BB DIAG4: 00000000 BB DIAG5: 00000000 assert rwble.c 261, param 00020000 00000000 E (2411792) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (2411792) task_wdt: - IDLE (CPU 0) E (2411792) task_wdt: Tasks currently running: E (2411792) task_wdt: CPU 0: wifi

xueren-git commented 2 years ago

----------------------------- Delete above -----------------------------

Environment

  • Development Kit: ESP32-DevKitC
  • Kit version DevKitC: v1
  • Module or chip used: ESP32-C3
  • IDF version : esp-idf-v4.4.1
  • Build System: idf.py
  • Compiler version: (crosstool-NG esp-2021r2-patch3) 8.4.0
  • Operating System: Windows
  • (Windows only) environment type: PowerShell.
  • Using an IDE?: No
  • Power Supply: USB|external 3.3V|

Problem Description

Run ble gattc and wifi sta mode, Bluetooth is scanning all the time. A socket connects to the server and sends a packet of data every 10 seconds。

Expected Behavior

Actual Behavior

Steps to reproduce

Code to reproduce this issue

Debug Logs

I (2022-06-28 07:37:21.287) Health: recv size=8 I (2022-06-28 07:37:31.277) Health: send packet (keep alive) I (2022-06-28 07:37:31.278) Health: send packet size=8 I (2022-06-28 07:37:31.278) Health: send packet end 1 I (2022-06-28 07:37:31.310) Health: recv size=8 I (2022-06-28 07:37:41.277) Health: send packet (keep alive) I (2022-06-28 07:37:41.278) Health: send packet size=8 I (2022-06-28 07:37:41.279) Health: send packet end 1 I (2022-06-28 07:37:41.327) Health: recv size=8 I (2022-06-28 07:37:51.277) Health: send packet (keep alive) I (2022-06-28 07:37:51.278) Health: send packet size=8 I (2022-06-28 07:37:51.279) Health: send packet end 1 I (2022-06-28 07:37:51.319) Health: recv size=8 DIAG0 120be3a0 DIAG1 10000000 BB DIAG0: 000a4004 BB DIAG1: bc002602 BB DIAG2: 00000000 BB DIAG3: 8e89bed6 BB DIAG4: 00000000 BB DIAG5: 00000000 assert rwble.c 261, param 00020000 00000000 E (12800280) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (12800280) task_wdt: - IDLE (CPU 0) E (12800280) task_wdt: Tasks currently running: E (12800280) task_wdt: CPU 0: wifi E (12800280) task_wdt: wifi X 23 3928 11 0 esp_timer R 22 2488 2 0 BTU_TASK R 20 2432 15 0 tiT R 18 2228 9 0 PLRV R 12 1508 18 0 BleTask R 12 3388 16 0 Tmr Svc R 1 2236 5 0 IDLE R 0 1588 4 0 sys_evt B 20 604 10 0 AppTask B 12 900 8 0 PLSD B 12 588 17 0 BTC_TASK B 19 1280 13 0 btController B 23 1944 12 0 hciT B 22 1608 14 0 UartTask B 12 3244 7 0 E (12800280) task_wdt: wifi 985385013 23% esp_timer 33576316 <1% BTU_TASK 12654348 <1% tiT 20349269 <1% BleTask 1416408 <1% PLRV 12194173 <1% Tmr Svc 872985 <1% IDLE 3068596384 72% AppTask 10557 <1% PLSD 4430788 <1% BTC_TASK 3339249 <1% btController 31882690 <1% hciT 24688419 <1% UartTask 22 <1% sys_evt 12302 <1% Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0). Stack dump detected Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 0x4038018a: _interrupt_handler at ??:? 0x4038014c: _interrupt_handler at ??:? TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a 0x40380001: _vector_table at ??:? MHARTID : 0x00000000 Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'm:\zjq\bhg\examples\hthealthgw\build\htHealthGW.elf', '-ex', 'target remote | "M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"', '-ex', 'bt']' returned non-zero exit status 1. b'M:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.\r\nerror starting child process '"M:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe" "M:\Espressif\frameworks\esp-idf-v4.4.1\tools\idf_monitor_base..\gdb_panic_server.py" --target esp32c3 "C:\Users\49644\AppData\Local\Temp\tmpayzfske5"': CreateProcess: No such file or directory\r\nNo stack.\r\n' Core 0 register dump: MEPC : 0x4038018a RA : 0x4038014c SP : 0x3fc93d10 GP : 0x3fc90800 TP : 0x3fc74564 T0 : 0x00001881 T1 : 0x600c2124 T2 : 0x00000003 S0/FP : 0x00000100 S1 : 0x80000004 A0 : 0x3fc93d10 A1 : 0x0000000a A2 : 0x3fc93ce0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x3fcdf9f8 A6 : 0x80000000 A7 : 0x00000010 S2 : 0x00001881 S3 : 0x00000002 S4 : 0x00081e89 S5 : 0xfffbffff S6 : 0x83828180 S7 : 0x3fce0000 S8 : 0x3ff1b000 S9 : 0x3fce0000 S10 : 0x3fcdf934 S11 : 0x00000000 T3 : 0x3fc9a5d0 T4 : 0x00000001 T5 : 0x00000002 T6 : 0x00000002 MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000018 MTVAL : 0x0000850a MHARTID : 0x00000000 Stack memory: 3fc93d10: 0x40002da4 0x40002d90 0x3ff1b000 0x3fce0000 0x3fc74564 0x7fffffff 0x00000000 0x00000002 3fc93d30: 0x00000100 0x3fce0000 0x0000002c 0x0000000a 0x3fc93ce0 0x00000001 0x00000001 0x3fcdf9f8 3fc93d50: 0x80000000 0x00000010 0x3fce0000 0x3fcdf96c 0x00081e89 0xfffbffff 0x83828180 0x3fce0000 3fc93d70: 0x3ff1b000 0x3fce0000 0x3fcdf934 0x00000000 0x00000000 0x00000000 0x00000001 0x00000002 3fc93d90: 0x8e89bed6 0x00000000 0x00000000 0x4002e924 0x00001881 0x3fc977ac 0x3fc977a4 0x3fce0000 3fc93db0: 0x3fce0000 0x3fce0000 0x3fcaadb8 0x00000001 0x00001881 0x80000005 0x3fce0000 0x40009b80 0x3fca372c 3fc93df0: 0x3fca372c 0x00000001 0x3fca4194 0xffffffff 0x3fca4194 0x3fca4194 0x00000000 0x3fc93e10 3fc93e10: 0xffffffff 0x3fc93e10 0x3fc93e10 0x00000000 0x3fc93e24 0xffffffff 0x3fc93e24 0x3fc93e24 3fc93e30: 0x00000000 0x3fc93e38 0xffffffff 0x3fc93e38 0x3fc93e38 0x00000000 0x3fc93e4c 0xffffffff 3fc93e50: 0x3fc93e4c 0x3fc93e4c 0x00000000 0x3fc93e60 0xffffffff 0x3fc93e60 0x3fc93e60 0x00000000 3fc93e70: 0x3fc93e74 0xffffffff 0x3fc93e74 0x3fc93e74 0x00000000 0x3fc93e88 0xffffffff 0x3fc93e88 3fc93e90: 0x3fc93e88 0x00000000 0x3fc93e9c 0xffffffff 0x3fc93e9c 0x3fc93e9c 0x00000000 0x3fc93eb0 3fc93eb0: 0xffffffff 0x3fc93eb0 0x3fc93eb0 0x00000000 0x3fc93ec4 0xffffffff 0x3fc93ec4 0x3fc93ec4 3fc93ed0: 0x00000002 0x3fcc4574 0xffffffff 0x3fcbfb1c 0x3fcc4574 0x00000000 0x3fc93eec 0xffffffff 3fc93ef0: 0x3fc93eec 0x3fc93eec 0x00000000 0x3fc93f00 0xffffffff 0x3fc93f00 0x3fc93f00 0x00000000 3fc93f10: 0x3fc93f14 0xffffffff 0x3fc93f14 0x3fc93f14 0x00000000 0x3fc93f28 0xffffffff 0x3fc93f28 3fc93f30: 0x3fc93f28 0x00000000 0x3fc93f3c 0xffffffff 0x3fc93f3c 0x3fc93f3c 0x00000001 0x3fca92e4 3fc93f50: 0xffffffff 0x3fca92e4 0x3fca92e4 0x00000000 0x3fc93f64 0xffffffff 0x3fc93f64 0x3fc93f64 3fc93f70: 0x00000001 0x3fcbcc44 0xffffffff 0x3fcbcc44 0x3fcbcc44 0x00000000 0x3fc93f8c 0xffffffff 3fc93f90: 0x3fc93f8c 0x3fc93f8c 0x00000001 0x3fca232c 0xffffffff 0x3fca232c 0x3fca232c 0x00000001 3fc93fb0: 0x3fcace9c 0xffffffff 0x3fcace9c 0x3fcace9c 0x00000000 0x3fc93fc8 0xffffffff 0x3fc93fc8 3fc93fd0: 0x3fc93fc8 0x00000000 0x3fc93fdc 0xffffffff 0x3fc93fdc 0x3fc93fdc 0x00000000 0x3fc93ff0 3fc93ff0: 0xffffffff 0x3fc93ff0 0x3fc93ff0 0x00000000 0x3fc94004 0xffffffff 0x3fc94004 0x3fc94004 3fc94010: 0x00000007 0x3fcaa2e8 0xffffffff 0x3fca08bc 0x3fcbb160 0x00000000 0x3fc9402c 0xffffffff 3fc94030: 0x3fc9402c 0x3fc9402c 0x00000001 0x00000789 0x3fcbe920 0x3fc9a678 0x00000000 0x00000000 3fc94050: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94070: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc94090: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 3fc940d0: 0x00000000 0x00000000 0x00000001 0x3fc940e0 0xffffffff 0x3fcbe924 0x3fcbe924 0x00000000 3fc940f0: 0x3fc940f4 0xffffffff 0x3fc940f4 0x3fc940f4 0x3fc94038 0x3fc94048 0x3fc940d8 0x3fc94038 ELF file SHA256: d248eaa63d177410 ELF file SHA256: d248eaa63d177410 Rebooting... ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT) Saved PC:0x4038062a 0x4038062a: esp_restart_noos_dig at M:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/esp_system.c:44 (discriminator 1)

Other items if possible

sdkconfig file

Hi there. I'm facing the same issue but in my case I'm not connecting to a BT Device. Only doing the "Advertisement Scan". I have another big concern, the processor is not "reseting" after watchdog get triggered. It means my device get stuck and doesn't recover from this state.

Could you please try help me on that? Have you ever seen this before?

Please See bellow the output:

DIAG0 1000e3a0 DIAG1 120b0000 BB DIAG0: 000a5384 BB DIAG1: ca000c82 BB DIAG2: 00000000 BB DIAG3: 8e89bed6 BB DIAG4: 00000000 BB DIAG5: 00000000 assert rwble.c 261, param 00020000 00000000 E (2411792) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (2411792) task_wdt: - IDLE (CPU 0) E (2411792) task_wdt: Tasks currently running: E (2411792) task_wdt: CPU 0: wifi

Hi, my menucofig Component config->Esp System Settings->Invoke panic handler on Task Watchdog timeout was selected. When wacthdog timeout happend, components\esp_system\task_wdt.c task_wdt_isr() will run into "abort()" restart.

if (twdt_config->panic){ //Trigger Panic if configured to do so ESP_EARLY_LOGE(TAG, "Aborting."); portEXIT_CRITICAL_ISR(&twdt_spinlock); esp_reset_reason_set_hint(ESP_RST_TASK_WDT); abort(); }

nishanth-radja commented 2 years ago

Hi @xueren-git, I am trying to repro the issue. Are you using a wpa2-psk connection for wifi and the data packet which are sent every 10 seconds,Do you use TCP or UDP?

xueren-git commented 2 years ago

Yes, it's. A WPA2-PSK connection for wifi, an TCP socket connection , and Using the SNTP server: pool.ntp.org. Gattc ble scanning all the time, but no ble device connection. The complete log file are attached which abort several times. 

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2022年7月4日(星期一) 中午1:36 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

Hi @xueren-git, I am trying to repro the issue. Are you using a wpa2-psk connection for wifi and the data packet which are sent every 10 seconds,Do you use TCP or UDP?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

xueren-git commented 2 years ago

Hi @xueren-git, I am trying to repro the issue. Are you using a wpa2-psk connection for wifi and the data packet which are sent every 10 seconds,Do you use TCP or UDP?

The tcp socket sent a few byts to server, and recv the server ack data every 10 seconds.

xueren-git commented 2 years ago

example_ble_sec_gattc_demo_wifi.txt

xueren-git commented 2 years ago

Hi there. I try to remove gattc security code from my application or do not initialize WiFi, and the issue would not happen. However, I need to use that. And I try the sdk example "gatt_security_client", the issue would not happen. But if I add WiFi connection in this example, the issue would happe.

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2022年7月4日(星期一) 中午1:36 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

Hi @xueren-git, I am trying to repro the issue. Are you using a wpa2-psk connection for wifi and the data packet which are sent every 10 seconds,Do you use TCP or UDP?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

xueren-git commented 2 years ago

I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection.

xueren-git commented 2 years ago

Thank you for your reply.

  1. sdkconfig file in email attachment.
  2. Config Dual mode, but my application code only use ble.
  3. Time is no fixed, sometimes more than ten hours, sometimes an hour or two. 4. esp_ble_gap_start_scanning(0), ble scanning all the time, and no ble device connection. 5. Partial code:

Wifi config sta mode, an connection working, send several bytes every 10 seconds.

//===Ble init === bool BleStart(void) { esp_err_t err; esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();

LOG_INFO("Start ...");
gBleScaning = false;

err = esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
ERROR_ESP_RETURN(err, false, "Bt mem release ERROR");

err = esp_bt_controller_init(&amp;bt_cfg);
ERROR_ESP_RETURN(err, false, "Bt controller init ERROR");

err = esp_bt_controller_enable(ESP_BT_MODE_BLE);
ERROR_ESP_RETURN(err, false, "Bt controller enable ERROR");

err = esp_bluedroid_init();
ERROR_ESP_RETURN(err, false, "Bluedroid init ERROR");

err = esp_bluedroid_enable();
ERROR_ESP_RETURN(err, false, "Bluetooth enable ERROR");

err = esp_ble_gap_register_callback(esp_gap_cb);
ERROR_ESP_RETURN(err, false, "Gap callback init ERROR");
err = esp_ble_gattc_register_callback(esp_gattc_cb);
ERROR_ESP_RETURN(err, false, "[Gattc] register callback ERROR");

#ifdef CONFIG_BLE_MUT
err = esp_ble_gatt_set_local_mtu(CONFIG_BLE_MUT);
LOG_ERROR_ESP_IF(err, "Set local mtu ERROR");
LOG_INFO("Set local mut %d", CONFIG_BLE_MUT);
#endif

esp_ble_gap_config_local_privacy(true);
esp_ble_auth_req_t      auth_req = ESP_LE_AUTH_REQ_SC_MITM_BOND;     // bonding with peer device after authentication
esp_ble_io_cap_t        iocap = ESP_IO_CAP_IN;
uint8_t key_size    = 16;   //the key size should be 7~16 bytes
uint8_t init_key    = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t rsp_key     = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t oob_support = ESP_BLE_OOB_DISABLE;
esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &amp;auth_req, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &amp;iocap, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &amp;key_size, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_OOB_SUPPORT, &amp;oob_support, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &amp;init_key, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &amp;rsp_key, sizeof(uint8_t));

if(gBleTask == INVALID_TASK)
{
    gBleTask = task_create("BleTask", BLE_TASK_PRIORIYT, BLE_TASK_SIZE, 0, BleTaskFun, 0);
    if(gBleTask == INVALID_TASK)
    {
        LOG_ERROR("Task create ERROR");
        return false;
    }
}

LOG_INFO("Start ok");
return true;

}

//==== Ble scan param set ==== static bool Scan_SetParam(void) { esp_ble_scan_params_t tScanParam; memset(&tScanParam, 0, sizeof(tScanParam)); tScanParam.scan_type   = BLE_SCAN_TYPE_ACTIVE; tScanParam.own_addr_type   = BLE_ADDR_TYPE_PUBLIC; tScanParam.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL; tScanParam.scan_interval   = 0x50; tScanParam.scan_window   = 0x30; tScanParam.scan_duplicate   = BLE_SCAN_DUPLICATE_DISABLE; esp_err_t err = esp_ble_gap_set_scan_params(&tScanParam); ERROR_ESP_RETURN(err, false, "Scan set param ERROR"); LOG_DEBUG("Sacn set param"); return true; }

//==== Ble scan start ==== static void Scan_Start(void) { esp_err_t err = esp_ble_gap_start_scanning(0); if(err == ESP_OK) { LOG_INFO("Scan start ..."); gBleScaning = true; } else { LOG_ERROR_ESP(err, "Scan start ERROR"); } gBleScanDelay = 0; }

//===Gap callbacks=== static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { switch (event) { case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: gBleInitOk = true; Scan_Start(); Adv_Config(); break;

    case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
        ERROR_BT_BREAK(param-&gt;scan_start_cmpl.status, "[Gap] SCAN_START_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SCAN_START_COMPLETE ok");
        gBleScaning = true;
        break;

    case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:
        ERROR_BT_BREAK(param-&gt;scan_stop_cmpl.status, "[Gap] SCAN_STOP_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SCAN_STOP_COMPLETE ok");
        gBleScaning = false;
        break;

    case ESP_GAP_BLE_SCAN_RESULT_EVT:
        switch (param-&gt;scan_rst.search_evt)
        {
            case ESP_GAP_SEARCH_INQ_RES_EVT:
            {
                // check mac,Determine whether to connect or no
                break;
            }

            default:
                LOG_WARN("[Gap] SCAN_RESULT (event=%d no do)", param-&gt;scan_rst.search_evt);
                break;
        }
        break;

    case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT:
        ERROR_BT_BREAK(param-&gt;local_privacy_cmpl.status, "[Gap] SET_LOCAL_PRIVACY_COMPLETE ERROR")
        LOG_DEBUG("[Gap] SET_LOCAL_PRIVACY_COMPLETE ok");
        Scan_SetParam();
        break;

    case ESP_GAP_BLE_OOB_REQ_EVT:
    {
        uint8_t tk[16] = {1};
        esp_ble_oob_req_reply(param-&gt;ble_security.ble_req.bd_addr, tk, sizeof(tk));
        break;
    }

    case ESP_GAP_BLE_PASSKEY_REQ_EVT:

        break;

    case ESP_GAP_BLE_AUTH_CMPL_EVT:
        break;

    case ESP_GAP_BLE_SEC_REQ_EVT:
        esp_ble_gap_security_rsp(param-&gt;ble_security.ble_req.bd_addr, true);
        break;

    case ESP_GAP_BLE_NC_REQ_EVT:
        esp_ble_confirm_reply(param-&gt;ble_security.ble_req.bd_addr, true);
        break;

    case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT:
        gAdvConfigDone &amp;= ~ADV_CONFIG_ADV;
        Adv_Start();
        break;

    case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT:
        gAdvConfigDone &amp;= ~ADV_CONFIG_RSP;
        Adv_Start();
        break;

    default:
        break;
}

}

//===Gattc callbacks==== static void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t param) { BleProfileNode_T pProfile = NULL;

switch (event)
{
    case ESP_GATTC_REG_EVT:         pProfile = BleProfileList_FindRegId(param-&gt;reg.app_id);          break;
    case ESP_GATTC_CONNECT_EVT:     pProfile = BleProfileList_FindMac(param-&gt;connect.remote_bda);    break;
    case ESP_GATTC_DISCONNECT_EVT:  pProfile = BleProfileList_FindMac(param-&gt;disconnect.remote_bda);break;
    default:                        pProfile = BleProfileList_FindGattcIf(gattc_if);                break;
}

if(pProfile != NULL)
{
    esp_err_t err&nbsp; = ESP_OK;
    bool needClose = false;

    switch (event)
    {
        case ESP_GATTC_REG_EVT:
            if (param-&gt;reg.status == ESP_GATT_OK)
            {
                pProfile-&gt;bIsReg = 1;
                pProfile-&gt;u8GattcIf = gattc_if;
                err = esp_ble_gattc_open(pProfile-&gt;u8GattcIf, pProfile-&gt;u8BleMac, pProfile-&gt;u8AddrType, true);
                if(err != ESP_OK)
                {
                    LOG_ERROR_ESP(err, "Profile[%d] Open ERROR", PROFILE_ID);
                    needClose = true;
                }
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] REG ERROR=%d", PROFILE_ID, param-&gt;reg.status);
                needClose = true;
            }
            break;

        case ESP_GATTC_CONNECT_EVT:
            break;

        case ESP_GATTC_OPEN_EVT:
            if (param-&gt;open.status == ESP_GATT_OK)
            {
                pProfile-&gt;bIsOpen = 1;
                pProfile-&gt;u16ConnId = param-&gt;open.conn_id;

                #ifdef CONFIG_BLE_MUT
                if((pProfile-&gt;pBleSupport-&gt;u32BleBitFlag &amp; BBT_DIS_MTU_REQ) != 0)
                {
                    Profile_Search_Service(pProfile);
                }
                else
                {
                    err = esp_ble_gattc_send_mtu_req (gattc_if, param-&gt;open.conn_id);
                    LOG_ERROR_ESP_IF(err, "Profile[%d] Config mtu ERROR", PROFILE_ID);
                }
                #else
                Profile_Search_Service(pProfile);
                #endif
                pProfile-&gt;u16RecvTimeout = (uint16_t)(pProfile-&gt;pBleSupport-&gt;u8RecvTimeout) * 10;
            }
            else
            {
                LOG_ERROR("[Gattc] Profile[%d] OPEN ERROR=%d", PROFILE_ID, param-&gt;open.status);
                needClose = true;
            }
            break;

        case ESP_GATTC_CFG_MTU_EVT:
            ERROR_GATT_BREAK(param-&gt;cfg_mtu.status, "[Gattc] Profile[%d] CFG_MTU ERROR", PROFILE_ID)
            Profile_Search_Service(pProfile);
            break;

        case ESP_GATTC_SEARCH_RES_EVT:
        {
            uint32_t u32BitFlag = pProfile-&gt;pBleSupport-&gt;u32BleBitFlag &amp; BBT_SVR_UUID_MASK;
            if(u32BitFlag == BBT_SVR_UUID_16)
            {
                if(param-&gt;search_res.srvc_id.uuid.len == ESP_UUID_LEN_16 &amp;&amp; param-&gt;search_res.srvc_id.uuid.uuid.uuid16 == pProfile-&gt;pBleSupport-&gt;u16SvrUuid)
                {
                    LOG_DEBUG("Profile[%d] Service found (uuid16)", PROFILE_ID);
                    pProfile-&gt;bIsGetService      = 1;
                    pProfile-&gt;u16SvrStartHandle = param-&gt;search_res.start_handle;
                    pProfile-&gt;u16SvrEndHandle    = param-&gt;search_res.end_handle;
                }
            }
            else if(u32BitFlag == BBT_SVR_UUID_128)
            {
                if(param-&gt;search_res.srvc_id.uuid.len == ESP_UUID_LEN_128)
                {
                    LOG_DEBUG("Profile[%d] Service found (uuid128)", PROFILE_ID);
                    pProfile-&gt;bIsGetService  &nbsp; = 1;
                    pProfile-&gt;u16SvrStartHandle = param-&gt;search_res.start_handle;
                    pProfile-&gt;u16SvrEndHandle    &nbsp; = param-&gt;search_res.end_handle;
                }
            }
            break;
        }

        case ESP_GATTC_SEARCH_CMPL_EVT:
            if (param-&gt;search_cmpl.status != ESP_GATT_OK)
            {
                LOG_ERROR("[Gattc] Profile[%d] SEARCH_CMPL ERROR (%d)", PROFILE_ID, param-&gt;search_cmpl.status);
                needClose = true;
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] SEARCH_CMPL ok (connId=%d)", PROFILE_ID, param-&gt;search_cmpl.conn_id);
                if(pProfile-&gt;BleRegNotify)
                {
                    if(pProfile-&gt;BleRegNotify(pProfile) != 0)
                    {
                        needClose = true;
                        break;
                    }
                }
                pProfile-&gt;bIsCanScan = 1;
                Scan_Start();
            }
            break;

        case ESP_GATTC_REG_FOR_NOTIFY_EVT:
            if (param-&gt;reg_for_notify.status != ESP_GATT_OK)
            {
                LOG_ERROR("[Gattc] Profile[%d] REG_FOR_NOTIFY ERROR=%d", PROFILE_ID, param-&gt;reg_for_notify.status);
                needClose = true;
            }
            else
            {
                LOG_DEBUG("[Gattc] Profile[%d] REG_FOR_NOTIFY ok", PROFILE_ID);
                pProfile-&gt;bIsCanScan = 1;
                Scan_Start();
            }
            break;

        case ESP_GATTC_NOTIFY_EVT:
            BleTranClient_Evt_Notify(param, pProfile);
            if((pProfile-&gt;BleParse != NULL) &amp;&amp; (param-&gt;notify.value_len &gt; 0))
            {
                if(pProfile-&gt;BleParse(pProfile, param-&gt;notify.handle, param-&gt;notify.value, param-&gt;notify.value_len) == 0)
                {
                    pProfile-&gt;u16RecvTimeout = (uint16_t)(pProfile-&gt;pBleSupport-&gt;u8RecvTimeout) * 10;
                }
            }
            break;

        case ESP_GATTC_WRITE_DESCR_EVT:
            if (param-&gt;write.status != ESP_GATT_OK)
            {
                if(param-&gt;write.status == ESP_GATT_INSUF_AUTHENTICATION)&nbsp;
                {
                    if(pProfile-&gt;bIsPairing == 0)
                    {
                        LOG_WARN("[Gattc] Profile[%d] WRITE_DESCR (need pair)", PROFILE_ID);
                        pProfile-&gt;bIsPairing = 1;
                        esp_ble_set_encryption(pProfile-&gt;u8BleMac, ESP_BLE_SEC_ENCRYPT_MITM);
                    }
                    else
                    {
                        LOG_WARN("[Gattc] Profile[%d] WRITE_DESCR (need pair but have do)", PROFILE_ID);
                    }
                }
                else
                {
                    LOG_ERROR("[Gattc] Profile[%d] WRITE_DESCR ERROR=%d", PROFILE_ID, param-&gt;write.status);
                }
            }
            else
            {
                if(pProfile-&gt;pBleSupport-&gt;u16ControlPointHandle &amp;&amp; param-&gt;write.handle==pProfile-&gt;pBleSupport-&gt;u16ControlPointHandle+1)
                {
                    Profile_Request(pProfile);
                }
            }
            break;

        case ESP_GATTC_CLOSE_EVT:
            pProfile-&gt;bIsOpen = 0;
            break;

        case ESP_GATTC_DISCONNECT_EVT:
            pProfile-&gt;bIsOpen = 0;
            needClose = true;
            break;

        default:
            break;
    }

    if(needClose)
    {
        Profile_Close(pProfile);
    }
}

}

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2022年6月29日(星期三) 下午2:33 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

@xueren-git can you pls give us the following. 1.SDK config 2.Are you using Nimble or bluedroid host? 3.After how long you are seeing the crash? 4.I see that you are mentioned gattc, Is there a active connection and dut continues to perform ble scan? 5.Can you attach you application which you are using.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

smetlitzky commented 1 year ago

Hi There, Was this issue ever resolved??, we are using ESP32-C3 and only Scanning for BLE and then sending MQTT packets via WiFi but after a random set of time we get the same crash and it does not reset :( Any help greatly appreciated.

Best Regards Steve

13:32:25.620 > DIAG0 1000e4a0 13:32:25.620 > DIAG1 10000000 13:32:25.625 > BB DIAG0: 000a5384 13:32:25.625 > BB DIAG1: e2000c02 13:32:25.632 > BB DIAG2: 00000000 13:32:25.637 > BB DIAG3: 8e89bed6 13:32:25.637 > BB DIAG4: 00000000 13:32:25.644 > BB DIAG5: 00000000 13:32:25.652 > assert rwble.c 261, param 00020000 00000000

chegewara commented 1 year ago

I didnt see this issue for quite long time. If i may suggest something, maybe try to switch to nimble? I cant say that my example is valid in this case, because the current firmware i am working on for over a year is on esp32 (not C3), but it is using mqtt with wifi and ble scan very intensive and its very stable, and that rwble.c assert is here for 3 years, maybe longer. Of course it also may be memory issue in your app, which would be good to check.

smetlitzky commented 1 year ago

Thanks very much for your reply. Yes we are using the nimble library but still we are having this problem.

Best Regards Steve

Sent from my iPhone

On 21 Feb 2023, at 2:18 pm, chegewara @.***> wrote:



I didnt see this issue for quite long time. If i may suggest something, maybe try to switch to nimble? I cant say that my example is valid in this case, because the current firmware i am working on for over a year is on esp32 (not C3), but it is using mqtt with wifi and ble scan very intensive and its very stable, and that rwble.c assert is here for 3 years, maybe longer. Of course it also may be memory issue in your app, which would be good to check.

— Reply to this email directly, view it on GitHubhttps://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fespressif%2Fesp-idf%2Fissues%2F9241%23issuecomment-1437916967&data=05%7C01%7C%7Cdcd74befb603465d420008db13d378ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125571205498954%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=i6kTEn6ssPbbqRXDBUz2s6K6adb6pxyyuK3zEjEGJRg%3D&reserved=0, or unsubscribehttps://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALKX35RZTYKVBQ2C4TCXV3TWYRM35ANCNFSM52AMGILQ&data=05%7C01%7C%7Cdcd74befb603465d420008db13d378ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125571205498954%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=i0lQVU80pF65zbSBhGzFXwmAkW%2F%2FesLth%2FYDZ6GcVY8%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

AxelLin commented 1 year ago

Thanks very much for your reply. Yes we are using the nimble library but still we are having this problem. Best Regards Steve

Which SoC and esp-idf version are you using? (git describe --tags)

AxelLin commented 1 year ago

Hi There, Was this issue ever resolved??, we are using ESP32-C3 and only Scanning for BLE and then sending MQTT packets via WiFi but after a random set of time we get the same crash and it does not reset :( Any help greatly appreciated.

Which esp-idf version are you using? (git describe --tags)

xueren-git commented 1 year ago

hi,i used chip esp32-c3 and IDF version : esp-idf-v4.4.1. I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection. Didn't call esp_ble_gap_config_local_privacy(true) can be solved.

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2023年2月21日(星期二) 下午2:59 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

Hi There, Was this issue ever resolved??, we are using ESP32-C3 and only Scanning for BLE and then sending MQTT packets via WiFi but after a random set of time we get the same crash and it does not reset :( Any help greatly appreciated.

Which esp-idf version are you using? (git describe --tags)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

AxelLin commented 1 year ago

hi,i used chip esp32-c3 and IDF version : esp-idf-v4.4.1. I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection. Didn't call esp_ble_gap_config_local_privacy(true) can be solved.

So you just prove this issue can be easily reproduced by calling esp_ble_gap_config_local_privacy(true) with wifi connection.

smetlitzky commented 1 year ago

Hi and thanks very much for responding.

We are using the nimble library using arduino and platformio and I don’t think we have access to esp_ble_gap_config_local_privacy(true). Unless maybe it is set as default inside the library ??

Best Regards Steve

Sent from my iPhone

On 21 Feb 2023, at 3:09 pm, Axel Lin @.***> wrote:



hi,i used chip esp32-c3 and IDF version : esp-idf-v4.4.1. I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection. Didn't call esp_ble_gap_config_local_privacy(true) can be solved.

So you just prove this issue can be easily reproduced by calling esp_ble_gap_config_local_privacy(true) with wifi connection.

— Reply to this email directly, view it on GitHubhttps://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fespressif%2Fesp-idf%2Fissues%2F9241%23issuecomment-1437958200&data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ASrAmK89l2Lctz5cz3jcUqCi3GMG0hPNYZKGLHOx2%2BQ%3D&reserved=0, or unsubscribehttps://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALKX35QBVSGVB6TGSRPCGKTWYRS3LANCNFSM52AMGILQ&data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ga2JqleX2leXFe2rfd36RzObv6gUuI2NLxSbc3kLlZ4%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

xueren-git commented 1 year ago

Hi, the api esp_ble_gap_config_local_privacy() in include components/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h . I didn't use the IDE, i used ESP-IDF 4.4 CMD. I guess maybe arduino and platformio didn't include this header file.

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2023年2月21日(星期二) 下午3:55 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

Hi and thanks very much for responding.

We are using the nimble library using arduino and platformio and I don’t think we have access to esp_ble_gap_config_local_privacy(true). Unless maybe it is set as default inside the library ??

Best Regards Steve

Sent from my iPhone

On 21 Feb 2023, at 3:09 pm, Axel Lin @.***> wrote:



hi,i used chip esp32-c3 and IDF version : esp-idf-v4.4.1. I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection. Didn't call esp_ble_gap_config_local_privacy(true) can be solved.

So you just prove this issue can be easily reproduced by calling esp_ble_gap_config_local_privacy(true) with wifi connection.

— Reply to this email directly, view it on GitHub<https://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fespressif%2Fesp-idf%2Fissues%2F9241%23issuecomment-1437958200&amp;data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ASrAmK89l2Lctz5cz3jcUqCi3GMG0hPNYZKGLHOx2%2BQ%3D&amp;reserved=0&gt;, or unsubscribe<https://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALKX35QBVSGVB6TGSRPCGKTWYRS3LANCNFSM52AMGILQ&amp;data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ga2JqleX2leXFe2rfd36RzObv6gUuI2NLxSbc3kLlZ4%3D&amp;reserved=0&gt;. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

xueren-git commented 1 year ago

It's default esp_ble_gap_config_local_privacy(false) 

------------------ 原始邮件 ------------------ 发件人: "espressif/esp-idf" @.>; 发送时间: 2023年2月21日(星期二) 下午3:55 @.>; @.**@.>; 主题: Re: [espressif/esp-idf] WiFi and ble run for a period of time, and rwble.c 261 error (IDFGH-7699) (Issue #9241)

Hi and thanks very much for responding.

We are using the nimble library using arduino and platformio and I don’t think we have access to esp_ble_gap_config_local_privacy(true). Unless maybe it is set as default inside the library ??

Best Regards Steve

Sent from my iPhone

On 21 Feb 2023, at 3:09 pm, Axel Lin @.***> wrote:



hi,i used chip esp32-c3 and IDF version : esp-idf-v4.4.1. I found that the cause of the problem was the use of both esp_ble_gap_config_local_privacy(true) and wifi connection. Didn't call esp_ble_gap_config_local_privacy(true) can be solved.

So you just prove this issue can be easily reproduced by calling esp_ble_gap_config_local_privacy(true) with wifi connection.

— Reply to this email directly, view it on GitHub<https://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fespressif%2Fesp-idf%2Fissues%2F9241%23issuecomment-1437958200&amp;data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ASrAmK89l2Lctz5cz3jcUqCi3GMG0hPNYZKGLHOx2%2BQ%3D&amp;reserved=0&gt;, or unsubscribe<https://kor01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALKX35QBVSGVB6TGSRPCGKTWYRS3LANCNFSM52AMGILQ&amp;data=05%7C01%7C%7C0714a49a8c644689d31f08db13da9ade%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638125601861045933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ga2JqleX2leXFe2rfd36RzObv6gUuI2NLxSbc3kLlZ4%3D&amp;reserved=0&gt;. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

wmy-espressif commented 1 year ago

Hi @smetlitzky @xueren-git , this issue is resolved in git commit(v4.4.2-237-g8e6af17ee5) for branch release/v4.4, and TAG v4.4.3 includes this bugfix.

This issue is related to a Bluetooth hardware error when using address resolution function.

chegewara commented 1 year ago

Nice to finally see the real reason of this issue, which actually is confirming what i suspected (hardware issue). This also is the reason why it popped: IDF version : esp-idf-v4.4.1 assuming its finally fixed in v4.4.2-237 I also believe this is bluedroid function and nimble should have its own version: esp_ble_gap_config_local_privacy

Thanks

LNqueen commented 1 year ago

Hello, if I use the arduino and platform.io, how can I fix this issue? I can't find the esp_ble_gap_config_local_privacy() function, and I used the Nimble module, thanks a lot.