|
|||||||||||||
at91bootstrap/board/
. In the support board directory, you can find the config
files.
at91sam9xxekxx_linux_defconfig
, at91bootstrap will load IMAGE.BIN, the Linux kernel, in the same partition of SD card. at91sam9xxekxx_linux_defconfig
.
at91sam9xxekxx_uboot_defconfig
, at91bootstrap will load U-BOOT.BIN in the same partition of SD card.
at91sam9xxeksd_xxxxx_defconfig
at91sam9xxeknf_xxxxx_defconfig
at91sam9xxekdf_xxxxx_defconfig
at91sam9x5eksd_uboot_defconfig
/dev/sdx
, 'x' can be a, b, c... sdx1
, sdx2
... indicate the 1st, 2nd and other partitions.
/dev/mmcblkx
, 'x' can be 0, 1, 2... mmcblkxp1
, mmcblkxp2
... indicate the 1st, 2nd and other partitions.
mount | grep /media # list all the partitions are mounted in /media sudo umount /dev/sdxx # umount all listed by above command
dd
command to clean the MBR and the partition information. sudo dd if=/dev/zero of=/dev/sdx bs=10M count=1 # if you use SD card slot, you need change the parameter to: dev/mmcblkx
sudo fdisk /dev/mmcblkx # if using SD card reader you need change the device name to "/dev/sdx"
Command (m for help): p Disk /dev/mmcblk0: 2002 MB, 2002780160 bytes 11 heads, 10 sectors/track, 35560 cylinders Units = cylinders of 110 * 512 = 56320 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System
BOOT.BIN
and IMAGE.BIN
. Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-35560, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-35560, default 35560): +64M
Command (m for help): t Selected partition 1 Hex code (type L to list codes): 6 Changed system type of partition 1 to 6 (FAT16)
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (1194-35560, default 1194): Using default value 1194 Last cylinder, +cylinders or +size{K,M,G} (1194-35560, default 35560): +1500M
Command (m for help): p Device Boot Start End Blocks Id System /dev/mmcblk0p1 1 1193 65610 6 FAT16 /dev/mmcblk0p2 1194 29121 1536040 83 Linux
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table.
sudo mkfs.msdos /dev/mmcblk0p1 # format as FAT32 you need add parameters "-F 32". if using SD card reader you need change the device name to "/dev/sdx1" sudo mkfs.ext2 /dev/mmcblk0p2 # if using SD card reader you need change the device name to "/dev/sdx2" sudo mount -t vfat /dev/mmcblk0p1 /mnt/fat sudo mount -t ext2 /dev/mmcblk0p2 /mnt/ext
board/at91sam9xxxek/
at91sam9xxxsd_linux_defconfig
: with this configuration file, at91bootstrap will load IMAGE.BIN (Linux Kernel) directly.
at91sam9xxxsd_uboot_defconfig
: with this configuration file, at91bootstrap will load U-BOOT.BIN.
config
file.
make mrproper make at91sam9x5eksd_uboot_defconfig makeIf no error happens, then you can find the at91bootstrap binary (
at91sam9x5ek-sdcardboot-uboot-3.x.bin
) in the binaries/
directory.
cp at91bootstrap/binaries/at91sam9x5ek-sdcardboot-uboot-3.x.bin /mnt/fat/BOOT.BIN
u-boot.bin
to SD card's FAT partition.
make mrproper && make at91sam9x5ek_mmc
.
IMAGE.BIN
.
22000000
: fatload mmc 0 22000000 kernel_file_name
sudo mkfs.ext4 /dev/mmcblkxp2 # if using SD card reader you need change the device name to "/dev/sdx2"
CONFIG_EXT4_FS=y CONFIG_EXT4_FS_XATTR=y CONFIG_LBDAF=y
setenv bootargs 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=2'
boot.bin
(it is a correct bootstrap binary) to my SD card's FAT partition, but the ROM code cannot load boot.bin. What should I do? boot.bin
is the correct one for the current EK board.
Second, rename the file with all capital letters: BOOT.BIN
.
If it still doesn't work, it might be the FAT partition offset, which causes that ROM code cannot find the BOOT.BIN.
The solution is to move the FAT partition's first start sector to the next sector.
The following shows using fdisk
command to open SD card. Press x to enter expert mode, and then press b to move the partition's beginning sector offset to the next sector.
fdisk
command to open the SD card. Press 'p' to display the partition information. sudo fdisk /dev/sdb 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): p Disk /dev/sdb: 1977 MB, 1977614336 bytes 255 heads, 63 sectors/track, 240 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x6abc6fb3 Device Boot Start End Blocks Id System /dev/sdb1 1 240 1927768+ b W95 FAT32
Command (m for help): x
Expert command (m for help): p Disk /dev/sdb: 255 heads, 63 sectors, 240 cylinders Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID 1 00 1 1 0 254 63 239 63 3855537 0b 2 00 0 0 0 0 0 0 0 0 00 3 00 0 0 0 0 0 0 0 0 00 4 00 0 0 0 0 0 0 0 0 00 Expert command (m for help): m Command action b move beginning of data in a partition c change number of cylinders d print the raw data in the partition table e list extended partitions f fix partition order g create an IRIX (SGI) partition table h change number of heads i change the disk identifier m print this menu p print the partition table q quit without saving changes r return to main menu s change number of sectors/track v verify the partition table w write table to disk and exit
Expert command (m for help): b Partition number (1-4): 1 New beginning of data (63-3855599, default 63): 64 Expert command (m for help): p Disk /dev/sdb: 255 heads, 63 sectors, 240 cylinders Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID 1 00 1 1 0 254 63 239 64 3855536 0b Partition 1 has different physical/logical beginnings (non-Linux?): phys=(0, 1, 1) logical=(0, 1, 2) 2 00 0 0 0 0 0 0 0 0 00 3 00 0 0 0 0 0 0 0 0 00 4 00 0 0 0 0 0 0 0 0 00
Expert command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table.
sudo apt-get install mtd-utils
modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x00 fourth_id_byte=0x15 modprobe ubi mtd=0 ubidetach /dev/ubi_ctrl -m 0 ubiformat /dev/mtd0 -s 2048 -f Angstrom-x11-at91sam9-image-eglibc-ipk-v20110624-at91sam9x5ek.rootfs.ubi ubiattach /dev/ubi_ctrl -m 0 -O 2048 mkdir /mnt/loop mount -t ubifs ubi0 /mnt/loop cp -R /mnt/loop/* /new/directory
modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x00 fourth_id_byte=0x15 modprobe mtdblock modprobe mtdchar modprobe mtd mtd=0 dd if=Angstrom-x11-at91sam9m10-image-glibc-ipk-2009.X-stable-at91sam9m10g45ek.rootfs.jffs2 of=/dev/mtd0 mkdir /mnt/loop mount -t jffs2 /dev/mtdblock0 /mnt/loop cp -R /mnt/loop/* /new/directory/
sama5d4ek
or sama5d4_xplained
board, the nand flash is different, so please use following line to do the nandsim, and change the page size to 4096.
sudo modprobe nandsim first_id_byte=0x2c second_id_byte=0xdc third_id_byte=0x90 fourth_id_byte=0xa6
fdisk
command to create partitions will cause problems.
Since fdisk
command only modifies MBR, it will think the first sector of the unpartitioned SD card as MBR.
The solution for this case is to run dd
to erase SD card's sectors. Please follow Step2.
WebFaqBaseForm | |
---|---|
Boards | Sama5d29Curiosity, Sam9x75Curiosity, Sam9x60Curiosity, Sama5d2-icp, Sam9x60EK, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek, AT91sam9x5-ek |
Components | AT91Bootstrap |
Summary | How to boot up the board from SD card |
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.