Can I access to uboot variables from Linux?

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

Can I access to uboot variables from Linux?

Jump to solution
2,623 Views
manoloruiz
Contributor III

Hi,

I would like to modify uboot variables from Linux. Is this possible? I have seen that it is possible to compile the kernel with some options in order to be able to access to them, but I cannot seen this option.

Target filesystem options  --->     [*] Das U-Boot Boot Monitor  --->         [*]   fw_printenv tool in target

Best regards

Labels (1)
0 Kudos
1 Solution
1,483 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello manolo ruiz ,

I assume you use SDK 2.0, please refer to the following procedure.

 Please add "u-boot-fw-utils" into variable IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb.

And run "bitbake fsl-image-core" to rebuild this tool into filesystem.

On the target board, please create a configuration file /etc/fw_env.config, the content like this

/dev/mtd5 0x60000 0x2000 0x100000

MTD device name
Device Offset
Environment Size
Flash sector size

Then execute "fw_printenv" and "fw_setenv" to read and write u-boot environment.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
1,484 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello manolo ruiz ,

I assume you use SDK 2.0, please refer to the following procedure.

 Please add "u-boot-fw-utils" into variable IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb.

And run "bitbake fsl-image-core" to rebuild this tool into filesystem.

On the target board, please create a configuration file /etc/fw_env.config, the content like this

/dev/mtd5 0x60000 0x2000 0x100000

MTD device name
Device Offset
Environment Size
Flash sector size

Then execute "fw_printenv" and "fw_setenv" to read and write u-boot environment.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,483 Views
gregjohnson
Contributor II

I performed these steps using the QorIQ SDK v2.0 and received the following errors:

$ bitbake fsl-image-core
Loading cache: 100% |########################################################################################################################################| ETA: 00:00:00
Loaded 3437 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################| Time: 00:00:00
Parsing of 2733 .bb files complete (2729 cached, 4 parsed). 3438 targets, 248 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'u-boot-fw-utils' (but /LS1020A/QorIQ-SDK-V2.0-20160527-yocto/sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb RDEPENDS on or otherwise requires it)
ERROR: u-boot-fw-utils was skipped: Only config,images can be specified!
NOTE: Runtime target 'u-boot-fw-utils' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['u-boot-fw-utils']
ERROR: Required build target 'fsl-image-core' has no buildable providers.
Missing or unbuildable dependency chain was: ['fsl-image-core', 'u-boot-fw-utils']

Does anyone know how to fix this?

0 Kudos
1,483 Views
manoloruiz
Contributor III

Thanks for your answer. Is the answer also valid for SDK 1.9 and 1.8?

Best regards,

Manolo.

0 Kudos
1,483 Views
yipingwang
NXP TechSupport
NXP TechSupport

Yes, it is valid for SDK 1.9 and 1.8.

Thanks,

Yiping

0 Kudos
1,483 Views
mike_susen
NXP Employee
NXP Employee

Hi Manolo,

Yes you can access u-boot variables over Memory technology Device Layer (MTD). For detailed information you can see here HowCanIAccessUBootEnvironmentVariablesInLinux < DULG < DENX 

Michal