gpt4 book ai didi

c - 使用 fw_setenv 设置 U-boot 的 env (U-boot)

转载 作者:行者123 更新时间:2023-11-30 18:07:04 24 4
gpt4 key购买 nike

我使用了源代码(版本:u-boot 1.2)

想要跨编译器 fw_setenv 。

所以。我进入uboot/uboot-1.2-dm9000/tools/env

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

但是..这不行。

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

非常感谢。

最佳答案

看起来你的 strlen() 实现在你的跨平台上是错误的。这里

[ strlen("SN") + 2 + strlen("envotouch194") + 1 ] - strlen("SN") = -114688。应该是计算字符串长度时出现问题。

关于c - 使用 fw_setenv 设置 U-boot 的 env (U-boot),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5025907/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com