This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X - Uboot 清除環境變數



Dear TI 

我將uboot 燒在spi nor flash內,dtb+kernel+rootfs放在eMMC內,有變更uboot的bootfile=uImage (原本是zImage) 

請問當清空環境變數時,為何系統重啟後,會自動載入zImage? 這是系統預設的? 

謝謝~再麻煩您解惑

Edwin Huang

  • printenv打印看一下bootfile是否保存成功?
  • 原本有存環境變數是uImage ( 有透過printenv確認 )
    也確認可以reading uImage
    但我們做清空環境變數後
    重新開機後,看起來uboot會主動預設成zImage ( 有看見reading zImage log)
    此時去printenv查bootfile時,確實變更為zImage
  • 不清楚环境变量具体是被保存在了哪里,请试试看在<Processor SDK>/board-support/u-boot-<version>/include/configs/am335x_evm.h里编辑bootfile,然后再编译uboot.img.
  • 我都是改這份檔案的,然後編譯出uboot.img
  • Hi Nancy
    想請教一個問題
    從am335x_evm.h中的#define CONFIG_EXTRA_ENV_SETTINGS
    上面寫的名稱是 EXTRA ,
    然後網路上有看到一個類似儲存環境變數的檔案uEnv.txt,
    我的猜測是,am335x_evm.h 的ENV Setting環境變數會被覆蓋到 default 的環境變數去

    目前還再查詢uboot從usb開啟後,系統會透過fat.c 的fat_read_file去取得 uImage或zImage的字串。

    只是Trace code到下方後........我卡住了
    #ifdef CONFIG_FS_FAT
    {
    .fstype = FS_TYPE_FAT,
    .name = "fat",
    .null_dev_desc_ok = false,
    .probe = fat_set_blk_dev,
    .close = fat_close,
    .ls = file_fat_ls,
    .exists = fat_exists,
    .size = fat_size,
    .read = fat_read_file, <-----不知道系統怎麼把參數丟進去
    ........ }

    thanks
  • 抱歉现在给您回复。

    你可以试一下以下指令吗?

    => setenv bootfile

    => saveenv

    => reset

    => printenv bootfile

    If an uEnv.txt file gets loaded and the bootfile is defined as zImage there, but when you type saveenv the environment is saved as uboot.env, in this case you can observe this kind of behavior, or if you have if setenv bootfile zImage condition defined somewhere within your U-Boot environments can also lead to this kind of result.

  • 抱歉现在给您回复。

    ==> 沒關係,我也是剛好遇到這問題,跟你們討論和學習一下

    你可以试一下以下指令吗?

    => setenv bootfile

    => saveenv

    => reset

    => printenv bootfile

    => 後來我們在重新開機時,在uboot讀取usb會載入舊的image前,先做saveenv,就可避免載入的狀況

          由於時間緊迫,故暫時先用此法解zImage的問題。