打印
[嵌入式linux]

管理菜单 结贴回复 求助!!2016.09.01版u-boot环境变量设置问题

[复制链接]
623|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
InFoport|  楼主 | 2018-7-16 13:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我用的是韦东山的JZ2440开发板,在移植u-boot时我想把环境变量放到nand flash里面,可在include/configs/xxx.h里,添加
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET               0x00080000
#define CONFIG_ENV_SIZE                 0x20000
#define CONFIG_ENV_RANGE                CONFIG_ENV_SIZE
#define CONFIG_ENV_OVERWRITE


结果就卡死在这里

U-Boot 2016.09.01 (Jul 14 2018 - 07:07:45 -0700)

CPUID: 32440001
FCLK:      400 MHz
HCLK:      100 MHz
PCLK:       50 MHz
DRAM:  64 MiB
WARNING: Caches not enabled
Flash: 2 MiB
NAND:  256 MiB



如果把CONFIG_ENV_IS_IN_NAND换成
#define CONFIG_ENV_IS_IN_FLASH会报错
common/built-in.o:(.data.env_ptr+0x0): undefined reference to `environment'

只有加上
#define CONFIG_ENV_ADDR         (CONFIG_SYS_FLASH_BASE + 0x070000)
才能编译通过
并且不会卡住各项功能都能实现,只是不能save环境变量
U-Boot 2016.09.01 (Jul 15 2018 - 21:08:43 -0700)

CPUID: 32440001
FCLK:      400 MHz
HCLK:      100 MHz
PCLK:       50 MHz
DRAM:  64 MiB
WARNING: Caches not enabled
Flash: 2 MiB
NAND:  256 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dm9000
Hit any key to stop autoboot:  0
JZ2440 #
JZ2440 #
JZ2440 #
JZ2440 # help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
.....................
.....................
.....................

JZ2440 # print
baudrate=115200
bootargs=console=ttySAC0 root=/dev/mtdblock3
bootcmd=nand read 30000000 kernel 0x200000;bootm 30000000
bootdelay=5
ethact=dm9000
ethaddr=00:0c:29:4b:e4:f4
ipaddr=192.168.2.5
netmask=255.255.255.0
serverip=192.168.2.1
stderr=serial
stdin=serial
stdout=serial

Environment size: 299/131068 bytes
JZ2440 #


那位大佬帮我看看是哪里的问题,不胜感激。

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝