Closed simonmorrish closed 6 years ago
Could you share project in PXT and post the URL in this bug?
This bug affects me too. Corruption begins at data index 116 when printed to serial, and becomes more prevalent after that: https://pxt.microbit.org/55832-64036-02150-34008
I get the corruption simonmorrish showed at line 25 and on using the file append line to write strings: https://pxt.microbit.org/96921-93818-70560-16976
Two workarounds to the bug: 1) Output the data as two rows with multiple columns, rather than two columns with multiple rows: something about appendLine makes it cause corruption much sooner than appendString 2) Remove the radio or bluetooth package from the javascript explorer, the corruption starts later, at line 300 or so
Datalogging example storage strategy improvement (not related to filesystem bug): 1) Don't save timestamps in flash storage, generate them during data upload to save space
This example datalogging code can record 1300 samples, corruption free, using these three workarounds: https://pxt.microbit.org/04221-99382-95740-17742
Corruption is fixed through new heap allocator. Indeed BLE stack was silently corruption heap.
When using the accelerometer example on the GitHub page, and reading the serial data using TeraTerm, the received data is corrupted, as enclosed. It looks to me like the kind of symptom you'd get with concurrent write access to the file or pointer overruns, but it may have another cause, of course. I don't believe it is corruption on reception of the serial data, because the string "MICROBIT_FS_1 " appears in the data, and it is hard to explain that except by corruption during either reading or writing the file.