Watchdog Trigger Corrupts Filesystem



  • I've started using the watchdog timer routines to protect my program from lockups, but what I have discovered is if the watchdog is triggered and resets the processor the file system is corrupted (reformatted?).

    Here's what the os.listdir() shows after the watchdog reset. All my program files are gone.

    ['\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00',
    <etc.>
    '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', 'main.py', 'sys', 'lib', 'cert', 'boot.py']

    Has anyone else seen this problem?



  • Could you simply feed the WDT while you write until you flush?



  • @iwahdan
    I was using the FAT file system in stable v1.18.2. I've now switched to the LittleFS in the beta v1.20.0.rc7 and the problem so far has not reappeared.



  • Hmmmm - this might also explain why I get a lot of sync problems - "project status unknown, resync all (or so)" in pymakr.



  • Hi @tlanier, which Filesystem are you using FAT or LittleFS?


 

Pycom on Twitter