kscheff / BlueBasic

BASIC interpreter for CC2540 and CC2541 Bluetooth LE chips
11 stars 9 forks source link

BLE advertising not starting after REBOOT #4

Closed kscheff closed 5 years ago

kscheff commented 7 years ago

After uploading a new BlueBasic program typically AUTORUN ON is used to start the program after power up. When disconnecting the device now, the device looses BLE advertising and you are forced to reset the device. Issuing a REBOOT command before disconnect fixes the issue partially, since it only reboot successfully with BLE advertising when you disconnect from the device quickly after issuing REBOOT.

It seems to be that REBOOT (which generates internally a SystemReset() soft reset) does not really clean all bluetooth related states (currently BlueBasic runs on BLE Stack 1.4.0). There is a hint in the BLE Stack 1.4.1 release notes: http://processors.wiki.ti.com/index.php/CC254X_Release_Notes

Fixed HCI_EXT_ResetSystem soft reset to work as expected on CC254x

Testing if this helps would require to port the project to BLE Stack 1.4.1 which is a painful procedure.

kscheff commented 5 years ago

1.4.2.2 fixes this