2402827_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2402827_en-US

2402827_en-US

IMX8MP linux uboot need to be set up with the default environment + extra variables

IMX8MP linux uboot need to set up the default environmnet + few more variables after the flashing the bootloader via uuu.


Use case:

The IMX8MP SoM comes with default uboot from vendor. So for the first time writing need to flash the new uboot image, we set it to the default environment and set few more board specific environment variables on the factory process.

So when I'm using the command, uuu -b emmc_all bl-imx8mp.bin image.wic.zst its using the builtin script

uuu_version 1.4.149

# @_flash.bin | bootloader, which can extract from wic image
# @_image [_flash.bin] | wic image burn to emmc.


# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f bl-imx8mp.bin -scanlimited 0x800000

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -scanterm -f bl-imx8mp.bin -scanlimited 0x800000

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f bl-imx8mp.bin -offset 0x57c00
SDPU: jump -scanlimited 0x800000
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f bl-raptor-imx8mp.bin -skipspl -scanterm -scanlimited 0x800000
SDPV: jump -scanlimited 0x800000
# }


FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all image.wic.zst/*
FB: flash -scanterm -scanlimited 0x800000 bootloader bl-imx8mp.bin
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: done


So my requirement is
Flash the bootloader + rootfs / image
Reset to defaults.
Add new variables.
Reboot with proper working new bootloader with expected env.

But now its first flashing the rootfs and then the new bootloader. So when I executed env default -f -a, after it, it causes the default of environment of old bootloader in the SoM board. When it resetted, it starts then with new bootloader but with old defaults from old bootloader. Is there any suggestion to solve this issue?


Re: IMX8MP linux uboot need to be set up with the default environment + extra variables

Hello @jake4 

Hope you are doing very well.


You can try making your own custom script and add the below:

FB: ucmd env default -f -a

Example of complete script:

uuu_version 1.4.149

SDP: boot -f bl-imx8mp.bin -scanlimited 0x800000
SDPS: boot -scanterm -f bl-imx8mp.bin -scanlimited 0x800000
SDPU: delay 1000
SDPU: write -f bl-imx8mp.bin -offset 0x57c00
SDPU: jump -scanlimited 0x800000
SDPV: delay 1000
SDPV: write -f bl-imx8mp.bin -skipspl -scanterm -scanlimited 0x800000
SDPV: jump -scanlimited 0x800000

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}

FB: flash -raw2sparse all image.wic.zst/*
FB: flash -scanterm -scanlimited 0x800000 bootloader bl-imx8mp.bin
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0

FB: ucmd env default -f -a

FB: ucmd setenv board_version "1.0"
FB: ucmd setenv my_custom_var "value"

FB: ucmd saveenv

FB: ucmd reset
FB: done

Best regards,

Salas.

Tags (1)
No ratings
Version history
Last update:
yesterday
Updated by: