aanon4 / BlueBasic

BASIC interpreter for CC2540 and CC2541 Bluetooth LE chips
https://gitlab.com/timwilkinson/BlueBasic
97 stars 55 forks source link

Flashstore gets corrupted and programs gets garbled #34

Open kscheff opened 7 years ago

kscheff commented 7 years ago

When writing files and program code the memory becomes eventually low. BlueBasic then tries to free up some memory by compacting the flash store. However this function is seriously broken and it messes up the flash store. Typically this destroys parts of the stored program. In some cases this locks the entire device, so you can only recover by CC-Debugger.

This bug gets triggered when the flash store_compact() routine gets called. I have fixed the bug here https://github.com/kscheff/BlueBasic/commit/d202a8f2c112f7504bf3dd5ebb2cc9a149027670