Re: [U-Boot] mkenvimage not working for me.

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@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:
- The code uses malloc without #include <stdlib.h>
- EXIT_FAILURE and EXIT_SUCCESS aren't defined.
- I can't find a <compiler.h> file, so I just commented it out.
- 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

Hi David,
Thanks for your prompt reply.
The U-Boot I am using comes from the ST Microelectronics. Their STLinux distribution for embedded devices. UBoot appears to be at version 1.3.1 - but I'm not sure if that is an ST version number or not.
I suspect that the problems I am having are probably best directed towards ST themselves.
I suspect that the CRC calculation, for the 4 bytes of CRC at the head of the environment, might be ST specific.
I will investigate further.
Thanks,
Nick Thomas
On 27 September 2011 12:56, David Wagner david.wagner@free-electrons.comwrote:
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@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:
- The code uses malloc without #include <stdlib.h>
- EXIT_FAILURE and EXIT_SUCCESS aren't defined.
- I can't find a <compiler.h> file, so I just commented it out.
- 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

On Tuesday, September 27, 2011 09:02:50 Nick Thomas wrote:
Hi David,
please don't top post
The U-Boot I am using comes from the ST Microelectronics. Their STLinux distribution for embedded devices. UBoot appears to be at version 1.3.1 - but I'm not sure if that is an ST version number or not.
I suspect that the problems I am having are probably best directed towards ST themselves.
if you aren't using the master branch of the public u-boot git tree, then your troubles should be directed to whoever is giving you the source tree you're using -mike
participants (3)
-
David Wagner
-
Mike Frysinger
-
Nick Thomas