How could the flash tool erase emmc quickly ?

Hi All,
We split emmc into several partition. One of these is around 5GB.
We would like to erase and reflash new image into it in ubuntu.
We use dd to erase all old contents on it.

dd if=/dev/zero of=/dev/mmcblk0p2 bs=1M

But this takes a long time.
We find the flash tool could erase the emmc very quickly.
Does anyone know how the flash tool erase the emmc?


Do you have to erase the full partition or would it meet your requirements to just re-format the partition? If you don’t have a filesystem in the partition this obviously won’t help.

Hi D3_growe,
I have to erase the full partition since I need to write a sprse image into it.

Depending on the tool doing the write, then likely empty spaces will be filled with any optional byte. The flash software for L4T on Jetsons uses a NULL byte for this. The implication is that you wouldn’t need to pre-erase if that NULL byte is getting written.

When a regular flash creates the NVIDIA version of a sparse file system (not compatible with other sparse software tools, but a Jetson in recovery mode understands this format) it does the following:

sudo mksparse -v --fillpattern=0 system.img.raw system.img

What tools are you using for conversion from raw to sparse and flash of sparse to partition?