您的位置:首页 > 其它

利用 uflash 工具制作 TI davinci DM368 SD 启动卡

2012-05-02 19:08 239 查看
实验环境:

DM368 平台 : LW3xx

SD card : SanDisk micro SD 512MB

HOST : ubuntu 10.04.4 64-bit

CROSS_COMPILE : CodeSourcery GNU Toolchain for ARM Processors:
2009q1-203 version

1,设置 ARM 交叉编译工具的路径

#export PATH=$PATH:$CROSS_COMPILE_PATH
2,下载最新的
u-boot for davinci

3,解压缩 u-boot-davinci

#tar zxvf u-boot-davinci.tar.gz
4,编译 u-boot-davinci

#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- distclean
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- davinci_dm365evm_config
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

5,编译成功后,在目录 u-boot-davinci/tools/uflash 下会生成 uflash 可执行文件

6,编译适用于 LW3xx 平台的 SD 启动用的 UBL 二进制文件,并拷贝到目录 u-boot-davinci/tools/uflash

编译 LW3xx UBL 请参考《TI davinci DM368 UBL 编译方法》

7,参阅文档 u-boot-davinci/tools/uflash/README

8,格式化 SD 卡

#fdisk /dev/mmcblk0
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): d
Partition number (1-4): 1
Command (m for help): n
Command action

e extended

p primary partition (1-4)

p
Partition number (1-4): 1
First cylinder (1-15484, default 1): 20
Last cylinder, +cylinders or +size{K,M,G} (20-1280, default 1280):

Using default value 1280

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.

再重新插拔 SD 卡

9,制作 SD 卡文件系统

#mkfs.ext3 /dev/mmcblk0p1
mke2fs 1.41.11 (14-Mar-2010)

/dev/mmcblk0p1 is mounted; will not make a filesystem here!

如遇到上面的错误提示,请执行 umount 命令卸载 SD 卡,然后在重新执行 mkfs.ext3 命令

#umount /media/f3565e35-6a85-4627-b050-0e623708fae5
#mkfs.ext3 /dev/mmcblk0p1
mke2fs 1.41.11 (14-Mar-2010)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

10120 inodes, 40352 blocks

2017 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=41418752

5 block groups

8192 blocks per group, 8192 fragments per group

2024 inodes per group

Superblock backups stored on blocks:

8193, 24577

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

10,修改 config.txt 文件,该文件保存了 u-boot 默认的环境变量

11,运行 uflash

./uflash -d /dev/mmcblk0 -p DM3XX -u ubl_DM36x_ARM432_DDR340_OSC24_SDMMC.bin -b ../../u-boot.bin -vv


输出信息如下:

DM3XX
UBL Size 8211
U-Boot Size 317559
First partition starts at 1216(622592)
Required Blocks 764, Available Blocks 1215
UBL Magic Number        : a1aced00
UBL Entry Point         : 00000100
UBL Number of Blocks    : 00000010
UBL Starting Block      : 00000075
UBL Load Address        : 00000000
Writing UBL Signature
Writing UBL
U-Boot Magic Number        : a1aced66
U-Boot Entry Point         : 81080000
U-Boot Number of Blocks    : 0000026d
U-Boot Starting Block      : 0000008f
Load U-Boot Address        : 81080000
Writing U-Boot Signature
Writing U-Boot
Done...
12,设置 LW3xx 平台从 SD 卡启动,插入 uflash 制作的 SD 卡,然后上电即可

如想在 u-boot 官方网站下载的 u-boot-2012.04 中增加 uflash 的功能,步骤如下:

1,下载 u-boot-2012.04

2,解压 u-boot-2012.04

3,将 u-boot-davinci/tools/uflash 拷贝到 u-boot-2012.04/tools/

4,手动删除 u-boot-2012.04/tools/uflash/uflash

5,修改 u-boot-2012.04/tools/Makefile 第 24 行

TOOLSUBDIRS = uflash


6,参照上面 4 - 12 的步骤
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: