use fw_setenv for set U-boot's env (U-boot)

1.7k views Asked by At

I used the source code (version:u-boot 1.2)

want to corss compiler fw_setenv .

so. I enter to uboot/uboot-1.2-dm9000/tools/env

and

arm-linux-gcc -Wall -DUSE_HOSTCC -I/include crc32.c fw_env.c fw_env_main.c -o fw_setenv

but..It's not work.

$ fw_setenv SN envotouch194
Unlocking flash...
Done
Cannot malloc -114688 bytes: Cannot allocate memory
Error: can't write fw_env to flash

thanks a lot.

1

There are 1 answers

0
Ashok Vairavan On

Looks like your strlen() implementation is wrong in your cross platform. Here

[ strlen("SN") + 2 + strlen("envotouch194") + 1 ] - strlen("SN") = -114688. Should be some issue in calculating the length of the string.