Wednesday, October 28, 2009

Beagle Board Accessories

These are optional accessories for beagle board

http://www.elinux.org/BeagleBoard_Zippy
This is a modified type of beagle board with internet expansion. one can connect the LAN cable directly to the beagle board instead of using a usb hub. It adds the following to the orignal beagle board:
  • Battery Backed RTC
  • Second MMC slot
  • 10BaseT Ethernet
  • Second RS-232
  • +5V level I2C
  • AT24 EEPROM

http://gumstix.com/store/catalog/product_info.php?products_id=195
This is a raw LCD which can be used for the beagle board as a display device. It enables a user to use the beagle board without a monitor or a pico projector. Instructions for attaching a raw LCD panel to beagle board: http://elinux.org/BeagleBoardRawLCD

http://www.dealextreme.com/details.dx/sku.3060
This is a rechargeable emergency USB battery back-up that can be used to power the beagle board. In this way, beagle board can be powered without connecting a USB power cable. It can also be used where there is no power outlet nearby such as outdoors.

http://www.cambrionix.com/home/index.php?option=com_content&view=article&id=17&Itemid=2
This is a 49-port USB hub that can be used on Beagle Board for using a large number of accessories such as USB keyboard, mouse, wiimote, bluetooth dongle, USB flash drive, USB card reader/writer, External USB hard drive.

Monday, October 26, 2009

Angstrom Demo

Download Files:
http://www.angstrom-distribution.org/demo/beagleboard/Angstrom-Beagleboard-demo-image-glibc-ipk-2009.X-stable-20090612--beagleboard.rootfs.tar.bz2
http://www.angstrom-distribution.org/demo/beagleboard/MLO
http://www.angstrom-distribution.org/demo/beagleboard/u-boot.bin
http://www.angstrom-distribution.org/demo/beagleboard/uImage-2.6.29-r47-beagleboard.bin
http://www.angstrom-distribution.org/demo/beagleboard/x-load.bin.ift

In order to make Angstrom Image:
1) Insert the sd card in the computer and unmount it auto-mounted
$ sudo umount /dev/sdb
2) Zero out the SD card
$ sudo dd if=/dev/zero of=/dev/sdb bs=822906
3) Start fdisk, and partition
$ sudo fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdc: 2021 MB, 2021654528 bytes
255 heads, 63 sectors/track, 245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): x
Expert Command (m for help): h
Number of heads (1-256, default xxx): 255

Expert Command (m for help): s
Number of sectors (1-63, default xxx): 63

NOTE: In order to calculate the number of cylinders:

the number of Bytes on the SD Card (from above) / 255 / 63 / 512


Expert Command (m for help): c
Number of cylinders (1-256, default xxx): [enter the number you calculated]

Command (m for help): n
Command action
e extended
p primary partition
(1-4)
p
Partition number (1-4): 1
First cylinder (1-245, default 1): [(press Enter)]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-245, default 245): +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))

Command (m for help): a
Partition number (1-4): 1
Command (m for help): n
Command action
e extended
p primary partition
(1-4)
p
Partition number (1-4): 2
First cylinder (52-245, default 52): [(press Enter)]
Using default value 52
Last cylinder or +size or +sizeM or +sizeK (52-245, default 245): [(press Enter)]
Using default value 245
Command (m for help): p

Disk /dev/sdc: 2021 MB, 2021654528 bytes
255 heads, 63 sectors/track, 245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 51 409626 c W95 FAT32 (LBA)
/dev/sdc2 52 245 1558305 83 Linux
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.

WARNING
: If you have created or modified any DOS 6.x
partitions
, please see the fdisk manual page for additional
information
.
Syncing disks.

4) Format the partitions
$ sudo mkfs.msdos -F 32 /dev/sdc1 -n Beagle_Boot
mkfs
.msdos 2.11 (12 Mar 2005)
$ sudo mkfs.ext3 -L Angstrom_Demo /dev/sdc2
mke2fs
1.40-WIP (14-Nov-2006)
Filesystem label=
OS type
: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
195072 inodes, 389576 blockshttp://www.angstrom-distribution.org/demo/beagleboard/x-load.bin.ift
19478 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=402653184
12 block groups
32768 blocks per group, 32768 fragments per group
16256 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:


5)
Unplug, and replug in your SD card, and it should now automount the two partitions that you created.

6) Copy files in the Beagle_Boot partition
$ sudo cp MLO /media/card/
$ sudo cp u-boot.bin /media/card/
$ sudo cp uImage-2.6.29-r47-beagleboard.bin /media/card/uImage
$ sudo cp x-load.bin.ift /media/card/
7) Untar the file system
$ sudo tar -xvjf /media/Angstrom_Demo/Angstrom...bz2
8) Unmount the partitions
$ sudo umount /dev/sdb1
$ sudo umount /dev/sdb2
Running the demo:
1) start a terminal program: Minicom or Tera Term
2) insert the SD card in the beagle board
3) power on the beagle board
4) stop the auto-boot by pressing Enter
5) type the below commands
mmcinit
fatload mmc 0 0x80200000 x-load.bin.ift
nandecc hw
nand erase 0 80000
nand write.i 0x80200000 0 80000
6) Set the Environment

setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait omapfb.mode=dvi:1024x768MR-16@60'
FOR PICO: setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait omapfb.mode=dvi:640x480MR-16@60'
setenv bootcmd 'mmcinit; fatload mmc 0 0x80300000 uImage; bootm 0x80300000'
saveenv
7) Boot the SD card
boot

Friday, October 16, 2009

Gnome Demo

In order to make gnome demo work on beagle board,
1) download the required files from http://www.sakoman.com/component /option,com_phocadownload/Itemid,60/id,1/view,category/
2)Prepare a bootable SD card. Instructions for making a bootable SD card: http://www.sakoman.com/OMAP3/preparing-a-bootable-sd-card.html.

In order to run this demo on Beagle Board:
1)Insert the mmc card in the beagleboard.
2)Connect LCD monitor using a DVI-D cable.
3)Connect the beagle board to a pc using a serial cable, and use minicom to talk to the board.
4)Start Minicom
5)Power on the Beagle Board.
6)Stop the autoboot by pressing any key.
7)Set the environment:
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 omapfb.vram=1:4M,2:4M omapfb.mode=dvi:1024x768-16@60'
For Pico Projector: setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 omapfb.vram=1:4M,2;4M omapfb.mode=dvi:640x480MR-16@60'
setenv bootcmd 'mmcinit; fatload mmc 0 0x80300000 uImage; bootm 0x80300000'

8)boot
9)Enjoy!!!

This Image includes:
1)Gnome root file system
2)Basic system preferences and configuration applets
3)Web browser, email, and chat applications
4)Word processor, spreadsheet, graphics, photo, and PDF viewing applications
5)Media player with DVD playback
6)Gnome games
7)Calculator applet
8)Disk usage analyzer and log file viewing tools
9)Command line package manager (opkg)

Monday, October 12, 2009

Beagle Board Recovery

These instructions were derived from
1. http://code.google.com/p/beagleboard/wiki/BeagleboardRevCValidation
2. http://www.sakoman.com/OMAP3/preparing-a-bootable-sd-card.html

FIXING BEAGLE BOARD (restore to factory setting)
------------------------------------------------
1) Make a partition in the mmc card. Use these commands. Make sure that you
have unmounted the SD card before continuing.
$ sudo fdisk /dev/sde
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)
Command (m for help): p

Disk /dev/sde: 2032 MB, 2032664576 bytes
64 heads, 63 sectors/track, 984 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0x00aa8e5c

Device Boot Start End Blocks Id System

NOTE: In order to calculate the # of cylinders, take the # of bytes reported above and use this formula: 2064384/#ofHeads/#ofSectors/bytes_per_sector and round the result

Command (m for help): x
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 984): 247
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-247, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-247, default 15): +247M
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))
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p

Disk /dev/sde: 2032 MB, 2032664576 bytes
255 heads, 63 sectors/track, 247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00aa8e5c

Device Boot Start End Blocks Id System
/dev/sde1 * 1 5 40131 c W95 FAT32 (LBA)

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.
# sudo mkfs.vfat -F 32 /dev/sde1 -n FAT
mkfs.vfat 2.11 (12 Mar 2005)


2) Download the files listed below and save them to a working directory. For these steps assume /home//temp. NOTE: replace with your user
account.
$ mkdir /home//temp
FILES to Download
1. MLO as MLO
2. u-boot as u-boot.bin
3. u-boot for flash as u-boot-f.bin
4. ramdisk image as ramdisk.gz
5. Kernel (uImage) as uImage.bin
6. reset.scr as boot.scr
7. x-loader image as x-load.bin.ift
8. Regular script file as normal.scr

3) Mount the SD card partition. i.e.
$ sudo mkdir /media/card
$ sudo mount /dev/sdb1 /media/card

4)Copy the following files in correct order: MLO, u-boot.bin, u-boot-f.bin, ramdisk.gz, uImage.bin, boot.scr, x-load.bin.ift, normal.scr
$ cd /home//temp
$ sudo cp MLO /media/card/
$ sudo cp u-boot.bin /media/card/
$ sudo cp u-boot-f.bin /media/card/
$ sudo cp ramdisk.gz /media/card/
$ sudo cp uImage.bin /media/card/
$ sudo cp boot.scr /media/card/
$ sudo cp x-load.bin.ift /media/card/
$ sudo cp normal.scr /media/card/

5) Un-mount the SD Card
$ cd /media
$ sudo umount /media/card

6) While power is not connected to the beagleboard insert the SD card.

7) Press and hold the USER BUTTON (the one closest to the edge of the board)
and connect the power to the board while still holding the user button.

8) Once the board boots and you see the boot delay you can release the user
button. Continue to let the board boot. The scripts on the SD card
should restore the NAND flash.

9) Once the restore has finished you should be able to power off the
beagleboard, remove the SD card, and power the board back on. You
should see the board boot into u-boot from NAND.

NOTE: I did see some errors when writing the uImage and ramdisk.gz files to the NAND. Inspite of those error messages, beagle board is restored to factory settings.

Additional Resources can be found at:
http://www.elinux.org/BeagleBoardRecovery

Tuesday, October 6, 2009

FM radio on beagle board



Beagle Board is connected to FM receiver, Bluetooth adapter, WiFi. This beagle board has android running in it. You can also listen to FM radio on this board.
This image was made by 0xlab
Some info about 0xlab can be found at http://groups.google.com/group/0xlab-discuss?pli=1
0xLab used broadcom 4325 chip with FM radio function and put that chip on their development board connected through a USB cable.

Debug Linux Applications

http://tiexpressdsp.com/index.php/Linux_Aware_Debug

This link provides help for debugging embedded applications running on a linux environment. This link also talks about different types of debugs such as thread level debug and kernel module debug. It also has help for Code Composer Studio v4, which is a useful tool for debugging TI processors. You can find information on downloading and using CCSv4 for free at http://tiexpressdsp.com/index.php/Category:Code_Composer_Studio_v4.