eleckits real6410 linux development manual
DESCRIPTION
ElecKits Real6410 Linux Development ManualTRANSCRIPT
S3C6410 Linux Development manual
Ver 2.0Date: 2011-01-05
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Change History
Rev Date DescriptionV1.0 2010-5-20 The initial released VersionV1.1 2010-10-7 change the cross compile tools install bugV2.0 2011-1-5 for the Real6410 v4.0 version board
For the new version user manual and source code, you can download from thefollow website:
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Catalogue
Real6410 Linux Development manual............................................. 1Catalogue ........................................................................................ 3Chapter 1 Overview........................................................................ 5
1.1 OverView ............................................................................... 51.2 Resource Allocation............................................................... 5
Chapter 2 Linux burning .................................................................. 72.1 Burning bootloader ................................................................ 7
2.1.1 Create SD boot card ....................................................... 72.1.2 Burning the image into flash by SD card......................... 8
2.2 Burning Linux kernel ............................................................ 112.3 Burning cramfs..................................................................... 112.4 Burning QT system(ubifs) .................................................... 11
Chapter 3 Uboot compile............................................................... 143.1 Uboot configure ................................................................... 143.2 Uboot compile...................................................................... 14
Chapter 4 Linux kernel compile..................................................... 154.1 kernel compile...................................................................... 154.2 Kernel comfigure.................................................................. 15
4.2.1 Touchscreen configure.................................................. 164.2.1 Keyboard configure ....................................................... 164.2.3 Audio configure ............................................................. 174.2.4 MMC/SD........................................................................ 174.2.5 Nandflash configure ...................................................... 194.2.6 LCD/VGA configure....................................................... 194.2.7 Etherne configure.......................................................... 204.2.8 WIFI configure............................................................... 204.2.9 usb OTG configure........................................................ 214.2.10 Camera ....................................................................... 224.2.11 GPRS configure .......................................................... 24
4.2.13 USB HOST configure...................................................... 254.2.14 CAN configure ................................................................ 254.2.15 3G driver configure ......................................................... 25
Chapter V File System Development ............................................ 26Chapter VI Media encode and decode test ................................... 27
6.1 Run the TEST program........................................................ 276.2 H264 Test ............................................................................ 276.3 H263 TEST .......................................................................... 286.4 MPEG4 TEST ...................................................................... 296.5 VC-I decode TEST............................................................... 306.6 four window TEST ............................................................... 306.7 camera and MFC encode TEST .......................................... 316.8 MFC Decode TEST ............................................................. 316.9 camera in and JPEG encode TEST..................................... 32
Real6410 Linux Development manual
6.10 JPEG decode TEST .......................................................... 326.11 H264 encode and TV OUT TEST ...................................... 336.12 MFC encode and TV-OUT TEST....................................... 33
Appendix A DNW software configuration ...................................... 34Appendix B USB driver install ....................................................... 35Appendix C Cross compile tools install ......................................... 38
C-1 Uncompress the tools ......................................................... 38C-2 Add Path in your environment file ....................................... 38C-3 Check the tool-chain path to see if it is set up correctly ornot.............................................................................................. 38
Real6410 Linux Development manual
Chapter 1 Overview
1.1 OverView
• Boot loader◦ verison: s3c-u-boot-1.1.6◦ Function: support boot and update system by SD card and USB
• Linux kernel◦ verison: s3c-Linux-2.6.28.4◦ Compile: arm-none-linux-gnueabi-4.3.2◦ Function: support MFC, Jpeg encode, 2D/3D
• Device Driver◦ TFT LCD/Touchscreen, Audio I/O, MMC/SD card, NET, USB host, USB
OTG, Serial port◦ watchdog, RTC, Power Manage, matix keybad, button, i2c, spi, ADC◦ WIFI, GPS, GPRS, Camera
• File System support◦ ubifs/yaffs2/cramfs/fat32
• Gui support◦ qtopia-2.2.0◦ QtE-4.5.2
1.2 Resource Allocation
• Physical Address Allocation
Address begin Address end Size(MB) Description
0x0000_0000 0x07FF_FFFF 128 boot image
0x0800_0000 0x0BFF_FFFF 64 Internal ROM
0x0C00_0000 0x0FFF_FFFF 64 Stepping Stone(8KB)
0x1000_0000 0x17FF_FFFF 128
0x1800_0000 0x1FFF_FFFF 128 DM9000AEP
0x2000_0000 0x27F_FFFF 128 NAND(256M/1024M)
0x2800_0000 0x2FFF_FFFF 128
0x3000_0000 0x37FF_FFFF 128
0x3800_0000 0x3FFF_FFFF 128
0x4000_0000 0x47FF_FFFF 128
0x4800_0000 0x4FFF_FFFF 128
0x5000_0000 0x5FFF_FFFF 256 DDR(128M/256M)
0x6000_0000 0x6FFF_FFFF 256
Real6410 Linux Development manual
1.3 boot mode
Set the boot mode switch code.boot mode / Pin 1 2 3 4 5 6 7 8SD card boot OFF OFF OFF OFF OFF OFF OFF OFFNand flash boot mode OFF OFF OFF OFF OFF ON ON OFF
Real6410 Linux Development manual
Chapter 2 Linux burning
The Linux image contains 3 parts, namely bootloader, kernel, rootfs, this chapter willintroduce the method to burning the image to the board.The Address for the parts was as follow:
Name Address Range size detailsbootloader 0x00000000~0x0003FFFF 256KB for uboot imagekernel 0x00040000~0x003FFFFF 3.75MB for linux kernel image
cramfs 0x00400000~0x007FFFFF 4MB for cramfs formatfilesystem(download ubifs)
Ubifs 0x00800000~0x3FFFFFFF 248MB for ubifs format filesystem
Preparations for burning:• link the serial line from PC to the board UART0,• link the Power to the board• link the usb cable from PC to the board
(About the board interface, please refer to the Appendix B Board interfaceof the <hardware user manual>)
• Open the DNW software, and configure it(refer to the Appendix A DNWsoftware configuration)
2.1 Burning bootloader
2.1.1 Create SD boot card
(1) Insert the SD card to USB reader under WinXP, and format the SD card toFAT32 format.(2) Run the IROM_Fusing_Tool.exe tools,the tools position:\tools\SDboot\IROM_Fusing_Tool.exe
Real6410 Linux Development manual
3) burn bootloader• Click “Browse”, add the file uboot_mmc.bin,
The file position: \tools\SDboot\uboot_mmc.bin• select SD card in SD/MMC Drive under tools.• Click “START”
After burning the image successfully, there will be a pop-up windows “Fusing imagedone”, Click “Ok” to finish creating the SD card.
2.1.2 Burning the image into flash by SD card
1) Insert the SD card to the Real6410.2) Set the board for SD boot mode
• set the digital switch to boot from SD mode as follow:boot mode / Pin 1 2 3 4 5 6 7 8
Real6410 Linux Development manual
SD card boot OFF OFF OFF OFF OFF OFF OFF OFFNand flash boot mode OFF OFF OFF OFF OFF ON ON OFF
3) Power on the board, then the DNW will print the message, Press space button toenter the download mode.
4) Input your LCD type, such as we input "1" for 4.3"LCD, then it will print thedownload option and let you input the selection, it is the uboot download mode.# Enter Your Selection:
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
5) Format nand flash, run the follow command in the download mode, "f -y"command line.# Enter Your Selection: f
6) Input "u" in the Download mode# Enter Your Selection: uNotice: It need the usb download driver, if you don't install it, you should install it.The USB download driver position: CD\tools\usb driver\usb DNW driverYou can refer the chapter (Appendix B USB driver install) to install it
7) In the DNW menu, Click "USB Port->Transmit-> Transmit", then chooseuboot.bin file.u-boot.bin file position: CD\tools\SDboot\u-boot.bin
Real6410 Linux Development manual
8) Then the uboot will be burned in the Nand flash.
2.2 Burning Linux kernel
1) In the uboot download mode, input "k" to download the kernel to flash:# Enter Your Selection: k
2) In the DNW menu, Click "USB Port->Transmit-> Transmit", thenchoose zImage file.zImage file position: CD\linux\Image\zImage
3) Then the Linux kernel will be burned in the Nand flash.
2.3 Burning cramfs
The cramfs burning is only for burnning the QT system.1) Enter the uboot download mode, input "c" to download the kernel to flash:
# Enter Your Selection: c
2) In the DNW menu, Click "USB Port->Transmit-> Transmit", thenchoose root_mkfs.cramfs file.root_mkfs.cramfs file position: CD\linux\Image\root_mkfs.cramfs
3) Then the cramfs will be burned in the Nand flash.
2.4 Burning QT system(ubifs)
1) copy the qtopia.tar.gz file to the SD card or usb disk, and link the Sd card or usbdisk to the board.qtopia.tar.gz file position: CD\linux\Image\qtopia.tar.gz
2) Enter the uboot download mode, input "q" to download the kernel to flash, then itwill download the filesystem to flash.
# Enter Your Selection: q
Real6410 Linux Development manual
2) If it shows as follow picture, it means success for burning.
3) then you can calibrate your touchscreen in the lcd.
4) then you can set the digital switch to boot from Nand boot mode as follow:
Real6410 Linux Development manual
boot mode / Pin 1 2 3 4 5 6 7 8SD card boot OFF OFF OFF OFF OFF OFF OFF OFFNand flash boot OFF OFF OFF OFF OFF ON ON OFFYou can boot the system to enter the qt system from nand flash.
Note: If you want to calibrate the touchscreen for qt, you can input "T" in ubootdownload mode to calibrate the touchscreen,
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Chapter 3 Uboot compile
You should install the cross compile tools(arm-none-linux-gnueabi-4.3.2 with EABI)before you compile the uboot, if you don't install it, please install it refer tothe Appendix C Cross compile tools install
3.1 Uboot configure
copy the file s3c-u-boot-1.1.6-Real6410.tar.bz2 From CD to ubuntu system in PC.s3c-u-boot-1.1.6-Real6410.tar.bz2 position: CD\linux\code
# mkdir bootloader# cd bootloader# cp -a /media/cdrom/linux/code/s3c-u-boot-1.1.6-Real6410.tar.bz2 .# tar xvf s3c-u-boot-1.1.6-Real6410.tar.bz2# cd s3c-u-boot-1.1.6-Real6410
Then we can get the s3c-u-boot-1.1.6-Real6410 folders in bootloader folder, runthe command to configure it:
# make distclean# make smdk6410_config
3.2 Uboot compile
We can get the uboot image for different boot mode image, SD card boot and Nandflash boot image.
Compile the uboot image for Nand flash boot:# ./make_nand_image
If there is no error, u-boot.bin should have been generated with a file size of about
130~150Kbyte. you can get it in bootloader/s3c-u-boot-1.1.6-Real6410 folder
Compile the uboot image for SD card boot:#./make_mmc_image
If there is no error, u-boot_mmc.binu-boot_mmc.bin should have been generated with a file size of about
130~150Kbyte. you can get it in bootloader/s3c-u-boot-1.1.6-Real6410 folder.
Real6410 Linux Development manual
Chapter 4 Linux kernel compile
You should install the cross compile tools(arm-none-linux-gnueabi-4.3.2 with EABI)before you compile the uboot, if you don't install it, please install it refer tothe Appendix C Cross compile tools install
4.1 kernel compile
copy the file s3c-linux-2.6.28.6-Real6410.tar from CD to ubuntu system in PC.s3c-linux-2.6.28.6-Real6410.tar.bz2 position: CD\linux\code
# mkdir kernel# cd kernel# cp -a /media/cdrom/linux/code/s3c-u-boot-1.1.6-Real6410.tar.bz2 .# tar xvf s3c-linux-2.6.28.6-Real6410.tar.bz2# cd s3c-linux-2.6.28.6-Real6410
Then we can get the s3c-linux-2.6.28.6-Real6410 folders in kernel folder, runthe command to configure it:
# make distclean# cp Real6410_3d.config .config
Note: RReal6410_3d.config was the configure file that can support 3D test.Real6410_3d.config ------ configure file can support 3D testReal6410_osd.config ------ configure file can support multiple lcdtest
Compile the kernel image :# make
If you can build kernel successfully, you will have "arch/arm/boot/zImage" .
4.2 Kernel comfigure
If we want to configure the kernel driver by ourself, please refer the folow step:we will use the make xconfig to configure the kernel, run the follow command to enter the configuremenu.
# cd kernel/s3c-linux-2.6.28.6-Real6410# make xconfig
Real6410 Linux Development manual
4.2.1 Touchscreen configure
4.2.1 Keyboard configure
a) enter inout device support then configure it.
b) enter the keyboards, configure
Keyboard driver positon: drivers/input/keyboard/ s3c-gpio_keys.c
Real6410 Linux Development manual
Test metod:Can test it with the application: linux\Applications\keyboard in the CD.
4.2.3 Audio configure
enter "Sound card support ", choose
enter "ALSA for SoC audio support"
we use the WM9713 chips.audio driver postion: sound/soc/s3cTest metod:Run the command in the linux command line by serial:
#madplay /root/Documents/Innocent.mp3
4.2.4 MMC/SD
choose the channel using in System Type->SMDK6410->SMDK6410 MMC/SD slotSetup
Real6410 Linux Development manual
Choose the channel 0 and channel 1, the channel 0 was used by wifi module, andthe channel 1 was used by SD card.configure it as follow:
Mmc driver position: drivers/mmc/host/sdhci-s3c.cTest method:run the command:# ls /dev/mmcblk0If it can be found, it means the sd card have been found, run the follow command:# mount –t vfat /dev/mmcblk0 /mnt/sdcard# ls /mnt/sdcard
Real6410 Linux Development manual
4.2.5 Nandflash configure
nand driver position: drivers/mtd/nand/s3c_nand.c
4.2.6 LCD/VGA configure
We provide different LCD for the board, you can choose it as :
The LCD will be set in uboot, in uboot configure is as follow;7"LCD: video=fb:AT070TN83
5"LCD: video=fb:HSD050
4.3"LCD: video=fb:WX4300F
VGA: video=fb:VGA800x600
such as the 4.3"LCD uboot param is as follow:setenv bootargs noinitrd root=/dev/mtdblock0 console=ttySAC0 init=/linuxrc video=fb:WX4300F
Real6410 Linux Development manual
4.2.7 Etherne configure
We use the DM9000 chips in our board.
Ethernet positon: drivers/net/dm9000.c
4.2.8 WIFI configure
a) 802.11 support;
b)WIFI driver support
Real6410 Linux Development manual
We compile "Marvel Libertas 8385 and 8686 SDIO 802.11 b/g cards" in kernel.TEST method:
1) boot the board, Run the follow command, then you will find the WiFi AP.# ifconfig eth1 up# iwlist eth1 scanning
then you will get the follow message:
Then it means the WiFi is ok. if you want to link the website, you should usethe wpa_supplicant, we don't provide the method about the wpa_supplicant using.
4.2.9 usb OTG configure
The board OTG can be set as USB Host,
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
4.2.10 Camera
It support two camera module, OV9650(130W) and OV3640(300W), you canconfigure it by your module.
a) Configure the I2C
Real6410 Linux Development manual
b) configure the CameraIf you use the OV9650(130W camera), configure as that:
Note the camera insert method;
Test method:Run the command to test the board:# cam2fb /dev/video0or run the follow command to capture the picture.# v4l2grab -d /dev/video0 -o figo.jpg -q 70 -m -W 640 -H 480
Real6410 Linux Development manual
4.2.11 GPRS configure
GPRS use the uart1 to link the board, only the serial support is ok, so default theserial is ok, we don't need to configure it.
4.2.12 GPS configureGPS use the uart2 to link the board, only the serial support is ok, so default the serialis ok, we don't need to configure it.
run the command :# gps_test2Then it will show that:
Real6410 Linux Development manual
If You GPS baudrate is 9600, run the follow command:# gps_test2 4800
4.2.13 USB HOST configure
4.2.14 CAN configure
It use the MCP2515 to change the SPI to CAN bus.configure as that:
Then in the board, it will show the inode: /dev/mcp2515
4.2.15 3G driver configure
We use the 3G module, MC2716.configure as that:In USB-> USB serial Convert support
Real6410 Linux Development manual
Chapter V File System Development
The file “qtopia.tar.gz” was the filesystem, and we can edit it and then compress it.qtopia.tar.gz position: CD\linux\Image
Run the follow command to uncompress it and make it.
Step 1. Uncompress the file# mkdir root_qtopia# cd root_qtopia# cp -a /media/cdrom/linux/image/qtopia.tar.gz .# tar xvf qtopia.tar.gz
Step 2. According to your needs, add or remove some file from the root filesystemin the root_qtopia folders, then run the follow command to make the rootfilesystem.# tar –zcvf qtopia.tar.gz *
Then you can find the Linux root filesystem in the folder: qtopia.tar.gz
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Chapter VI Media encode and decode test
When run the media test, you't better kill the qt program, or it will have some conflict.
6.1 Run the TEST program
run the command in the board linux command line in serialcd /usr/local/multimedia_test_real6410./ multimedia_test_43 (if you test it with 4.3 "LCD)./ multimedia_test_70 (if you test it with 4.3 "LCD)
Then it will show:
6.2 H264 Test
Input "1"
Real6410 Linux Development manual
Then it will show:
6.3 H263 TEST
Input "2"
Then it will show:
Real6410 Linux Development manual
6.4 MPEG4 TEST
Input "3"
Then it will show:
Real6410 Linux Development manual
6.5 VC-I decode TEST
Input "4"
Then it will show:
6.6 four window TEST
Input "5"
Then it will show:
Real6410 Linux Development manual
6.7 camera and MFC encode TEST
Input "6"
Then it will show:
6.8 MFC Decode TEST
Input "7"
Then it will show:
Real6410 Linux Development manual
6.9 camera in and JPEG encode TEST
Input "8"
Then it will show:
6.10 JPEG decode TEST
Input "9"
Real6410 Linux Development manual
Then it will show:
6.11 H264 encode and TV OUT TEST
Input "10"
6.12 MFC encode and TV-OUT TEST
Input "11"
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Appendix A DNW software configuration
1.Find DNW software under directory CD:\Tools\DNW.exe. Double-click to open it:
2. Click “Configuration -> Options”, it will open the “UART/USB Options” dialog.• choose '115200' in 'Baud Rate'• choose 'COM1' in 'COM Port '(the COM1 means the serial number in PC )
click 'OK' to finish the DNW configuration:
3.Then Click 'Serial Port->connect' to enable the DNW serial link.
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Appendix B USB driver install
The following steps introduce how to install USB download-driver. The driver islocated under the directory “CD:/tools/usb driver/usb DNW driver/”:
1. Windows XP can recognize the new device automatically, it will show thefollow message, choose "No, not this time", then click 'Next'. (figure B.1)
2.figure B.1
3. Then choose "Install from a list or specific location[Advanced]", thenclick "Next". (figure B.2)
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
figure B.24. Then in the option “Search for the best driver in these locations”, input the
usb driver path “CD:/tools/usb driver/usb DNW driver/”, thenclick "Next". (figure B.3)
figure B.35. Then it will install the usb driver, maybe it have the different message in your
PC, but you should make sure that the usb driver is this path: “CD:/tools/usb driver/usb download driver/”
6. If the DNW staus show the USB:OK, it means that the driver will be installedsuccessfully.(figure B.4)
Real6410 Linux Development manual
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com
Appendix C Cross compile tools install
C-1 Uncompress the tools
Copy the arm-2008q3.tar.bz2 to /root/ folderarm-2008q3.tar.bz2 position: CD:/linux/code
# cd /root# sudo cp /media/cdrom/linux/code/arm-2008q3.tar.bz2 .# sudo tar xvf arm-2008q3.tar.bz2Then we can get the folder :arm-2008q3 in the /root/
C-2 Add Path in your environment fileC-2 Add Path in your environment file
Modify your ~/.bashrc file to add a new path with editor (gedit or vi)
PATH=$PATH:/root/arm-2008q3/bin
To apply this change, login again or restart the .bashrc
# source .bashrc
C-3 Check the tool-chain path to see if it is set up correctly or notC-3 Check the tool-chain path to see if it is set up correctly or not
~$ arm-none-linux-gnueabi-gcc -vUsing built-in specs.Target: arm-none-linux-gnueabiConfigured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linuxgnu--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disablelibmudflap--disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enablelanguages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --withpkgversion='Sourcery G++ Lite 2008q3-72' --withbugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-buildsysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --withgmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pcReal6410linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-nonelinux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --withbuild-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-buildtime-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/binThread model: posixgcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)
Real6410 Linux Development manual
Real6410 Linux Development manual
ElecKits Technologies StudioE-Mail: [email protected] SkyPe: eleckits2011Website: http://www.eleckits.com