Xiao BLE Sense Flash data gets corrupted (Zephyr)

Hi guys,
I am using Zephyr with a Seeed Studio Xiao BLE Sense board to log data to the onboard QSPI flash with the help of FAT filesystem. I am using the USB Mass Storage Class to then transfer those logs to my computer.
When it is powered with a USB cable hooked to my computer everything works fine, however when it is powered through the pads on the bottom of the board (either with a battery or with a stable 3.6V supply), data sometimes gets corrupted: some blocks of 256 bytes of data (aka the size of a flash page) are written as 0xFF instead of my own data. Corrupted blocks happen a little randomly, but they seem to always be page-aligned.
Do you have an idea of what could be causing this ?

Thanks in advance for your help

Hi there,
So with the QSPI flash I know its a set BIT only kinda write thing so, Pages must be reset or cleared prior and as far as serial goes, sounds like either with usb the “while serial” is in the code or the buffers are getting over-run when NO serial device is present?
Without seeing the code these are just guesses. Use the Code tags </> above and paste in there the main.c others will comment as well.
HTH
GL :slight_smile: PJ :v:

1 Like

Hi,

Here are some links related to your issue: