2017年4月1日 星期六

[U-boot] [I.MX6] bootenv emmc set error

If you bootarg set error ,can clear by mfg_tool
but you need know the emmc block address

MFG_tools/Profiles/Linux/OS Firmware/ucl2.xml

<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>

The persistent storage, where the block comes from, is platform-specific. Some common storage options (and source file handling that storage option):
NOR flash   common/env_flash.c
SPI flash   common/env_sf.c
MMC         common/env_mmc.c
CONFIG_ definitions in include/configs/yourboard.h will determine the details.


#define CONFIG_SYS_ENV_SECT_SIZE        (128 << 10)     /* 128 KiB */
#define CONFIG_ENV_OFFSET               SMNAND_ENV_OFFSET
#define CONFIG_ENV_ADDR                 SMNAND_ENV_OFFSET
skip 是略過 if (input file)  所指定的檔案 的  bs * count 大小 然後才開始讀入
seek 是略過 of (output file) 所指定的檔案 的  bs * count 大小 然後才開始寫入
bs 大小 default 是 512 bytes, 切記 count 一要給!

dd 常用的參數如下:
if=FILE:指定輸入檔案名稱(input file)為 FILE
of=FILE:指定輸出檔案名稱(output file)為 FILE
ibs=BYTES:指定輸入區塊大小(input block size),一次讀取 BYTES 位元組的資料,預設為 512 位元組
obs=BYTES:指定輸出區塊大小(output block size),一次寫入 BYTES 位元組的資料,預設為 512 位元組
bs=BYTES:指定 block size,一次讀取與寫入 BYTES 位元組的資料,此選項會覆蓋 ibs 與 obs 的設定
cbs=BYTES:一次轉換 BYTES 位元組的資料
count=N:只處理 N 個輸入區塊,每個區塊的大小為 ibs
seek=N:在輸出時跳過輸出檔案的前 N 個區塊,每個區塊的大小為 obs
skip=N:在輸入時跳過輸入檔案的前 N 個區塊,每個區塊的大小為 ibs
conv=CONVS:指定資料的轉換選項,如果一次要指定多種轉換,則以逗點分隔


沒有留言:

張貼留言