[U-Boot] mkenvimage not working for me.

David Wagner david.wagner at free-electrons.com
Tue Sep 27 13:56:22 CEST 2011


Hi,
(CCing u-boot mailing list and Mike Frysinger)

stdlib.h is indeed missing.
EXIT_FAILURE and EXIT_SUCCESS are defined within stdlib.h, so that
explains it.

How old are you u-boot sources ? compiler.h has been introduced by:
commit 37566090766d61beef70c62986b90749920255d8
Author: Mike Frysinger <vapier at gentoo.org>
Date:   Thu Jul 2 19:23:25 2009 -0400

If your U-Boot is older than that, could you please test again with the
latest possible version ? Btw, cpu_to_be32 is defined within compiler.h

Thanks for testing and reporting.
Regards,
David.

On 09/27/2011 12:03 PM, Nick Thomas wrote:
> Hi,
> 
> I am trying to use the mkenvimage utilty to create a environment image file
> ready for flashing.
> 
> I have a few problems - the main one being that it looks like the CRC is
> incorrect for my system.
> 
> Also, there are compiler errors too:
> 1) The code uses malloc without #include <stdlib.h>
> 2) EXIT_FAILURE and EXIT_SUCCESS aren't defined.
> 3) I can't find a <compiler.h> file, so I just commented it out.
> 4) cpu_to_be32 can't be found. I thought these were kernel space funcs
> anyway.
> I have replaced cpu_to_be32 with htobe32 - which I think is in the libz
> library.
> 
> Anyway, after making those changes I get mkenvimage to compile, and it
> creates a environment image file.
> But, after flashing in to my STLinux unit the U-Boot complains that the
> environment has an invalid CRC ?!
> 
> Also, I notice that the output of uboot printenv has some long lines
> truncated - so it can't reliably used as direct input into this utility.
> 
> 
> Regards
> 
> Nick Thomas
> 


-- 
David Wagner, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


More information about the U-Boot mailing list