【问题标题】:The begining and end adress of the Flash memoryFlash存储器的起始地址和结束地址
【发布时间】:2017-11-01 12:47:22
【问题描述】:

我正在尝试在 Arduino Yun 板上运行 linux。 Arduino 板包含一个Atheros AR9331 chipset

在 U-Boot 这些是我正在做的步骤:

1- 下载内核:

ar7240> tftp 0x80060000 openwrt-ar71xx-generic-uImage-lzma.bin;
Load address: 0x80060000
Loading: #################################################################
     #################################################################
     #################################################################
     #################################################################
     ######################
done
Bytes transferred = 1441863 (160047 hex)

2- 擦除 Flash 以复制内核:

ar7240> erase 0x9fEa0000 +0x160047 
Error: end address (0xa0000046) not in flash!
Bad address format

这就是问题0x9fEa0000 +0x160047似乎超过了flash的总大小。

所以我的问题是:

1- 我如何计算为 Uboot 中的闪存保留的内存总量(从它开始和结束的地址),我正在考虑将 0x9fEa0000 更改为更少的地址,但我担心我会伤害其他的东西

这是帮助的输出:

ar7240> help
?       - alias for 'help'
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
cp      - memory copy
erase   - erase FLASH memory
help    - print online help
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
progmac - Set ethernet MAC addresses
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
setenv  - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version

2- 有没有使用Atheros AR9331 chipset 经验的人可以帮助我从数据表中找到 Flash 映射(从哪里开始和结束)

【问题讨论】:

  • 显然,flash 映射到 0x9f000000,它是 16 MB。闪存布局要么在 U-Boot 中硬编码,要么在 U-boot 脚本或参数区域中指定,也在闪存上。在内核映像之前,可能有根文件系统。 printenv 有输出吗?

标签: linux boot openwrt u-boot flash-memory


【解决方案1】:

您可以从内核引导命令行确定闪存布局。在 u-boot 中运行 printenv 命令或引导到现有内核并查看引导日志。您需要找到类似以下内容:

(网上有很多指南,我是从https://finninday.net/wiki/index.php/Arduino_yun 拿来的,你的板可能不一样)。

linino> printenv
bootargs=console=ttyATH0,115200 board=linino-yun mem=64M rootfstype=squashfs,jffs2 noinitrd mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art),15936k@0x50000(firmware)
bootcmd=bootm 0x9fea0000

这意味着有以下分区:

u-boot 0 to 256K (0x0 - 0x40000)
u-boot-env 256k to 320k (0x40000 - 0x50000)
rootfs (squashfs) 320k to 14976k (0x50000 - 0xea0000)
kernel 14976k to 16256k (0xea0000 - 0xfe0000)
nvram 16256k to 16320k (0xfe0000 - 0xff0000)
art 16320k to 16384k (0xff0000 - 0x1000000)

rootfs 分区为 14M,比 rootfs 映像文件(小于 8MB)大得多,因此理论上您可以将内核映像移动到较低的地址。为此,您需要修改 u-boot 环境块中的内核引导行(rootfskernel 分区大小)和 bootcmd 参数,以便 u-boot 知道新内核的位置。

Flash 映射到0x9f000000,所以bootcmd 中的值应该是0x9f000000 + 内核的偏移量(以字节为单位)。

我不确定是否有覆盖文件系统用于对闪存的任何持久更改。你能引导到现有系统并发布df -hcat /proc/mounts的输出吗?

【讨论】:

猜你喜欢
  • 2018-06-08
  • 2015-09-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-09
相关资源
最近更新 更多