linx mmc-utils erase command not working as expect

1.1k Views Asked by At

I have a system that has an eMMC card on it, and I am trying to use the erase functioanlity defined in the eMMC specification (6.6.9 Erase) using the the mmc-utils user space tool.

The implantation correct to me. But when I run the command the erase does not work as expected. mmc erase secure-erase <start address in erase blocks> <end address in erase blocks> <device/path>

root@sys:~# # write 0x02 to every byte on the on block device 
root@sys:~# tr '\0' '\2' < /dev/zero > /dev/mmcblk0
root@sys:~# mmc erase secure-erase 0 2 /dev/mmcblk0
Executing Secure Erase from 0x00000000 to 0x00000002
High Capacity Erase Unit Size=524288 bytes
High Capacity Erase Timeout=300 ms
High Capacity Write Protect Group Size=8388608 bytes
 Secure Erase Succeed
root@sys:~# hexdump /dev/mmcblk0
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0080000 0202 0202 0202 0202 0202 0202 0202 0202
*

I was expecting 2 blocks of 524288 (0x0080000) to be erased. But only one block was erased. I tried several other values and they also did not erase more then one block.

Am I using the tool correctly? does it work for others? Could this be an issue with my mmc driver? or does the issue lay with the firmware on the eMMC?

0

There are 0 best solutions below