Ticket Created
over 4 years ago

JAZZ-2957

Transferred

BLE related device crash

In my Battery State app, I'm also attempting to read battery info from nearby BLE heart rate monitors (since AntPlus API does not support heart rate devices). This itself works, I'm able to pair and read the battery information ok.

However there is something wrong with stopping and starting the app quickly. When done quickly enough, I get device crash. This can be repeated very easily on my Edge 530. I'm not fully certain, but based on my debug printfs, crash seems to come sometime after I have received onProfileRegister callback.

I have tried to unpair the BLE devices onStop of the app, without making any change. I also looked into unregistering my BLE UUIDs if that would make difference, but I didn't find a way for it.

I paste the log info here:

====================================================================

[
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128451000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"BTF main - Error type ( 0 ) File( ..\\..\\..\\UNI\\uni_cnvt.c ) Line( 2634 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:0:51",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61E96128",
"Task Name":"BTF main",
"File Name":"..\\..\\..\\UNI\\uni_cnvt.c",
"Line Number":"2634",
"Message":"2634"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128517000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"HWM GFS main - Error type ( 0 ) File( ..\\..\\..\\JEFF\\jeff_fat.c ) Line( 479 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:1:57",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61FFBC00",
"Task Name":"HWM GFS main",
"File Name":"..\\..\\..\\JEFF\\jeff_fat.c",
"Line Number":"479",
"Message":"479"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128519000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"HWM GFS main - Error type ( 0 ) File( ..\\..\\..\\JEFF\\jeff_fat.c ) Line( 479 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:1:59",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61FFBC00",
"Task Name":"HWM GFS main",
"File Name":"..\\..\\..\\JEFF\\jeff_fat.c",
"Line Number":"479",
"Message":"479"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128519000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"HWM GFS main - Error type ( 0 ) File( ..\\..\\..\\JEFF\\jeff_fat.c ) Line( 479 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:1:59",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61FFBC00",
"Task Name":"HWM GFS main",
"File Name":"..\\..\\..\\JEFF\\jeff_fat.c",
"Line Number":"479",
"Message":"479"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128519000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"HWM GFS main - Error type ( 0 ) File( ..\\..\\..\\JEFF\\jeff_fat.c ) Line( 479 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:1:59",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61FFBC00",
"Task Name":"HWM GFS main",
"File Name":"..\\..\\..\\JEFF\\jeff_fat.c",
"Line Number":"479",
"Message":"479"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128521000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"SYC main - Error type ( 0 ) File( ..\\..\\..\\CDP_REC_CORE\\cdp_main.c ) Line( 2116 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:2:1",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"62266220",
"Task Name":"SYC main",
"File Name":"..\\..\\..\\CDP_REC_CORE\\cdp_main.c",
"Line Number":"2116",
"Message":"2116"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128521000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"SYC main - Error type ( 0 ) File( ..\\..\\..\\CDP_REC_CORE\\cdp_main.c ) Line( 2055 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:2:1",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"62266220",
"Task Name":"SYC main",
"File Name":"..\\..\\..\\CDP_REC_CORE\\cdp_main.c",
"Line Number":"2055",
"Message":"2055"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128491000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"
Function Address: 0x601878E4
Call Address at Function: 0x60187944

Function Address: 0x6018490C
Call Address at Function: 0x60184930

Function Address: 0x6044A174
Call Address at Function: 0x6044A196

Function Address: 0x60A2EE58
Call Address at Function: 0x60A2F368

Function Address: 0x6029F6DC
Call Address at Function: 0x6029F6EA

Function Address: 0x60182CE8
Call Address at Function: 0x60182CFC

Function Address: 0x6044E1CC
Call Address at Function: 0x6044E2AE

Function Address: 0x60762CCC
Call Address at Function: 0x60762CEC

",
"error_cause":"RTL Trap",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:1:31",
"Ram Dump":"1",
"ESht PC":"0x60307141",
"ESht SP":"0x621E2798",
"Project Specific":"0x621E2798",
"CDP_LOG":"605F087D,6045A9F9,605D7681,60211D3D,601CCA11,60211D3D,601CCA11,60211D3D,601CCA11,60211D3D,601CCA11,60211D3D,601CCA11,",
"RTL Error Number":"6E5D8024",
"Error Message":"00000006,00000000,00000000,00000000,00000065,61E921A4,0000000C,00000000,00000000,00000001,00000000,D0512EB6,0000EBAD,62259AB8,6018472F,60187944,200F003F",
"Task Name":"wscm_ble_main",
"Saved SP":"62259AB8",
"Saved LR":"6018472F",
"Saved PC":"60187944",
"R[0]":"00000006",
"R[1]":"00000000",
"R[2]":"00000000",
"R[3]":"00000000",
"R[4]":"00000065",
"R[5]":"61E921A4",
"R[6]":"0000000C",
"R[7]":"00000000",
"R[8]":"00000000",
"R[9]":"00000001",
"R[10]":"00000000",
"R[11]":"D0512EB6",
"R[12]":"0000EBAD",
"R[13]":"62259AB8",
"R[14]":"6018472F",
"R[15]":"60187944",
"cpsr":"200F003F"
}

},
{
"unit_id":"3305309131",
"product_name":"Edge 530",
"software_part_number":"006-B3121-00",
"ms_since_epoch":1587128533000,
"system_version":"5.31",
"build_type":"PRODUCTION",
"backtrace":"BTF main - Error type ( 0 ) File( ..\\..\\..\\BTF\\btf_wifi_setup.c ) Line( 721 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"85668e0bdbda79c6fd3aeae4f574f911741faecd",
"Time":"2020-4-17 15:2:13",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"61E96128",
"Task Name":"BTF main",
"File Name":"..\\..\\..\\BTF\\btf_wifi_setup.c",
"Line Number":"721",
"Message":"721"
}

}
]

  • I'd say this bug had been fixed with CIQ 3.2.x. I have tested both on Fenix 6S pro and Edge 530 (beta 6.22), and I'm unable to reproduce the crash anymore.

    Thanks to everyone involved :)

  • what I've seen is like your #1.

    One thing I've done is while scanning, I not only look for the proper advertisement, but also check the rssi, as I've seen if the signal is too low, pairing may take much longer if it occurs at all, opening the window much more.

  • What I can figure out from my printfs and the sequence things go, crash might be caused by some listener callbacks trying to be called by the framework, after app (or widget) has exited. This looks similar than what you describe.

    I see at least two scenarios, depending on my timing:

    1. I find my device at onScanResults(), where I stop the scanning and start pairing. Before I get onConnectedStateChanged(), I have exited the app, and crash happens.

    2. Pairing has successfully completed, at which point I do requestRead() on my characteristic. Again if app is exited before onCharacteristicRead() is called, there will be crash.

  • I've seen something similar and I'm pretty sure there's a bug report on it.  Doesn't happen often, but in the case of a widget, I've seen a crash if while in the process of connecting, the widget is exited, there can be a crash.

    Where are you doing your connect?