When using the SimpleLink Start app to perform an OAD, I need to press the RESET TARGET button to reset the target and boot into the persistent app before transferring the OAD image. The RESET TARGET works correctly in iOS app but is not responding in the Android app. I searched the forum and found several similar posts but found no solution, so I did a little research and had some findings which may relate to this issue, however my knowledge about BLE is limited and I need help to understand the principle behind the findings.
In the sniffer logs, the difference of the data sent by the cellphone can be found as below. The iOS app sent a WRITE_REQUEST while the Android app sent a WRITE_COMMAND.
Following this lead into the simple_peripheral_oad_onchip example, it can be found that CC2642 enters SimplePeripheral_processOadResetEvt() when receiving a WRITE REQUEST of WRITE COMMAND, in which it calls L2CAP_RegisterFlowCtrlTask() to register for L2CAP Flow Control Events. And when the L2CAP event is triggered, it enters SimplePeripheral_processL2CAPMsg() and register for the Connection Event while set oadWaitReboot = true. When the next connection event comes, it enters SimplePeripheral_processConnEvt() and finally calls SystemReset() to reset the chip.
The problem is with the Android app, the SimplePeripheral_processOadResetEvt() can be reached, but it never trigger the L2CAP Flow Control Events thus the SimplePeripheral_processL2CAPMsg() is never called. I'm guessing the WRITE COMMAND does not need any response so no L2CAP packet is ever send after, but I don't know the BLE protocol that well so I'm not sure about this.
My questions are as follows:
1. Is the difference between the iOS and the Android app an expected behavior? Is it possible to fix it in the coming version of the SimpleLink Starter app?
2. Is my guess of the L2CAP event and WRITE COMMAND correct? When is the L2CAP event triggered?
3. If I want to fix this by modifying the simple_peripheral_oad_onchip example, how can I do it?
Best regards,
Shuyang