can't make bootcmd save

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

can't make bootcmd save

1,202 Views
richc128
Contributor III

I can't seem to overwrite the bootcmd variable in u-boot and have it stay the save after rebooting. I can set it fine, see it's changed with printenv, and saveenv goes ok. But, when I reset it goes back to this

bootcmd=ext2load mmc 1:1 ${loadaddr} boot.scr; source; boota mmc0 boot_a;

I guess the first question, is there a way to override this variable and have it stick?

I also tried modifying u-boot code to remove that line (i'm on an imx8mq) but that didn't seem to do anything.

Is there something that feeds this variable prior to u-boot? I'm not that familiar with these parts yet. Is there a first stage bootloader that is handing this environment variable to u-boot?

Labels (1)
Tags (2)
0 Kudos
3 Replies

1,104 Views
turker
Contributor IV

Are you compiling U-Boot yourself or using yocto for the job? If you are using yocto then the changes you make may get lost during consecutive builds.

For the bootcmd variable, if I remember correctly it takes the value of CONFIG_BOOTCOMMAND on startup. So check that definition for your board. Other than that you could try to find out if bootcmd variable is overridden in some other place. You can search the source code for an expression like env_set("bootcmd", ... in order to do that.

You should also tell us which version of U-Boot you are using and which board you are working on.

0 Kudos

1,104 Views
richc128
Contributor III

it's for the google coral board. Basically it looks if it's an sd boot and then overrides the bootcmd env variable

board/freescale/imx8mq_phanbell/imx8m_phanbell.c - uboot-imx - Git at Google 

i'm not sure of the best fix but just commenting out the lines is my fix.

0 Kudos

1,104 Views
igorpadykov
NXP Employee
NXP Employee

Hi richardcagley

one can look how uboot stores variables

linux - How u-boot bootloader reads/saves its environment Variables? - Stack Overflow 

for example  define  "CONFIG_ENV_IS_IN_MMC"

imx8mm_evk.h\configs\include - uboot-imx - i.MX U-Boot 

Best regards
igor

0 Kudos