Force damage partition.

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Force damage partition.

Post by prem111 » Mon Feb 22, 2021 6:07 pm

How to force intentional damage to partition or fs corrupt? I need for tests. Thanks.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Force damage partition.

Post by dhylands » Mon Feb 22, 2021 9:46 pm

On the Pyboard, you can use the following script: https://github.com/dhylands/upy-example ... aord-fs.sh which I'll also show the contents of here:

Code: Select all

#!/bin/sh
#
# This script demonstates how to erase just the filesystem on a pyboard.
#
# It actually only erases the first sector of the filesystem, but this
# is enough to make micropython reinitialize things.

set -x

echo -e -n "\xff" > ff.bin
dfu-util -s 0x08004000:leave -a 0 -d 0483:df11 -D ff.bin

prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: Force damage partition.

Post by prem111 » Wed Feb 24, 2021 12:34 pm

Thank you, do you have an idea for esp32?

Post Reply