WWW At91 Com Linux4sam Bin View Linux4SAM SDCardBootNotice
WWW At91 Com Linux4sam Bin View Linux4SAM SDCardBootNotice
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
FAQ updates by
Components
Introduction
This page is mainly about how to make a bootable SD card for AT91SAM SoCs. It also includes some FAQs about SD
USEFUL LINKS card boot.
AT91 Community
Microchip
SD card boot prerequisites
Linux4SAM on GitHub
All AT91SAM SoCs support SD card boot except SAM9260, SAM9261 rev A, SAM9263 rev A and SAMA5D2 rev B.
at91sam9x5eksd_uboot_defconfig
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
One SD or MicroSD card.
mount | grep /media # list all the partitions are mounted in /media
sudo umount /dev/sdxx # umount all listed by above command
Warning: Be very careful with this operation: if you don't choose the proper disk name, you could completely crash
your host system!
sudo dd if=/dev/zero of=/dev/sdx bs=10M count=1 # if you use SD card slot, you need
As follows, create one FAT partition and one non-FAT partition in the SD card:
Use Linux fdisk command to modify the partition table.
Start fdisk to open the SD card.
sudo fdisk /dev/mmcblkx # if using SD card reader you need change the device nam
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Press 'p' to display the partitions information. We can see that we have no partition in the 2G SD card
because we have already erased the MBR part.
Press 'n' to create a new primary partition and specify the partition size. For our FAT partition, 64M is enough
to store BOOT.BIN and IMAGE.BIN.
Press 't' to specify the new partition type to FAT16, which is the same as the FAT partition we deleted.
Press 'n' to create an additional primary Linux partition. In this case we specify the size as 1500M.
If you want to use the whole available space for the 2nd partition, don't specify the size, just press enter
key.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
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): +1500
By default the 2nd partition type is "Linux". So you don't need to press 't' to specify the type for it.
Press 'p' to display the partition information. We can see now we have two partitions.
Press 'w' to write the changed partition information. If you want to abort the change, just press 'q'.
Step5: Compile the at91bootstrap binary and copy it to the FAT partition.
Download the latest at91bootstrap from Linux4SAM.
Find the correct configuration file in board/at91sam9xxxek/
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
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.
Compile at91bootstrap with the correct config file.
In the top directory of at91bootstrap, run the following commands (take 9x5-ek loading u-boot as an example).
make mrproper
make at91sam9x5eksd_uboot_defconfig
make
If no error happens, then you can find the at91bootstrap binary (at91sam9x5ek-sdcardboot-uboot-3.x.bin) in the
binaries/ directory.
Copy at91bootstrap binary to the FAT partition, and change the name to BOOT.BIN.
cp at91bootstrap/binaries/at91sam9x5ek-sdcardboot-uboot-3.x.bin /mnt/fat/BOOT.BIN
Tip: If you want to copy file to the FAT partition in Windows XP/7 system, you must use a USB SD card reader.
Step6: Compile the U-Boot binary and copy it to the FAT partition
If at91bootstrap loads Linux kernel directly, then you can skip this step.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
fatload mmc 0 22000000 kernel_file_name
Tip: If you want to copy file to the FAT partition in Windows XP/7 system, then you must use a USB SD card reader.
FAQ
Q: How to use EXT4 rootfile system in SD card?
Two things are needed to support EXT4 rootfile system:
1. When create the bootable SD card, we need to format the second partition as EXT4, as follows:
sudo mkfs.ext4 /dev/mmcblkxp2 # if using SD card reader you need change the device na
2. Build Kernel with EXT4 support. Please add the following lines in the Linux kernel configuration file:
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_LBDAF=y
Q: What is the bootargs used to mount the EXT parition as root file system?
setenv bootargs 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=2'
Q: I copy the 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?
First, check if the boot.bin is the correct one for the current EK board.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
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.
Using fdisk command to open the SD card. Press 'p' to display the partition information.
Press 'p' to display the partition information. As we can see, the start sector is 63, and we need to move it to 64.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
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
Press 'w' to apply the change. If you want to abort the change, just press 'q'.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Q: How to extract the files of pre-compiled demo (UBI, JFFS2), and copy them to SD
card's ext2/4 partition?
To do this, mount the ubi/jffs2 pre-compiled demo image as a loopback device in your PC, and then copy all files to your
SD card's partition.
Tip: if you are using 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.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Q: Why the SD card with two partitions cannot be recognized in Windows PC?
If using SD card slot in PC, the Windows XP/7 system cannot recognize the multi-partitioned SD/MicroSD card. It
will prompt a message: "Disk is not formatted".
Use USB SD/MicroSD card reader so that Windows system can recognize the multi-partitioned SD card.
Q: Can I use Windows' default format tool instead of dd & mkfs.msdos to format the SD
Card?
In general, Windows' default format tool can work well. But sometimes it may cause problems for SD boot.
Because in Windows OS, the format behavior is different when using the notepad's SD card slot and using USB SD card
reader to read the SD card.
If using notepad's SD card slot, the SD card will be formatted as unpartitioned (No MBR, the first physical sector is
FAT boot sector).
If using USB SD card reader, the SD card will be formatted as partitioned (with MBR in the first physical sector).
If the SD card is formatted as unpartitioned, then using Linux 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.
Reference
Website: Understanding FAT32 .
WebFaqBaseForm
Components AT91Bootstrap
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
r10 - 03 Apr 2018 - 13:29:41 - LudovicDesroches
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.
Atmel® and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
ARM® and others are registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.
Syndicate this site RSS ATOM
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD