UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Accepted Solution Solved
Explorer
Posts: 114
Registered: ‎07-17-2014
Accepted Solution

How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Hey all,

 

 I hope this is an easy question.

I'd like to include the print/set ENV tool found in:

 

<project>/build/linux/u-boot/src/u-boot-plnx/tools/env/

It's there. It just doesn't compile. how can I include it to get built and then included into the rootfs.

I didn't see anything in petalinux-config or -c rootfs that includes it.

little help?

thanks,

 -Ben


Accepted Solutions
Xilinx Employee
Posts: 66
Registered: ‎01-21-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry

View solution in original post


All Replies
Moderator
Posts: 5,501
Registered: ‎08-01-2008

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

check this third party link it may help you
https://wiki.openwrt.org/doc/techref/bootloader/uboot.config
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
Highlighted
Explorer
Posts: 114
Registered: ‎07-17-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Hi there,


 Thanks -- but unfortunately, that link doesn't help me at all. I already know how to do all of what it says, PROVIDED the make scripts of PETALINUX were to somehow enable building fw_printenv and then including it into the PETALINUX rootfs when building a petalinux project.

SOMEwhere in a config or Makefile that PETALINUX controls/generates is the magic pixie dust I need to turn this on so that the right parms/commands are passed off to the build scripts for u-boot-plnx that at least compiles the env directory in tools.

Any thoughts there? (anyone?)

Thanks,

 -Ben

Xilinx Employee
Posts: 66
Registered: ‎01-21-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry

Explorer
Posts: 114
Registered: ‎07-17-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs


terryo wrote:

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry


Hi Terry!

That's what I needed! - I knew it was something simple.

I already have an "app" in my project where I can include startup scripts and other miscellaneous monkey business. So once the executable was available, I just copied it to that folder and edited my Makefile as needed.

Works like a charm (yes, I got /etc/fw_env.config all edited and included as well)

I did try a project and start including the source files. However, all the includes needed made it a hassle. I just needed a one time compile output.

Thanks again!

Adventurer
Posts: 96
Registered: ‎09-27-2011

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Hello @bkamen.  Were you able to get fw_setenv working along with fw_printenv?  I have fw_printenv working, but if I try fw_setenv, it doesn't seem to know how to erase the partition before writing to it again and it causes the saved vars to go corrupt.  I am assuming it probably has to do with getting the correct compatibility setting in the device tree so that the correct driver loads.  Was wondering what your compatibility settings were and perhaps also what your fw_env.config file contains.

Thanks,

Joshua