TI的AM3359的sd卡分区以及sd卡启动说明

时间:2022-08-08 10:31:07

【1】sd 卡分区: ti提供了自己的分区shell脚本create-sdcard.sh  脚本目录在:ti-sdk-am335x-evm-05.06.00.00/bin/

(1)插入sd卡(若是笔记本sd卡槽,不显示sd卡,可能是因为sd卡走的是PCI总线而不是usb,这时需要一个读卡器)

(2)执行sudo ./create-sdcard.sh

(3)弹出以下信息。按如下标示进行分区即可(红色为自己填写信息),此处分区分了两个,一个boot,一个rootfs ################################################################################

This script will create a bootable SD card from custom or pre-built binaries.

The script must be run with root permissions and from the bin directory of the SDK

Example:  $ sudo ./create-sdcard.sh

Formatting can be skipped if the SD card is already formatted and partitioned properly.

################################################################################

Availible Drives to write images to:

#  major   minor    size   name 1:   8       16    3813376 sdb

Enter Device Number: 1(此处填写分区设备描述符)

sdb was selected

Checking the device is unmounted

sdb1  sdb2   sdb3 72261 3727080

################################################################################

Detected device has 2 partitions already

Re-partitioning will allow the choice of 2 or 3 partitions

################################################################################

Would you like to re-partition the drive anyways [y/n] : y

Now partitioning sdb ...

################################################################################

Select 2 partitions if only need boot and rootfs (most users)  Select 3 partitions if need SDK & CCS on SD card.  This is usually used         by device manufacturers with access to partition tarballs.

****WARNING**** continuing will erase all data on sdb

################################################################################

Number of partitions needed [2/3] : 2(分区数量)

Now partitioning sdb with 2 partitions...

################################################################################

Now making 2 partitions

################################################################################

记录了1024+0 的读入 记录了1024+0 的写出 1048576字节(1.0 MB)已复制,13.1196 秒,79.9 kB/秒 Disk /dev/sdb doesn't contain a valid partition table DISK SIZE - 3904897024 bytes Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 474 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature  /dev/sdb: unrecognized partition table type Old situation: No partitions found New situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start     End   #cyls    #blocks   Id  System /dev/sdb1   *      0+      8       9-     72261    c  W95 FAT32 (LBA) /dev/sdb2         10     473     464    3727080   83  Linux /dev/sdb3          0       -       0          0    0  Empty /dev/sdb4          0       -       0          0    0  Empty Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).)

################################################################################

Partitioning Boot

################################################################################ mkfs.vfat 3.0.7 (24 Dec 2009)

################################################################################

Partitioning rootfs

################################################################################ mke2fs 1.41.11 (14-Mar-2010) 文件系统标签=rootfs 操作系统:Linux 块大小=4096 (log=2) 分块大小=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 233392 inodes, 931770 blocks 46588 blocks (5.00%) reserved for the super user 第一个数据块=0 Maximum filesystem blocks=956301312 29 block groups 32768 blocks per group, 32768 fragments per group 8048 inodes per group Superblock backups stored on blocks:  32768, 98304, 163840, 229376, 294912, 819200, 884736

正在写入inode表: 完成                            Creating journal (16384 blocks): 完成 Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 38 mounts or 180 days, whichever comes first.  Use tune2fs -c or -i to override.

################################################################################

Partitioning is now done    Continue to install filesystem or select 'n' to safe exit

**Warning** Continuing will erase files any files in the partitions

################################################################################

Would you like to continue? [y/n] : n

boot和rootfs分区自动挂载到/media/

【2】环境搭建,生成bootloader和编译内核

ti提供的资料中会有一个叫ti-sdk-am335x-evm-05.04.01.00-Linux-x86-Install文件,这个里面有必要的工具包(minicom,filesystem,nfs,tftp,uboot,load uboot script)

打开终端:

(1)./ti-sdk-am335x-evm-05.04.01.00-Linux-x86-Install 将会在主目录下生成名为ti-sdk-am335x-evm-05.04.01.00 cd ti-sdk-am335x-evm-05.04.01.00/ sudo ./setup.sh(注意:系统不是10.04,则vim /ti-sdk-am335x-evm-05.04.01.00/setup.sh,将第十四行用#屏蔽掉。#$cwd/bin/setup-host-check.sh)。 遇到选项回车默认即可。

(2)gedit ~/.bashrc 在打开的文件末尾添加如下:

export PATH=/home/share/ti-sdk-am335x-evm-05.04.01.00/linux-devkit/bin:$PATH
export ARCH=arm
export CROSS_COMPILE=arm-arago-linux-gnueabi-

保存退出 source ~/.bashrc(使其生效)

(3)编译u-boot cd ti-sdk-am335x-evm-05.04.01.00/board-support/u-boot-2011.09-psp04.06.00.07/ make o=am335x am335x_evm 在am335x中会生成第一级bootloader MLO和第二级bootloader u-boot.img

(4)编译内核 cd ti-sdk-am335x-evm-05.04.01.00/board-support/linux-3.2-psp04.06.00.07.sdk/

依次执行如下命令:

make mrproper

make tisk_am335x-evm_defconfig

make (生成uImage)

uImage 在arch/arm/boot/下生成了uImage(内核)

(5) 将MLO,u-boot.img,uImage拷贝到SD卡的boot分区 将targetNFS里的所有文件拷贝到rootfs分区

将sd卡插入开发板上电。