How do I get fw_printenv and fw_setenv included in my rootfs?

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

How do I get fw_printenv and fw_setenv included in my rootfs?

Jump to solution
17,050 Views
caryo_brien
Contributor III

I am using QorIQ-SDK-1.6 to build code for a P1022 system.

We have a custom machine defined, since our board is different

enough from the eval boards.

We have a working u-boot, kernel, and jffs2 rootfs.

Our application needs to modify u-boot environment variables during

runtime, so we need the fw_printenv and fw_setenv from the uboot

tools/env directory.

There are recipes that are supposed to do this:

meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb

meta/recipes-bsp/u-boot/u-boot-fw-utils-cross_2013.07.bb

Even if I tell these (in a .bbappend) to use an existing

machine (Board) definition (i.e P1022DS) they don't

complete because (I believe) the u-boot version

is older than the used u-boot version (2014.01+fslgit).  It can't

find the compiler.

I modified our u-boot_git.bbappend to COMPILE the utilities,

and the resulting binaries when copied to the rootfs work

correctly, but I cannot figure out how to get these installed

automatically.  More specifically, I have do_fw_compile and

do_fw_install tasks, but the code doesn't end up in the

u-boot RPMS. Except for the image rpm they are empty.

Is there a recipe that will work 'out of the box' with this

version of u-boot?  Is there somewhere I can look for an

example of the tasks I would need to implement to do this?

I can always work around and pull them out of the

build tree 'by hand' but I'd like to do it the right way.

Thanks in Advance,

Cary O'Brien

Labels (1)
1 Solution
8,453 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Cary,

Please try to use the following method to build fw_printenv and fw_setenv into filesystem.

1. Please run "bitbake u-boot-fw-utils -c cleanstate" to clean your current build.

2. Please put the attached recipe in the folder meta/recipes-bsp/u-boot/.

3. Please define UBOOT_MACHINE = "P1022DS_config" in meta-fsl-ppc/conf/machine/p1022ds.conf.

4. Please add "u-boot-fw-utils" into variable IMAGE_INSTALL in meta-fsl-networking/images/fsl-image-core.bb


5. Run "bitbake fsl-image-core" to build u-boot-fw-utils into filesystem.


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
6 Replies
8,453 Views
ryanpabis
Contributor II

NOTE:  If I copy imx8mq_evk_defconfig from my u-boot-imx/git/configs directory to my u-boot-fw-utils/git/configs directory it does compile.  However, u-boot-imx is 2017.03 and u-boot-fw-utils is 2016.03, will that be a problem?

0 Kudos
8,452 Views
ryanpabis
Contributor II

Here is the error I get if I just add 'CORE_IMAGE_EXTRA_INSTALL += "u-boot-fw-utils"'  and don't specify the PREFERRED_VERSION.  I assume its because the u-boot-imx and u-boot-fw-utils don't match.

ERROR: u-boot-fw-utils-v2016.03+gitAUTOINC+df61a74e68-r0 do_compile: oe_runmake failed
ERROR: u-boot-fw-utils-v2016.03+gitAUTOINC+df61a74e68-r0 do_compile: Function failed: do_compile (log file is located at /home/pabisr/imx8mq-ga-bsp/build/tmp/work/imx8mqevk-poky-linux/u-boot-fw-utils/v2016.03+gitAUTOINC+df61a74e68-r0/temp/log.do_compile.14134)
ERROR: Logfile of failure stored in: /home/pabisr/imx8mq-ga-bsp/build/tmp/work/imx8mqevk-poky-linux/u-boot-fw-utils/v2016.03+gitAUTOINC+df61a74e68-r0/temp/log.do_compile.14134
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 CROSS_COMPILE=aarch64-poky-linux- CC=aarch64-poky-linux-gcc --sysroot=/home/pabisr/imx8mq-ga-bsp/build/tmp/sysroots/imx8mqevk -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/pabisr/imx8mq-ga-bsp/build/tmp/work/imx8mqevk-poky-linux/u-boot-fw-utils/v2016.03+gitAUTOINC+df61a74e68-r0=/usr/src/debug/u-boot-fw-utils/v2016.03+gitAUTOINC+df61a74e68-r0 -fdebug-prefix-map=/home/pabisr/imx8mq-ga-bsp/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/pabisr/imx8mq-ga-bsp/build/tmp/sysroots/imx8mqevk= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed V=1 imx8mq_evk_config
| ERROR: oe_runmake failed
| make -f ./scripts/Makefile.build obj=scripts/basic
| rm -f .tmp_quiet_recordmcount
| make -f ./scripts/Makefile.build obj=scripts/kconfig imx8mq_evk_config
| scripts/kconfig/conf --defconfig=arch/../configs/imx8mq_evk_defconfig Kconfig
| ***
| *** Can't find default configuration "arch/../configs/imx8mq_evk_defconfig"!
| ***
| scripts/kconfig/Makefile:114: recipe for target 'imx8mq_evk_defconfig' failed
| make[1]: *** [imx8mq_evk_defconfig] Error 1
| Makefile:477: recipe for target 'imx8mq_evk_config' failed
| make: *** [imx8mq_evk_config] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/pabisr/imx8mq-ga-bsp/build/tmp/work/imx8mqevk-poky-linux/u-boot-fw-utils/v2016.03+gitAUTOINC+df61a74e68-r0/temp/log.do_compile.14134)
ERROR: Task (/home/pabisr/imx8mq-ga-bsp/sources/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3382 tasks of which 3381 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/pabisr/imx8mq-ga-bsp/sources/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

0 Kudos
8,453 Views
ryanpabis
Contributor II

I am having a similar problem on the imx8mqevk board.  I was able to get u-boot-fw-utils working on imx6ul evk however that code was based on NXP bsp layers I believe.  All I had to do was add 'CORE_IMAGE_EXTRA_INSTALL += "u-boot-fw-utils"' to my layer.com file.

imx8mq seems to rely on community layers for the bsp and I, therefore, get multiple versions of u-boot in the layers (meta-freescale, meta-fsl-bsp-release,poky, and meta-freescale-3rdparty).  And it appears that the u-boot version that's built is 2017.03 which is found in meta-fsl-bsp-release.  However, when I go to build u-boot-fw-utils by including it as an extra install in my conf/layers.conf file it always tries to build 2016.03+gitAUTOINC+df61a74e68.  Even if I use add 'PREFERRED_VERSION_u-boot-fw-utils = "2017.03"' to my layer.conf file it complains it can't find that version and continues to build with 2016.03+gitAUTOINC+df61a74e68 version.

I have even tried adding the recipes-bsp/u-boot directory to my layer and adding the 2017.03 .bb files for u-boot and u-boot-fw-utils but it doesn't even try to build with that version.

Can you please advise?

0 Kudos
8,454 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Cary,

Please try to use the following method to build fw_printenv and fw_setenv into filesystem.

1. Please run "bitbake u-boot-fw-utils -c cleanstate" to clean your current build.

2. Please put the attached recipe in the folder meta/recipes-bsp/u-boot/.

3. Please define UBOOT_MACHINE = "P1022DS_config" in meta-fsl-ppc/conf/machine/p1022ds.conf.

4. Please add "u-boot-fw-utils" into variable IMAGE_INSTALL in meta-fsl-networking/images/fsl-image-core.bb


5. Run "bitbake fsl-image-core" to build u-boot-fw-utils into filesystem.


Have a great day,
Yiping

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

0 Kudos
8,453 Views
yuqianli
Contributor I

Hi Yiping,

I am trying to add fw_printenv to my LS1021aiot as well, I found there is a  

./sources/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2015.07.bb file, but when I try to bitbake it, it always shows to me:

liyq@develop1:~/IoT-gateway-platform-Release-V0.1-20170120-yocto/build_ls1021aiot$ bitbake u-boot-fw-utils

Loading cache: 100% |######################################################################################################| ETA:  00:00:00

Loaded 3526 entries from dependency cache.

ERROR: Nothing PROVIDES 'u-boot-fw-utils'

ERROR: u-boot-fw-utils was skipped: Only config,images can be specified!

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

 

What is this means, Is there a way to add it in LS1021aiot SDK, I'm use the 

IoT-gateway-platform-Release-V0.1-20170120-yocto SDK

Thank you very much.

Yuqian

0 Kudos
8,452 Views
ajithpv
Contributor V

Hi Yiping Wang,

Could you please tell me, what and all changes will be needed for getting the "fw_printenv and fw_setenv" in i.MX6Q SABRE SD Platform for doing the same activity?

I have tried the given steps but got stuck with 3rd and 4th step since I don't know what exact location and details has to be given for SABRE SD platform.

Looking forward to your reply...

Thank you in advance,

Ajith P V

0 Kudos