I want to find out how our system responds when a FAT error occurs during the FAT initialization.
Is there a function or method for killing the FAT file system so that on power up or reboot the initialization process fails?
I tried just opening a file for writing and continuously writing data with no close. This doesn't seem to break things.
I am using IDF 4.4.4 with Arduino.
Thanks,
Mike.
How to create a FAT error for testing?
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: How to create a FAT error for testing?
You can use esptool to target "damage" at a specific spot in the filesystem. For example, using the default fat partition scheme:
This will clear (0xFF) the first 8 bytes of the partition.
Is the same effect, but with zeros.
Code: Select all
./esptool.py erase_region 0x29000 8
Code: Select all
dd if=/dev/zero of=zeros bs=1 count=8
./esptool.py write_flash 0x29000 zeros
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to create a FAT error for testing?
Note that this likely actually erases 4096 bytes, as that is the minimum quantity the flash chip allows you to erase.lbernstone wrote: ↑Tue Jun 13, 2023 9:47 pmYou can use esptool to target "damage" at a specific spot in the filesystem. For example, using the default fat partition scheme:This will clear (0xFF) the first 8 bytes of the partition.Code: Select all
./esptool.py erase_region 0x29000 8
Who is online
Users browsing this forum: No registered users and 43 guests