Can I access to uboot variables from Linux?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can I access to uboot variables from Linux?

跳至解决方案
3,785 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
2,645 次查看
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 项奖励
回复
5 回复数
2,646 次查看
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 项奖励
回复
2,645 次查看
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 项奖励
回复
2,645 次查看
manoloruiz
Contributor III

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

Best regards,

Manolo.

0 项奖励
回复
2,645 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Yes, it is valid for SDK 1.9 and 1.8.

Thanks,

Yiping

0 项奖励
回复
2,645 次查看
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