Difference between revisions of "BeagleBoard Zippy2"

From eLinux.org
Jump to: navigation, search
(Creating a bootable SD card in Ubuntu)
(Where to purchase the Zippy2 (KSZ8851SNL-BBE-EVAL))
 
(110 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category: Linux]]
+
 
[[Category: Expansion Boards]]
 
[[Category:Development Boards]]
 
[[Category: Zippy2 (KSZ8851SNL-BBE-EVAL)]]
 
  
 
[[File:zippy2-base.jpg|400px]]
 
[[File:zippy2-base.jpg|400px]]
  
The Zippy2 Ethernet Combo Board (KSZ8851SNL-BBE-EVAL) is a low cost expansion board for the BeagleBoard that provides the following peripherals:
+
The Zippy2 Ethernet Combo Board (KSZ8851SNL-BBE-EVAL) is a low cost expansion board for the [[BeagleBoard]] that provides the following peripherals:
 
* 10/100BaseT Ethernet
 
* 10/100BaseT Ethernet
 
* Second SD/MMC Interface
 
* Second SD/MMC Interface
Line 13: Line 10:
 
* I2C Interface (+5V level)
 
* I2C Interface (+5V level)
 
* AT24C01 Serial EEPROM for Board Identification
 
* AT24C01 Serial EEPROM for Board Identification
 +
 +
 +
The Zippy2 (KSZ8851SNL-BBE-EVAL) board was jointly developed by [http://www.micrel.com Micrel] and [[TinCanTools]] ([http://www.tincantools.com Company Website]) and is available [http://www.tincantools.com/product.php?productid=16148&cat=255&page=1 here].
 +
.
 +
  
  
Line 25: Line 27:
 
== RS232 Serial Interface ==
 
== RS232 Serial Interface ==
  
The Zippy2 provides a second RS-232 serial port for the BeagleBoard. There are two serial connectors provided. Either connector is available for use: 1) standard DB9 Male connector, or 2) 2x5 shrouded header (0.1 inch pin spacing).
+
The Zippy2 provides a second RS-232 serial port for the BeagleBoard:
 +
There are two serial connectors provided.  
 +
* Standard DB9 Male connector
 +
* 2x5 shrouded header (0.1 inch pin spacing).
  
 
== Real-time Clock ==
 
== Real-time Clock ==
Line 70: Line 75:
  
 
== Serial EEPROM ==
 
== Serial EEPROM ==
The Zippy2 provides a AT24C01 serial EEPROM that contains a Vendor ID and a Device ID that the BeagleBoard uses to identify the type of board connected to the expansion header.  This information enables the BeagleBoard to auto-configure the pin mux for signals needed by the Zippy2.  More information can be found [http://elinux.org/BeagleBoardPinMux#Expansion_boards here].
+
The Zippy2 provides an AT24C01 serial EEPROM that contains a Vendor ID and a Device ID that the BeagleBoard uses to identify the type of board connected to the expansion header.  This information enables the BeagleBoard to auto-configure the pin mux for signals needed by the Zippy2.  More information can be found on the [[BeagleBoardPinMux|Beagle Board Pin Mux Page]].
  
 
= Soldering BeagleBoard's Expansion Header =
 
= Soldering BeagleBoard's Expansion Header =
Line 94: Line 99:
 
[[File:zippy2-expansion_connector7.jpg|400px]]
 
[[File:zippy2-expansion_connector7.jpg|400px]]
  
Attach the four board spacers with the screws provides.
+
Attach the four board spacers with the screws provided.
  
  
Line 119: Line 124:
 
= Creating a bootable SD card in Ubuntu =
 
= Creating a bootable SD card in Ubuntu =
  
This guide will show you how to create a '''dual-partition''' SD card for the BeagleBoard/Zippy2 combination to boot Linux from the first partition and have the root file system located on the second partition.  This guide covers the same procedure as [http://elinux.org/BeagleBoardBeginners#SD_card_setup BeagleBoardBeginners SDCard setup] and [http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat LinuxBootDiskFormat].
+
This guide will demonstate how to create a '''dual-partition''' SD card for the BeagleBoard/Zippy2 combination to boot Linux from the first partition and have the root file system located on the second partition.   
 +
 
 +
This guide covers the same procedure as [[BeagleBoardBeginners|SDCard setup]] and [http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat LinuxBootDiskFormat].
 +
 
 +
This guide will use a '''2GB SD card''' for all examples.
  
 
'''Determine which device the SD Card Reader is on your system'''
 
'''Determine which device the SD Card Reader is on your system'''
Line 126: Line 135:
  
 
  dmesg | tail
 
  dmesg | tail
 +
...
 +
[2079456.496092] sd 34:0:0:0: [sdb] Mode Sense: 03 00 00 00
 +
[2079456.496096] sd 34:0:0:0: [sdb] Assuming drive cache: write through
 +
[2079456.513743] sd 34:0:0:0: [sdb] Assuming drive cache: write through
 +
[2079456.513751]  sdb: sdb1
 +
[2079456.529193] sd 34:0:0:0: [sdb] Assuming drive cache: write through
 +
[2079456.529201] sd 34:0:0:0: [sdb] Attached SCSI removable disk
  
 
In this case it shows up as /dev/sdb (note sdb insite the square brackets above).
 
In this case it shows up as /dev/sdb (note sdb insite the square brackets above).
Line 132: Line 148:
  
 
  df -h
 
  df -h
 +
Filesystem            Size  Used Avail Use% Mounted on
 +
...                  1.8G    0  1.8G  0% /lib/init/rw
 +
/dev/sdb1            1.9G    0  1.9G  0% /media/6262-9331
 +
...
  
 
'''If mounted, unmount the SD card'''
 
'''If mounted, unmount the SD card'''
  
  umount /media/disk
+
  umount /media/6262-9331
  
 
'''Start fdisk:'''
 
'''Start fdisk:'''
  
 
  sudo fdisk /dev/sdb
 
  sudo fdisk /dev/sdb
 
 
'''Print the partition record:'''
 
'''Print the partition record:'''
 +
<pre>
 +
  Command (m for help): p
  
Disk /dev/sdb: 1967 MB, 1967128576 bytes
+
  Disk /dev/sdb: 1967 MB, 1967128576 bytes
57 heads, 56 sectors/track, 1203 cylinders
+
  57 heads, 56 sectors/track, 1203 cylinders
Units = cylinders of 3192 * 512 = 1634304 bytes
+
  Units = cylinders of 3192 * 512 = 1634304 bytes
+
   Disk identifier: 0x00000000
  Device Boot      Start        End      Blocks   Id  System
 
 
 
  
Note card size in bytes listed above (in this example: 1967128574). '''Write this number down, it will be needed later below'''.
+
  Device Boot      Start        End      Blocks  Id  System
 +
  /dev/sdb1            1        1204    1920955+  6  FAT16
 +
</pre>
 +
Note card size in bytes listed above (in this example: '''1967128576'''). '''Write this number down, it will be needed later below'''.
  
 
'''Delete any partitions that are already on the SD card'''
 
'''Delete any partitions that are already on the SD card'''
Line 161: Line 183:
 
Go into "Expert mode":
 
Go into "Expert mode":
  
Command (m for help): ''x''
+
  Command (m for help): ''x''
  
 
Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD card you are using:
 
Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD card you are using:
 +
<pre>
 +
  Expert command (m for help): h
 +
  Number of heads (1-256, default 57): 255
  
Expert command (m for help): ''h''
+
  Expert command (m for help): s
Number of heads (1-256, default 4): ''255''
+
  Number of sectors (1-63, default 56): 63
+
  Warning: setting sector offset for DOS compatiblity
Expert command (m for help): ''s''
 
Number of sectors (1-63, default 62): ''63''
 
Warning: setting sector offset for DOS compatiblity
 
 
Expert command (m for help): ''c''
 
Number of cylinders (1-1048576, default 1203: ''239''
 
  
 +
  Expert command (m for help): c
 +
  Number of cylinders (1-1048576, default 1203): 239
 +
</pre>
 
The '''239''' entered in the cylinders above must be calculated based upon the size of your particular SD card.
 
The '''239''' entered in the cylinders above must be calculated based upon the size of your particular SD card.
  
 
'''Now Calculate the number of Cylinders for your SD card:'''  
 
'''Now Calculate the number of Cylinders for your SD card:'''  
  
number of cylinders = FLOOR (the number of Bytes on the SD Card (from above) / 255 heads / 63 sectors / 512 sector size in bytes )
+
'''''number of cylinders = FLOOR (the number of Bytes on the SD Card (from above) / 255 heads / 63 sectors / 512 sector size in bytes )'''''
  
So for this example:  128450560 / 255 / 63 / 512 = 239.156427  (use Google to calculate).  So we use 239 (i.e. truncate, don't round).
+
So for this example:  1967128576 / 255 / 63 / 512 = 239.156427  (use Google to calculate).  So we use 239 (i.e. truncate, don't round).
 
   
 
   
 
Return to "Normal" mode:
 
Return to "Normal" mode:
Line 189: Line 211:
  
 
'''Print the partition record to check your work:'''  
 
'''Print the partition record to check your work:'''  
+
<pre>
  Command (m for help): ''p''
+
  Command (m for help): p
  
 
  Disk /dev/sdb: 1967 MB, 1967128576 bytes
 
  Disk /dev/sdb: 1967 MB, 1967128576 bytes
  57 heads, 56 sectors/track, 1203 cylinders
+
  255 heads, 63 sectors/track, 239 cylinders
  Units = cylinders of 3192 * 512 = 1634304 bytes
+
  Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
 
  
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        1204    1920955+  6  FAT16
 
 
  
 +
</pre>
  
 
'''Create the FAT32 partition for booting and transferring files from your PC'''
 
'''Create the FAT32 partition for booting and transferring files from your PC'''
 
+
<pre>
Command (m for help): ''n''
+
Command (m for help): n
 
  Command action
 
  Command action
 
     e  extended
 
     e  extended
 
     p  primary partition (1-4)
 
     p  primary partition (1-4)
  ''p''
+
  p
  Partition number (1-4): ''1''
+
  Partition number (1-4): 1
  First cylinder (1-15, default 1): ''1''
+
  First cylinder (1-15, default 1): 1
  Last cylinder or +size or +sizeM or +sizeK (1-15, default 15): ''50''
+
  Last cylinder or +size or +sizeM or +sizeK (1-239, default 239): 50
  
  Command (m for help): ''t''
+
  Command (m for help): t
 
  Selected partition 1
 
  Selected partition 1
  Hex code (type L to list codes): ''c''
+
  Hex code (type L to list codes): c
 
  Changed system type of partition 1 to c (W95 FAT32 (LBA))
 
  Changed system type of partition 1 to c (W95 FAT32 (LBA))
 
+
</pre>
 
We use 50 cylinders of the total of 239 for the FAT32 partition above.  The remainder of the cylinders will be used for the Linux root file system below.
 
We use 50 cylinders of the total of 239 for the FAT32 partition above.  The remainder of the cylinders will be used for the Linux root file system below.
  
'''Mark it bootable:'''
+
'''Mark this FAT32 partition as bootable:'''
  
  Command (m for help): ''a''
+
  Command (m for help): a
  Partition number (1-4): ''1''
+
  Partition number (1-4): 1
  
And change its type to FAT32:
+
'''Create the Linux partition for the root file system'''
 
+
<pre>
Command (m for help): ''t''
+
  Command (m for help): n
Selected partition 1
+
  Command action
Hex code (type L to list codes): ''c''
+
     e   extended
Changed system type of partition 1 to c (W95 FAT32 (LBA))
+
    p   primary partition (1-4)
 
+
''p''
'''Mark it as bootable'''
+
Partition number (1-4): 2
 
+
  First cylinder (51-239, default 51): 51
  Command (m for help): ''p''
+
  Last cylinder or +size or +sizeM or +sizeK (51-239, default 239): 239
+
</pre>
Disk /dev/sdb: 128 MB, 128450560 bytes
 
''255 heads, 63 sectors/track, 15 cylinders''
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   
 
     Device Boot      Start        End      Blocks   Id  System
 
''/dev/sdb1   *          1         15      120456    c  W95 FAT32 (LBA)''
 
 
 
Now, ''really'' write configuration to card (until here, card is not changed):
 
 
 
  Command (m for help): ''w''
 
The partition table has been altered!
 
   
 
Calling ioctl() to re-read partition table.
 
 
   
 
   
WARNING: If you have created or modified any DOS 6.x
+
'''Print the partition record to check your work'''  
partitions, please see the fdisk manual page for additional
+
<pre>
information.
+
Command (m for help): p
Syncing disks.
 
 
 
Done! What's left is to format our partition as FAT32 to be mounted and populated:
 
 
 
# mkfs.vfat -F 32 /dev/sdb1
 
mkfs.vfat 2.11 (12 Mar 2005)
 
 
 
Note: before running mkfs.vfat (included in the dosfstools package in Debian) make sure /dev/sdb is not mounted.
 
 
# mount /dev/sdb1 /mnt/tmp
 
 
 
Note: If you use additional mkfs.vfat parameter ''-n'' you can give the card a name, e.g. for easier identification (i.e. ''mkfs.vfat -n omap3 -F 32 /dev/sdb1'')
 
 
 
The SD/MMC card is now ready to be used to boot
 
 
 
 
 
 
 
 
 
== NEW SECTION ==
 
 
 
 
 
 
 
*******************
 
Now start fdisk to check the partition table of the SD card.
 
 
 
First, lets clear the partition table:
 
 
 
  fdisk /dev/sdb
 
 
 
  Command (m for help): o
 
  Building a new DOS disklabel. Changes will remain in memory only,
 
  until you decide to write them. After that, of course, the previous
 
  content won't be recoverable.
 
 
 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
 
 
Print card info:
 
 
 
Command (m for help): p
 
  
 
  Disk /dev/sdb: 1967 MB, 1967128576 bytes
 
  Disk /dev/sdb: 1967 MB, 1967128576 bytes
  57 heads, 56 sectors/track, 1203 cylinders
+
  255 heads, 63 sectors/track, 239 cylinders
Units = cylinders of 3192 * 512 = 1634304 bytes
+
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
 
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdb1              1        1204    1920955+  6  FAT16
 
 
 
 
 
 
 
Then go into "Expert mode":
 
 
 
Command (m for help): x
 
 
 
Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD/MMC card:
 
 
 
Expert command (m for help): h
 
Number of heads (1-256, default 4): 255
 
 
 
Expert command (m for help): s
 
Number of sectors (1-63, default 62): 63
 
Warning: setting sector offset for DOS compatiblity
 
 
 
Expert command (m for help): c
 
Number of cylinders (1-1048576, default 1011): 15
 
 
 
In this case 128MB card is used (reported as 128450560 bytes by fdisk above), thus 128450560 / 255 / 63 / 512 = 15.6 rounded down to 15 cylinders. Numbers there are 255 heads, 63 sectors, 512 bytes per sector.
 
 
 
Now, return to main mode and create a new partition:
 
 
 
Expert command (m for help): r
 
 
 
Command (m for help): n
 
Command action
 
  e  extended
 
  p  primary partition (1-4)
 
p
 
Partition number (1-4): 1
 
First cylinder (1-15, default 1): 1
 
Last cylinder or +size or +sizeM or +sizeK (1-15, default 15): 15
 
 
 
Mark it bootable:
 
 
 
Command (m for help): a
 
Partition number (1-4): 1
 
 
 
And change its type to FAT32:
 
 
 
Command (m for help): t
 
Selected partition 1
 
Hex code (type L to list codes): c
 
Changed system type of partition 1 to c (W95 FAT32 (LBA))
 
 
 
The result is:
 
 
 
Command (m for help): p
 
 
 
Disk /dev/sdb: 128 MB, 128450560 bytes
 
255 heads, 63 sectors/track, 15 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdb1  *          1          15      120456    c  W95 FAT32 (LBA)
 
 
 
Now, really write configuration to card (until here, card is not changed):
 
 
 
Command (m for help): w
 
The partition table has been altered!
 
 
 
Calling ioctl() to re-read partition table.
 
 
 
WARNING: If you have created or modified any DOS 6.x
 
partitions, please see the fdisk manual page for additional
 
information.
 
Syncing disks.
 
 
 
Done! What's left is to format our partition as FAT32 to be mounted and populated:
 
 
 
# mkfs.vfat -F 32 /dev/sdb1
 
mkfs.vfat 2.11 (12 Mar 2005)
 
 
 
Note: before running mkfs.vfat (included in the dosfstools package in Debian) make sure /dev/sdb is not mounted.
 
 
 
# mount /dev/sdb1 /mnt/tmp
 
 
 
Note: If you use additional mkfs.vfat parameter -n you can give the card a name, e.g. for easier identification (i.e. mkfs.vfat -n omap3 -F 32 /dev/sdb1)
 
 
 
The SD/MMC card is now ready to be used to boot OMAP3 boards.
 
 
 
==Adjust the Geometry of the Card==
 
 
 
Print the current partition table:
 
 
 
'''Command (m for help):''' P
 
 
 
Disk /dev/sdb: 7948 MB, 7948206080 bytes
 
81 heads, 10 sectors/track, 19165 cylinders
 
Units = cylinders of 810 * 512 = 414720 bytes
 
Disk identifier: 0x00000000
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdb1              11      19166    7757824    b  W95 FAT32
 
 
 
Remember the top right number: 7948206080 bytes. It of course depends on the size of the SD card. You will need it later to calculate the new number of cylinders.
 
 
 
Delete this partition:
 
 
 
'''Command (m for help):''' D
 
 
 
Selected partition 1
 
 
 
Go into Expert mode:
 
 
 
'''Command (m for help):''' X
 
 
 
Selected partition 1
 
 
 
Set the number of heads to 255
 
 
 
'''Expert command (m for help):''' H
 
 
 
Number of heads (1-256, default 81): 255Enter
 
 
 
Set the number of sectors to '''63'''
 
 
 
'''Expert command (m for help):''' S
 
 
 
'''Number of sectors (1-63, default 10):''' 63
 
 
 
This warning is normal and fine:
 
 
 
Warning: setting sector offset for DOS compatiblity
 
 
 
Now the number of cylinders has to be adjusted to match the size of your SDHC card:
 
 
 
cylinders = floor(bytes of the SDHC card (see the note above) / heads / sectors / sector size (512))
 
 
 
So for our 8GB microSDHC card, this is then (use Google to calculate):
 
 
 
7948206080 / 255 / 63 / 512 = 966.314348
 
 
 
So we cut off the decimal digits (not rounding) and use 966 for this example.
 
 
 
Expert command (m for help): CEnter
 
 
 
The number 966 is of course only valid for our 8GB SDHC card. Use your calculated number here!
 
  
'''Number of cylinders (1-1048576, default 19165):''' 966
 
  
Return to normal mode:
 
 
'''Expert command (m for help):''' R
 
 
Check the result:
 
 
'''Command (m for help):''' P
 
 
Disk /dev/sdb: 7948 MB, 7948206080 bytes
 
255 heads, 63 sectors/track, 966 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk identifier: 0x00000000
 
 
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
 +
/dev/sdb1              1        50    1920955+  c  w95 FAT32 (LBA)
 +
/dev/sdb2              51        239              83 Linux
 +
</pre>
 +
'''Save the new partition records on the SD card'''
  
==Create the boot partition==
+
This is an important step. All work up to now has been temporary.
 
+
<pre>
Create a new partition (the boot partition):
+
   Command (m for help): w
 
+
   The partition table has been altered!
'''Command (m for help):''' N
 
 
 
  Command action
 
    e  extended
 
    p  primary partition (1-4)
 
 
 
Create the first primary partition:
 
 
 
'''Command (m for help):''' P
 
 
 
Command action
 
  e  extended
 
  p  primary partition (1-4)
 
 
 
'''Partition number (1-4):''' 1
 
'''First cylinder (1-966, default 1):'''1
 
 
 
Using default value 1
 
 
 
Select cylinder 50 as last cylinder
 
 
 
'''Last cylinder, +cylinders or +size{K,M,G} (1-966, default 966):''' +50C
 
 
 
==Create the Linux partition==
 
 
 
Create a new partition (the linux partition):
 
 
 
'''Command (m for help):''' N
 
 
 
Command action
 
  e   extended
 
  p  primary partition (1-4)
 
 
 
Create the first primary partition:
 
 
 
'''Command (m for help):''' P
 
 
 
Command action
 
  e   extended
 
  p  primary partition (1-4)
 
 
 
'''Partition number (1-4):''' 2
 
'''First cylinder (52-966, default 52):'''  Enter
 
 
 
Using default value 52
 
 
 
Select cylinder 966 as last cylinder (using the default)
 
 
 
'''Last cylinder, +cylinders or +size{K,M,G} (52-966, default 966):''' Enter
 
 
 
==Final Result==
 
 
 
Check the result, it should now look like this (depending on the SD card size):
 
 
 
'''Command (m for help):''' P
 
 
 
Disk /dev/sdb: 7948 MB, 7948206080 bytes
 
255 heads, 63 sectors/track, 966 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk identifier: 0x00000000
 
 
   
 
   
  Device Boot      Start        End      Blocks   Id  System
+
   Calling ioctl() to re-read partition table.
/dev/sdb1              1          51      409626  83  Linux
 
/dev/sdb2              52        966    7349737+  83  Linux
 
 
 
==Write the partition table==
 
 
 
The changes you made are not yet written to the hard disk. Write them now. FDISK will exit after the write operation.
 
 
 
'''Command (m for help):''' W
 
 
 
The partition table has been altered!
 
 
   
 
   
Calling ioctl() to re-read partition table.
+
  WARNING: If you have created or modified any DOS 6.x
Syncing disks.
+
  partitions, please see the fdisk manual page for additional
 
+
  information.
Finished! The next step is to format the new partitions.
+
  Syncing disks.
 
+
</pre>
==Format the Card==
+
'''Format the partitions'''
 
+
<pre>
Watch out to use the right harddisk handle (/dev/sdb or /dev/sdc)! You can't format mounted drives (e.g. your currently running Linux) but you might format the wrong card or a spare harddisk. Format the boot partition (labeled in this case 'BOOT', but any other string is legal). '''It is recommended to use the proposed drive label names as this will make the further use of our tutorials more convenient.'''
+
  sudo mkfs.msdos -F 32 /dev/sdb1 -n boot
 
+
  mkfs.msdos 3.0.3 (18 May 2009)
sudo mkfs.msdos -F 32 /dev/sdb1 -n BOOT
 
  
Format the Linux partition (labeled 'LINUX')
+
  sudo mkfs.ext3 -L rootfs /dev/sdb2
 +
  mke2fs 1.41.9 (22-Aug-2009)
 +
  Filesystem label=rootfs
 +
  OS type: Linuxsudo mkfs.ext3 -L rootfs /dev/sdb2
 +
  mke2fs 1.41.9 (22-Aug-2009)
 +
  Filesystem label=rootfs
 +
  OS type: Linux
 +
  Block size=4096 (log=2)
 +
  Fragment size=4096 (log=2)
 +
  95040 inodes, 379535 blocks
 +
  18976 blocks (5.00%) reserved for the super user
 +
  First data block=0
 +
  Maximum filesystem blocks=390070272
 +
  12 block groups
 +
  32768 blocks per group, 32768 fragments per group
 +
  7920 inodes per group
 +
  Superblock backups stored on blocks:
 +
  32768, 98304, 163840, 229376, 294912
  
sudo mkfs.ext3 -L LINUX /dev/sdb2
+
  Writing inode tables: done
 
+
  Creating journal (8192 blocks): done
==Copy files onto SDHC card==
+
  Writing superblocks and filesystem accounting information: done
 
+
</pre>
The last step is to copy the Linux system onto a bootable SD/SDHC card.
 
 
 
'''''Unplug and re-plug your card reader in order to auto-mount the two new partitions.'''''
 
 
 
If your card is correctly formatted, then you can now copy the Linux system on it.
 
  
 
==Copy files onto the BOOT partition ==
 
==Copy files onto the BOOT partition ==
  
You will need to download the following files:
+
You will need to download the demo/test files for the BeagleBoard/Zippy2 combination:
 +
#[[media:MLO-zippy2.ift|MLO]] (save as MLO)
 +
#[[media:u-boot-zippy2.bin|u-boot.bin]] (save as u-boot.bin)
 +
#[[media:uImage-zippy2.bin|uImage]] (save as uImage)
 +
#[[media:test.rootfs2.tar.gz|test.rootfs.tar.gz]] (save as test.rootfs.tar.gz)
  
*Demo/Test Files
 
**[[media:MLO-zippy2.ift|MLO]] (save as MLO)
 
**[[media:u-boot-zippy2.bin|u-boot.bin]] (save as u-boot.bin)
 
**[[media:uImage-zippy2.bin|uImage]] (save as uImage)
 
**[[media:test.rootfs2.tar.gz|test.rootfs.tar.gz]]
 
  
'''IMPORTANT: Copy MLO FIRST!'''.
+
And now copy the first three files onto the boot partition ('''IMPORTANT: Copy MLO FIRST!''' because of a bug in the X-loader which causes problems if MLO is not the first file written onto the boot partition).
  
And now copy the two files onto the boot partition (MLO first because of a bug in the X-loader which causes problems if MLO is not the first file written onto the boot partition).
+
  cp MLO /media/boot/MLO
 +
  cp u-boot.bin /media/boot/u-boot.bin
 +
  cp uImage /media/boot/uImage
  
cp MLO /media/boot/MLO
+
==Copy the files onto the Linux partition==
cp u-boot.bin /media/boot/u-boot.bin
 
  
The Linux kernel (uImage) resides also on the BOOT partition of the SD-card. If you compile a new version of the kernel you have to copy the new uImage on the BOOT partition. See the instructions below.
+
The next step is to extract the files in '''test-rootfs.tar.gz''' into the rootfs partition (NOT the boot partition) on the SD card. This can only be done by using Linux.  
Copy Linux
 
  
The next step is to copy the Linux kernel and the Linux root filesystem on the '''boot'''and '''rootfs''' partitions. You can use precompiled binaries for both or compile an OpenEmbedded image yourself.  
+
  sudo tar -zxvf test-rootfs.tar.gz -C /media/rootfs
  
Instructions for both options are provided below.
+
Unmount the SD card from the Linux PC and insert it into the BeagleBoard's SD connector.
Copy the precompiled Ångström Image
 
  
The precompiled Ångström image consists (besided MLO and u-boot.bin from the bootloader section) of two files: The Linux kernel image (uImage) and the root file system.
+
Then boot your BeagleBoard while holding down the "User" button.
Copy uImage
 
  
 +
= Automated script to create a bootable SD card =
  
cp uImage /media/BOOT/uImage
+
The following script will create a formatted SD card using your Linux PC. 
  
Copy the Linux root file system
+
*[[media:mksdcard2.sh| mksdcard.sh]]
  
The file is named *rootfs.tar.bz2 for the Beagle link
+
Make a working directory for the files: mksdcard.sh, MLO, u-boot.bin, uImage, and test-rootfs.tar.gz and copy them into it.
  
http://www.angstrom-distribution.org/demo/beagleboard/
+
You will also need to make two mount points:
  
Download the files to a temporary directory, e.g. the Desktop or your user folder. The next step is to extract these files into the LINUX partition (NOT the boot partition). This can only be done by using Linux.
+
  mkdir /mnt/sdcard1
 +
  mkdir /mnt/sdcard2
  
 +
Then from inside the working directory you created above, issue the command like this:
  
sudo tar xjf *rootfs.tar.bz2 -C /media/LINUX
+
  ./mksdcard.sh /dev/sdb
  
==Copy custom OpenEmbedded Linux Image==
+
Where /dev/sdb is the drive for the SD card.
Linux Kernel Image and u-boot bootloader
 
  
Copy the kernel image and u-boot.
+
This should generate a fresh bootable SD card for you!
  
sudo cp $OE_HOME/tmp/deploy/glibc/images/beagleboard/uImage-beagleboard.bin /media/BOOT/uImage
+
= Design Documents =
cp $OE_HOME/tmp/deploy/glibc/images/beagleboard/u-boot-beagleboard.bin /media/BOOT/u-boot.bin
+
The following are the design documents for the Zippy2 (KSZ8851SNL-BBE-EVAL) board:
 
+
* [[media:zippy2_schematic.pdf|Zippy2_schematic]]
Linux root filesystem
+
* [[media:zippy2_gerbers.zip|Zippy2_gerbers.zip]]
 
+
* [[media:zippy2_BOM.pdf|Zippy2_BOM.pdf]]
After the kernel, the root filesystem has to be copied as well. If you are overwriting an existing installation and you don't need a 100% clean system, you can just delete all files. The command below will delete all files in /media/LINUX except the lost+found directory of the EXT3 file system.
 
 
 
sudo rm -rf /media/LINUX/* && sudo mkdir /media/LINUX/lost+found
 
 
 
 
 
The console image:
 
  
sudo tar xjf $OE_HOME/tmp/deploy/glibc/images/beagleboard/omap3-console-image-beagleboard.tar.bz2 -C /media/LINUX
+
= Software Links =
  
 +
The latest Linux driver for the KSZ8851SNL is included in the mainline Linux kernel and can be downloaded here:
  
Unmount the SD/SDHC card
+
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.7.tar.bz2
  
Now unmount the drive either manually (by clicking the unmount icon on the desktop) or by shell command:
+
Also, Linus' GIT repo can be pulled from here:
  
sync
+
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary
sudo umount /media/BOOT
 
sudo umount /media/LINUX
 
sudo rm -r /media/BOOT
 
sudo rm -r /media/LINUX
 
  
==Copy bytewise from one SDHC card to another==
+
Or you can view just the driver:
  
If you have modified your installation and want to clone the content of the SD card, you can do this with '''dd'''.
+
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/net/ks8851.c;h=6d3ac65bc35cfcd1ae3eb27e6249a8be38efe705;hb=HEAD
  
Make sure to plug in the source card first, then the destination card. Check the file names with:
+
= Programming the Zippy2 =
 +
All of the devices on the Zippy2 work as standard linux devices which means any reference material for these devices is applicable:
  
dmesg | tail
+
How to access the I2C bus (from software): http://i2c.wiki.kernel.org/index.php/Linux_2.6_I2C_development_FAQ
  
And unmount the card (with the GUI or with umount /dev/sdb). Then use '''dd''' to copy the first gigabyte from one card to the other (including partition table, etc.):
+
How to access the second UART: http://tldp.org/HOWTO/Serial-HOWTO.html
 +
and http://www.vanemery.com/Linux/Serial/serial-console.html
  
sudo dd if=/dev/sdb of=/dev/sdc bs=1073741824
+
How to use and configure the Ethernet port: http://tldp.org/HOWTO/Ethernet-HOWTO.html
  
= Automated script =
+
How to access the SD card:
 +
If you are using the Angstrom images, then all you have to do is insert the SD card and it will be automatically mounted.  To check just issue the command "mount" at the prompt to view the currently mounted devices.
  
The following script will create a formatted SD card using your Linux PC. 
 
 
*[[media:mksdcard2.sh| mksdcard.sh]]
 
 
Attached are the files needed to generate a new sd card for testing the Zippy2:
 
 
Make a directory for the files and copy them to it. You will also need to make two mount points:
 
 
mkdir /mnt/sdcard1
 
mkdir /mnt/sdcard2
 
 
Then issue the command like this:
 
 
./mksdcard.sh /dev/sdb
 
 
Where /dev/sdb is the drive for the sd card.
 
 
This should generate a fresh bootable sdcard for you!
 
 
= Design Documents =
 
  
 +
To set the real time clock (RTC) on the Zippy2 board:
  
[[File:zippy2-base.jpg|200px]]
+
First: Set the date:
 +
  date -s 2010.02.15-17:52
 +
(date -s YYYY.MM.DD-HH:SS  (the time HH:SS is in 24 hour format)
  
 +
Then write the current date into the RTC's hardware registers:
  
 +
  hwclock -w
  
= Software =
+
As long as you have a good backup battery (the small coin battery),  the RTC should keep the time correct even if you remove power and boot-up the BeagleBoard at a later time.
  
*Demo/Test Files
+
= Where to purchase the Zippy2 (KSZ8851SNL-BBE-EVAL)=
**[[media:MLO-zippy2.ift|MLO]] (save as MLO)
 
**[[media:u-boot-zippy2.bin|u-boot.bin]] (save as u-boot.bin)
 
**[[media:uImage-zippy2.bin|uImage]] (save as uImage)
 
**[[media:defconfig2.txt|Kernel Config]]
 
  
*place these files on your formated SD card per the instuctions at the [http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat LinuxBootDiskFormat] page
+
The Zippy2 can be purchased from [http://www.tincantools.com/product.php?productid=16148&cat=255&page=1 TinCanTools.com (USA)] and [http://www.watterott.com/en/Zippy2-Ethernet-Combo-Board watterott.com (Germany)]
*boot your BeagleBoard while holding down the "User" button.
+
[[Category: BeagleBoard]]
 +
[[Category: BeagleBoard Expansion Boards]]
 +
[[Category: TinCanTools]]

Latest revision as of 01:51, 5 June 2013


Zippy2-base.jpg

The Zippy2 Ethernet Combo Board (KSZ8851SNL-BBE-EVAL) is a low cost expansion board for the BeagleBoard that provides the following peripherals:

  • 10/100BaseT Ethernet
  • Second SD/MMC Interface
  • Second RS232 Serial Interface
  • Real-Time clock with Battery Back-up
  • I2C Interface (+5V level)
  • AT24C01 Serial EEPROM for Board Identification


The Zippy2 (KSZ8851SNL-BBE-EVAL) board was jointly developed by Micrel and TinCanTools (Company Website) and is available here. .


Hardware

Ethernet

The Zippy2 provides a standard 10/100BaseT (10/100 Mbit) Ethernet interface and uses Micrel's KSZ8851SNL SPI to Ethernet controller.

SD/MMC Interface

The Zippy2 provides a second SD/MMC interface that supports both 3.3V and 1.8V SD memory cards.

RS232 Serial Interface

The Zippy2 provides a second RS-232 serial port for the BeagleBoard: There are two serial connectors provided.

  • Standard DB9 Male connector
  • 2x5 shrouded header (0.1 inch pin spacing).

Real-time Clock

The Zippy2 provides a battery backed-up Real Time Clock (RTC) which uses the Maxim DS1307. The backup power is provided by a small 3V lithium coin battery and is held in place by a battery holder.

Compatible 3V Lithium Coin Batteries:

  • CR1216
  • CR1220
  • CR1225

Battery cell size = 12mm.

The battery is not included with the Zippy2 and must be purchased separately. Compatible batteries are available from Digi-Key:

Panasonic CR1216

Energizer CR1216


Installing the 3V lithium coin battery:

Zippy2-battery01.jpg

Insert the battery with the positive "+" side up.


Zippy2-battery2.jpg

Slide the battery all the way into the battery holder.

I²C Interface

The Zippy2 provides a 4-pin header expansion connector for access to the BeagleBoard's I²C signals. The signals have been level translated to 5V to allow easy connection to standard 5V peripherals.

I²C expansion header pin assignments:

  • pin 1 - +5V Power
  • pin 2 - SDA (5V signal level)
  • pin 3 - SCL (5V signal level)
  • pin 4 - Ground

Serial EEPROM

The Zippy2 provides an AT24C01 serial EEPROM that contains a Vendor ID and a Device ID that the BeagleBoard uses to identify the type of board connected to the expansion header. This information enables the BeagleBoard to auto-configure the pin mux for signals needed by the Zippy2. More information can be found on the Beagle Board Pin Mux Page.

Soldering BeagleBoard's Expansion Header

This is a quick guide showing you how to solder the 2x14 Header into the BeagleBoard’s Expansion connector (J3).

Zippy2-expansion connector1.jpg

Insert the 2x14 Header’s SHORT PINS from the back side of the BeagleBoard into the BeagleBoard’s expansion connector (J3).


Zippy2-expansion connector2.jpg

Position the 2x14 Header so the LONG PINS are on the BACK SIDE of the BeagleBoard.


Zippy2-expansion connector3.jpg

Solder the SHORT PINS of the 2x14 Header from the TOP SIDE of the BeagleBoard.

Attaching to the BeagleBoard

Zippy2-expansion connector7.jpg

Attach the four board spacers with the screws provided.


Zippy2-expansion connector4.jpg

Connect the expansion board onto the BACK SIDE of the BeagleBoard by mating with the 2x14 Header you just soldered. Make sure all of the pins align correctly.


Zippy2-expansion connector5.jpg

Continue pushing the two boards together until the connectors mate together.


Zippy2-expansion connector6.jpg

Attach the male standoffs as shown.


Zippy2-expansion connector8.jpg

Creating a bootable SD card in Ubuntu

This guide will demonstate how to create a dual-partition SD card for the BeagleBoard/Zippy2 combination to boot Linux from the first partition and have the root file system located on the second partition.

This guide covers the same procedure as SDCard setup and LinuxBootDiskFormat.

This guide will use a 2GB SD card for all examples.

Determine which device the SD Card Reader is on your system

Insert the SD Card into the SD Card Reader reader on your Linux PC. Then determine which device it is on your system:

dmesg | tail
...
[2079456.496092] sd 34:0:0:0: [sdb] Mode Sense: 03 00 00 00
[2079456.496096] sd 34:0:0:0: [sdb] Assuming drive cache: write through
[2079456.513743] sd 34:0:0:0: [sdb] Assuming drive cache: write through
[2079456.513751]  sdb: sdb1
[2079456.529193] sd 34:0:0:0: [sdb] Assuming drive cache: write through
[2079456.529201] sd 34:0:0:0: [sdb] Attached SCSI removable disk

In this case it shows up as /dev/sdb (note sdb insite the square brackets above).

Check to see if the automounter has mounted the SD Card:

df -h
Filesystem            Size  Used Avail Use% Mounted on
...                   1.8G     0  1.8G   0% /lib/init/rw
/dev/sdb1             1.9G     0  1.9G   0% /media/6262-9331
...

If mounted, unmount the SD card

umount /media/6262-9331

Start fdisk:

sudo fdisk /dev/sdb

Print the partition record:

  Command (m for help): p

  Disk /dev/sdb: 1967 MB, 1967128576 bytes
  57 heads, 56 sectors/track, 1203 cylinders
  Units = cylinders of 3192 * 512 = 1634304 bytes
  Disk identifier: 0x00000000

  Device Boot      Start         End      Blocks   Id  System
  /dev/sdb1            1        1204     1920955+   6  FAT16

Note card size in bytes listed above (in this example: 1967128576). Write this number down, it will be needed later below.

Delete any partitions that are already on the SD card

 Command (m for help): d
 Selected partition 1

Set the Geometry of the SD Card

Go into "Expert mode":

 Command (m for help): x

Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD card you are using:

  Expert command (m for help): h
  Number of heads (1-256, default 57): 255

  Expert command (m for help): s
  Number of sectors (1-63, default 56): 63
  Warning: setting sector offset for DOS compatiblity

  Expert command (m for help): c
  Number of cylinders (1-1048576, default 1203): 239

The 239 entered in the cylinders above must be calculated based upon the size of your particular SD card.

Now Calculate the number of Cylinders for your SD card:

number of cylinders = FLOOR (the number of Bytes on the SD Card (from above) / 255 heads / 63 sectors / 512 sector size in bytes )

So for this example: 1967128576 / 255 / 63 / 512 = 239.156427 (use Google to calculate). So we use 239 (i.e. truncate, don't round).

Return to "Normal" mode:

Expert command (m for help): r


Print the partition record to check your work:

 
 Command (m for help): p

 Disk /dev/sdb: 1967 MB, 1967128576 bytes
 255 heads, 63 sectors/track, 239 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Create the FAT32 partition for booting and transferring files from your PC

 Command (m for help): n
 Command action
    e   extended
    p   primary partition (1-4)
 p
 Partition number (1-4): 1
 First cylinder (1-15, default 1): 1
 Last cylinder or +size or +sizeM or +sizeK (1-239, default 239): 50

 Command (m for help): t
 Selected partition 1
 Hex code (type L to list codes): c
 Changed system type of partition 1 to c (W95 FAT32 (LBA))

We use 50 cylinders of the total of 239 for the FAT32 partition above. The remainder of the cylinders will be used for the Linux root file system below.

Mark this FAT32 partition as bootable:

Command (m for help): a
Partition number (1-4): 1

Create the Linux partition for the root file system

 Command (m for help): n
 Command action
    e   extended
    p   primary partition (1-4)
 ''p''
 Partition number (1-4): 2
 First cylinder (51-239, default 51): 51
 Last cylinder or +size or +sizeM or +sizeK (51-239, default 239): 239

Print the partition record to check your work

 
 Command (m for help): p

 Disk /dev/sdb: 1967 MB, 1967128576 bytes
 255 heads, 63 sectors/track, 239 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
 /dev/sdb1               1         50     1920955+   c  w95 FAT32 (LBA)
 /dev/sdb2              51         239               83 Linux

Save the new partition records on the SD card

This is an important step. All work up to now has been temporary.

  Command (m for help): w
  The partition table has been altered!
 
  Calling ioctl() to re-read partition table.
 
  WARNING: If you have created or modified any DOS 6.x
  partitions, please see the fdisk manual page for additional
  information.
  Syncing disks.

Format the partitions

  sudo mkfs.msdos -F 32 /dev/sdb1 -n boot
  mkfs.msdos 3.0.3 (18 May 2009)

  sudo mkfs.ext3 -L rootfs /dev/sdb2
  mke2fs 1.41.9 (22-Aug-2009)
  Filesystem label=rootfs
  OS type: Linuxsudo mkfs.ext3 -L rootfs /dev/sdb2
  mke2fs 1.41.9 (22-Aug-2009)
  Filesystem label=rootfs
  OS type: Linux
  Block size=4096 (log=2)
  Fragment size=4096 (log=2)
  95040 inodes, 379535 blocks
  18976 blocks (5.00%) reserved for the super user
  First data block=0
  Maximum filesystem blocks=390070272
  12 block groups
  32768 blocks per group, 32768 fragments per group
  7920 inodes per group
  Superblock backups stored on blocks:
	  32768, 98304, 163840, 229376, 294912

  Writing inode tables: done
  Creating journal (8192 blocks): done
  Writing superblocks and filesystem accounting information: done

Copy files onto the BOOT partition

You will need to download the demo/test files for the BeagleBoard/Zippy2 combination:

  1. MLO (save as MLO)
  2. u-boot.bin (save as u-boot.bin)
  3. uImage (save as uImage)
  4. test.rootfs.tar.gz (save as test.rootfs.tar.gz)


And now copy the first three files onto the boot partition (IMPORTANT: Copy MLO FIRST! because of a bug in the X-loader which causes problems if MLO is not the first file written onto the boot partition).

 cp MLO /media/boot/MLO
 cp u-boot.bin /media/boot/u-boot.bin
 cp uImage /media/boot/uImage

Copy the files onto the Linux partition

The next step is to extract the files in test-rootfs.tar.gz into the rootfs partition (NOT the boot partition) on the SD card. This can only be done by using Linux.

 sudo tar -zxvf test-rootfs.tar.gz -C /media/rootfs

Unmount the SD card from the Linux PC and insert it into the BeagleBoard's SD connector.

Then boot your BeagleBoard while holding down the "User" button.

Automated script to create a bootable SD card

The following script will create a formatted SD card using your Linux PC.

Make a working directory for the files: mksdcard.sh, MLO, u-boot.bin, uImage, and test-rootfs.tar.gz and copy them into it.

You will also need to make two mount points:

 mkdir /mnt/sdcard1
 mkdir /mnt/sdcard2

Then from inside the working directory you created above, issue the command like this:

 ./mksdcard.sh /dev/sdb

Where /dev/sdb is the drive for the SD card.

This should generate a fresh bootable SD card for you!

Design Documents

The following are the design documents for the Zippy2 (KSZ8851SNL-BBE-EVAL) board:

Software Links

The latest Linux driver for the KSZ8851SNL is included in the mainline Linux kernel and can be downloaded here:

http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.7.tar.bz2

Also, Linus' GIT repo can be pulled from here:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary

Or you can view just the driver:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/net/ks8851.c;h=6d3ac65bc35cfcd1ae3eb27e6249a8be38efe705;hb=HEAD

Programming the Zippy2

All of the devices on the Zippy2 work as standard linux devices which means any reference material for these devices is applicable:

How to access the I2C bus (from software): http://i2c.wiki.kernel.org/index.php/Linux_2.6_I2C_development_FAQ

How to access the second UART: http://tldp.org/HOWTO/Serial-HOWTO.html and http://www.vanemery.com/Linux/Serial/serial-console.html

How to use and configure the Ethernet port: http://tldp.org/HOWTO/Ethernet-HOWTO.html

How to access the SD card: If you are using the Angstrom images, then all you have to do is insert the SD card and it will be automatically mounted. To check just issue the command "mount" at the prompt to view the currently mounted devices.


To set the real time clock (RTC) on the Zippy2 board:

First: Set the date:

 date -s 2010.02.15-17:52

(date -s YYYY.MM.DD-HH:SS (the time HH:SS is in 24 hour format)

Then write the current date into the RTC's hardware registers:

 hwclock -w

As long as you have a good backup battery (the small coin battery), the RTC should keep the time correct even if you remove power and boot-up the BeagleBoard at a later time.

Where to purchase the Zippy2 (KSZ8851SNL-BBE-EVAL)

The Zippy2 can be purchased from TinCanTools.com (USA) and watterott.com (Germany)