Change u-Boot variable from user-space

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

Change u-Boot variable from user-space

Jump to solution
1,707 Views
khang_letruong
Senior Contributor III

Dear Community,

I would like to know if there's simple wait to change the fdtfile variable from user-space, please ? My user-case is that I would like to switch the dtb for the selected camera sensor without entering u-Boot's prompt.

I saw the method of using fw_printenv/fw_setenv and it seems that one needs to append the u-boot-fw-utils into image's rootfs :

 

IMAGE_INSTALL_append  += " u-boot-fw-utils"

 

Is that the correct and enough way?

Thanks in advance and best regards,

Khang

0 Kudos
Reply
1 Solution
1,680 Views
khang_letruong
Senior Contributor III

Hi @chinnnu ,

Thanks for your answers. In fact, I am able to change u-Boot's variable from Linux user-space with the adding of  u-boot-fw-utils to make appear fw_printenv/fw_setenv in the rootfs as in my initial post.

Regards,
K.

View solution in original post

0 Kudos
Reply
3 Replies
1,681 Views
khang_letruong
Senior Contributor III

Hi @chinnnu ,

Thanks for your answers. In fact, I am able to change u-Boot's variable from Linux user-space with the adding of  u-boot-fw-utils to make appear fw_printenv/fw_setenv in the rootfs as in my initial post.

Regards,
K.

0 Kudos
Reply
1,685 Views
chinnnu
Contributor I

Hello.... In order to modify the uboot environment variables from user space we will need a program called fw_setenv, we can compile this program ourselves from the u-boot sources, follow the instructions in this wiki page and then proceed to compile with (don't modify the .h file as it says in the tools/env/README file): regards mrtv technical team.

make env 
cp fw_printenv fw_setenv

The next thing we will need is the fw_env.config file with the appropiate settings for our board. Here comes the confusion In this file you have to specify: MTD device name Device Offset Environment Size Flash sector size Number of sectors (ignored in NOR)

0 Kudos
Reply
1,685 Views
chinnnu
Contributor I

Hello.... In order to modify the uboot environment variables from user space we will need a program called fw_setenv, we can compile this program ourselves from the u-boot sources, follow the instructions in this wiki page and then proceed to compile with (don't modify the .h file as it says in the tools/env/README file):

0 Kudos
Reply