Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim1s:development:erase-emmc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:vim1s:development:erase-emmc [2022/08/22 23:28]
hyphop [Get block-device names for boot-loaders]
products:sbc:vim1s:development:erase-emmc [2022/08/24 02:00] (current)
hyphop old revision restored (2022/08/23 15:37)
Line 56: Line 56:
 eMMC boot-loader can be stored on ''/dev/mmcblk0'' and special areas ''/dev/mmcblk0boot0'' or ''/dev/mmcblk0boot0''. eMMC boot-loader can be stored on ''/dev/mmcblk0'' and special areas ''/dev/mmcblk0boot0'' or ''/dev/mmcblk0boot0''.
  
-==== Cleanup all eMMC boot-loaders ====+==== Cleanup eMMC boot loaders ==== 
 + 
 +Cleanup special eMMC boot areas. 
  
 ```sh ```sh
-dd if=/dev/zero count=1 bs=1M | sudo tee /dev/mmcblk?boot? >/dev/null+dd if=/dev/zero count=8192 | sudo tee /dev/mmcblk?boot? >/dev/null
 ``` ```
  
-==== Get block-device names for boot-loaders ====+Also need cleanup eMMC common boot area.  
 + 
 +```sh 
 +sudo dd if=/dev/zero count=2000 seek=1 of=/dev/mmcblk0 
 +``` 
 + 
 +<WRAP important > 
 +''/dev/mmcblk0'' maybe different, please check how-to [[#get-block-device-names-for-boot-loaders]] 
 +</WRAP> 
 + 
 +==== Universal method for cleanup all eMMC boot-areas ==== 
 + 
 +```sh 
 +sudo dd if=/dev/zero count=8192 | sudo tee /dev/mmcblk?boot? >/dev/null 
 +sudo dd if=/dev/zero count=2000 seek=1 of=$(ls /dev/mmcblk?boot?|grep -m1 -o /dev/mmcblk.) 
 + 
 +``` 
 + 
 +==== Get block-device names for boot loaders ====
  
 Get block-device names for special boot areas. Get block-device names for special boot areas.
Line 73: Line 93:
 /dev/mmcblk0boot1 /dev/mmcblk0boot1
 ``` ```
 +<WRAP important >
 +''/dev/bootloader?'' same areas as ''/dev/mmcblk?boot?'', but shifted by 512 bytes
 +</WRAP>
  
 Get eMMC block-device name. Get eMMC block-device name.
Line 81: Line 104:
 ``` ```
  
-<WRAP important >+==== How-to check boot loaders content ====
  
-''/dev/bootloader?'' is just aliases for ''/dev/mmcblk?boot?''+This example display empty content for special boot-loaders areas.
  
-</WRAP>+```shell 
 +~$ for m in /dev/bootloader?;do echo $m; dd if=$m count=1 2>/dev/null | hexdump -C ;done 
  
-==== How-to check boot-loaders content ====+/dev/bootloader0 
 +00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 
 +
 +00000200 
 +/dev/bootloader1 
 +00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 
 +
 +00000200
  
-This example display empty content for special boot-loaders areas.+``` 
 + 
 +Display same but for other boot areas names.
  
 ```shell ```shell
-~$ for m in /dev/mmcblk?boot?;do dd if=$m count=1 2>/dev/null | hexdump -C; done +~$ for m in /dev/mmcblk?boot?;do echo $m; dd if=$m skip=1 count=1 2>/dev/null | hexdump -C ;done  
 + 
 +/dev/mmcblk2boot0
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 * *
 00000200 00000200
 +/dev/mmcblk2boot1
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 * *
Line 101: Line 137:
 ``` ```
  
-Next example display valid boot-loader header ''@ML''.+Next example display valid boot loader header ''@ML''.
  
 ```shell ```shell
-~$ dd if=/dev/mmcblk2 count=1 skip=1 2>/dev/null | hexdump -C | head -n1+~$ dd if=/dev/mmcblk0 count=1 skip=1 2>/dev/null | hexdump -C | head -n1
 00000000  40 4d 4c 20 8d 66 31 ed  00 00 00 00 80 05 00 00  |@ML .f1.........| 00000000  40 4d 4c 20 8d 66 31 ed  00 00 00 00 80 05 00 00  |@ML .f1.........|
 ``` ```
Last modified: 2022/08/22 23:28 by hyphop