DM8148 开发记录 四
来源:互联网 发布:广域网优化技术 编辑:程序博客网 时间:2024/05/16 15:28
Starting with TI EZSDK C6A816x – Video Tutorial
This tutorial is useful for Hardware and Software engineers.
For HW engineers it demonstrates how to build Linux for a board and Software engineers will find here some useful commands for using TI EZSDK.
Before you start – install TI EZSDK as described in this post:
TI EZSDK Installation Tutorial for DM816x / C6A816x / AM389x / DM814x / AM387x
Content
BOOTING THE BOARD from Network, SD or NAND
Running Kernel and File system from network
Booting from SD CARD
Booting from NAND
FLASHING UBoot
Flashing u-Boot to NAND
Flashing u-Boot to SPI
USING JTAG to FLASH UBOOT INTO NAND
PREPARING THE BINARY FILES (UBOOT, KERNEL, FILE SYSTEM)
U-Boot compilation
Kernel compilation
File system
Other useful things …
Using GPIO
UBOOT: Set different serial port in U-Boot for console output
UBOOT: Add support for recognision of an unsupported Winbond SPI memory chip
General notes:
Always check/update IP address which is used in many commands of this tutorial. The address should be the same as IP address of your linux Machine with EZSDK installed on it. Check host IP address by command: ifconfig
Always check console number. Some boards use a different serial port for console output e.g ttyO0, ttyO2 (default for EZSDK), …
Always check file size after TFTP transfer. If needed, adjust the size which is used in many commands in case the image is being flashed into memory
***********************************************
BOOTING THE BOARD from Network, SD or NAND
***********************************************
Running Kernel and File system from network
——————————————
Prepare Kernel image
Follow the steps in: Kernel compilation
Booting from Linux EZSDKdhcp
setenv bootcmd 'run addip;tftp 81000000 uImage;bootm'
setenv hostname KDS01
setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off'
setenv autoload no
setenv nfsserver 192.168.0.22
setenv bootargs 'console=ttyO2,115200n8 root=/dev/nfs nfsroot=192.168.0.22:/home/vmplanet/targetfs,nolock rw mem=128M rootdelay=4 notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:16M,1:16M,2:6M'
setenv serverip 192.168.0.22
saveenv
One line command (Ready for Copy & Paste):dhcp;setenv bootcmd 'run addip;tftp 81000000 uImage;bootm';setenv hostname KDS01;setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off';setenv autoload no;setenv nfsserver 192.168.0.22;setenv bootargs 'console=ttyO2,115200n8 root=/dev/nfs nfsroot=192.168.0.22:/home/vmplanet/targetfs,nolock rw mem=128M rootdelay=4 notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:16M,1:16M,2:6M';setenv serverip 192.168.0.22;saveenv
Booting from SD CARD
—————–
Prepare uBoot MLO
Follow the steps in: U-Boot compilation – SD mincp u-boot.min.sd MLO
cp MLO /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/host-tools/
Prepare uBoot for NAND or SPI (depends what memory you would like to use to store ENV variables)
Follow the steps in: U-Boot compilation – NAND / SPIcp u-boot.bin /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/host-tools/
Prepare Kernel Image
Follow the steps in: Kernel compilationcp /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/arch/arm/boot/uImage /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/host-tools/
Prepare File systemcd /home/vmplanet/targetfs
tar czvf /home/vmplanet/nfs.tar.gz *
cp /home/vmplanet/nfs.tar.gz /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/host-tools/
Create SD cardcd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/host-tools/
mount
umount /media/boot
umount /media/rootfs
sudo ./mksd-ti816x.sh /dev/sdc MLO u-boot.bin uImage nfs.tar.gz
Create SD CARD boot scriptcd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/tools/
gedit boot.txt
Copy and save following text in the file (Note: Check the host IP and Serial console number):setenv bootargs 'console=ttyO2,115200n8 root=/dev/mmcblk0p2 mem=128M rootwait notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:16M,1:16M,2:6M'
setenv bootcmd 'mmc init; fatload mmc 1 0x81000000 uImage; bootm 0x81000000'
boot
Create the scriptmkimage -A arm -O linux -T script -C none -n TI_script -d boot.txt boot.scr
Unplug and Plug the SD cardcp boot.scr /media/boot/
Booting from NAND
——————–
Flashing Kernel
Follow the steps in: Kernel compilation
ALWAYS CHECK size of uImage after tftp transfer and correct the value 0×280000. Check host IP.
Flashing Kernel to NANDdhcp
setenv serverip 192.168.0.22
mw.b 0x81000000 0xFF 0x280000
tftp 0x81000000 uImage
nand erase 0x00280000 0x00280000
nand write 0x81000000 0x00280000 0x280000
One line command (Ready for Copy & Paste):dhcp;setenv serverip 192.168.0.22;mw.b 0x81000000 0xFF 0x280000;tftp 0x81000000 uImage;nand erase 0x00280000 0x00280000;nand write 0x81000000 0x00280000 0x280000
Flashing File system
Follow the steps in: File system
ALWAYS CHECK size of rd-jffs2.bin after tftp transfer and correct the value 0×0700000. Check host IP.
Flashing File system to NANDdhcp
setenv serverip 192.168.0.22
mw.b 0x81000000 0xFF 0x0700000
tftp 0x81000000 rd-jffs2.bin
nand erase clean 0x006C0000 0x0700000
nand write 0x81000000 0x006C0000 0x700000
One line command (Ready for Copy & Paste):dhcp;setenv serverip 192.168.0.22;mw.b 0x81000000 0xFF 0x0700000;tftp 0x81000000 rd-jffs2.bin;nand erase clean 0x006C0000 0x0700000;nand write 0x81000000 0x006C0000 0x700000
Set ENV variables
ALWAYS CHECK if the size is correct and same as in Kernel and File system abovesetenv bootcmd 'nand read 0x81000000 0x280000 0x280000;nand read 0x82000000 0x6C0000 0x700000;bootm 0x81000000'
setenv bootargs 'mem=128M console=ttyO2,115200n8 noinitrd root=/dev/mtdblock7 rw rootfstype=jffs2 notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:16M,1:16M,2:6M'
saveenv
One line command (Ready for Copy & Paste):setenv bootcmd 'nand read 0x81000000 0x280000 0x280000;nand read 0x82000000 0x6C0000 0x700000;bootm 0x81000000';setenv bootargs 'mem=1024M console=ttyO2,115200n8 noinitrd root=/dev/mtdblock7 rw rootfstype=jffs2 notifyk.vpssm3_sva=0xBF900000 vram=50M ti816xfb.vram=0:16M,1:16M,2:6M';saveenv
***********************************************************************
FLASHING UBoot (On a board booted up from SD and connected to network)
***********************************************************************
Flashing u-Boot to NAND
—————
Prepare NAND uBoot
Follow the steps in: U-Boot compilation – NANDcp u-boot.noxip.bin /tftpboot/
Note: ALWAYS CHECK size of u-boot.noxip.bin after tftp transfer and correct the value 0×260000 if needed. Check IP address.
Flashing UBoot to NAND:dhcp
setenv serverip 192.168.0.22
mw.b 0x81000000 0xFF 0x260000
tftp 0x81000000 u-boot.noxip.bin
nand erase 0x0 0x260000
nandecc hw 2
nand write.i 0x81000000 0x0 0x260000
nandecc hw 0
One line command (Ready for Copy & Paste):dhcp;setenv serverip 192.168.0.22;mw.b 0x81000000 0xFF 0x260000;tftp 0x81000000 u-boot.noxip.bin;nand erase 0x0 0x260000;nandecc hw 2;nand write.i 0x81000000 0x0 0x260000;nandecc hw 0
Flashing u-Boot to SPI
—————
Prepare SPI uBoot
Follow the steps in: U-Boot compilation – SPIcp u-boot.noxip.bin.spi /tftpboot/
Note: ALWAYS CHECK size of u-boot.noxip.bin.spi after tftp transfer and correct the value 0×40000 if needed. Check IP address.
Flashing UBoot to SPI:dhcp
setenv serverip 192.168.0.22
mw.b 0x81000000 0xFF 0x100000
tftp 0x81000000 u-boot.noxip.bin.spi
sf probe 0:0
sf erase 0x0 0x40000
sf write 0x81000000 0x0 0x40000
One line command (Ready for Copy & Paste):dhcp;setenv serverip 192.168.0.22;mw.b 0x81000000 0xFF 0x100000;tftp 0x81000000 u-boot.noxip.bin.spi;sf probe 0:0;sf erase 0x0 0x40000;sf write 0x81000000 0x0 0x40000
***********************************************
USING JTAG to FLASH UBOOT INTO NAND
***********************************************
*******************************************************
PREPARING THE BINARY FILES (UBOOT, KERNEL, FILE SYSTEM)
*******************************************************
U-Boot compilation
——————-
In case gcc cant be located (Error: /bin/sh: arm-none-linux-gnueabi-gcc: command not found) use following commands:cd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/
export PATH=/home/vmplanet/CodeSourcery/Sourcery_G++_Lite/bin:$PATH
export PATH=/home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/tools:$PATH
U-Boot for SD mincd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_min_sd
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm u-boot.ti
U-Boot for NANDcd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_config_nand
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm u-boot.ti
U-Boot for SPIcd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_config_spi
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm u-boot.ti
Kernel compilation
——————
In case gcc cant be located (Error: /bin/sh: arm-none-linux-gnueabi-gcc: command not found) use following commands:cd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/
export PATH=/home/vmplanet/CodeSourcery/Sourcery_G++_Lite/bin:$PATH
export PATH=/home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/tools:$PATH
Kernel compilationcd /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_defconfig
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage
cp /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/arch/arm/boot/uImage /tftpboot/
File system
—————
In case mkfs.jffs3 is not installed run:sudo apt-get install mtd-utils
Note: Original EZSDK targetfs is quite large. I will use VOIPAC file system.
cd /home/vmplanet
wget http://voipac.com/downloads/imx/25/bin/rootfs-nfs-bb-1-17-vmx25-vmx25-vpac3.tar.gz
sudo tar xvf rootfs-nfs-bb-1-17-vmx25-vmx25-vpac3.tar.gz
sudo gedit rootfs-bb-1-17-final2/etc/inittab
change from:::respawn:/sbin/getty -L ttymxc0 115200 vt100
::respawn:/sbin/getty -L tty1 115200
to#::respawn:/sbin/getty -L ttymxc0 115200 vt100
::respawn:/sbin/getty -L ttyO2 115200 //use correct console number: for standard EZSDK board use: ttyO2
then Save and Close
Make the imagemkfs.jffs2 -lqn –e 128 -r rootfs-bb-1-17-final2/ -o /tftpboot/rd-jffs2.bin
************************
Other useful things …
************************
Using GPIO
———–gedit /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/arch/arm/configs/ti8168_evm_defconfig
CTRL+F and look for: CONFIG_GPIO_SYSFS
Change from:# CONFIG_GPIO_SYSFS is not set
to:CONFIG_GPIO_SYSFS=y
Set the selected pins into GPIO modegedit /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/linux-2.6.37-psp04.00.00.12/arch/arm/mach-omap2/board-ti8168evm.c
CTRL+F and look for: TI816X_MUX(GPMC_A27, OMAP_MUX_MODE1), /* gpio-20 */
Add custom configuration:
//CUSTOM GPIO PINS
//Pin names and MODE are based on MUX81xx.c file
TI816X_MUX(SC0_DET, OMAP_MUX_MODE2), /* gpio1-9: Custom Baseboard LED */
TI816X_MUX(SC0_C4, OMAP_MUX_MODE1), /* gpio1-13: Custom Module LED */
Save and Close
Compile new Kernel
Follow the steps in: Kernel compilation
Run your board with the new kernel and use following commands to control GPIOs
//module LEDroot@dm816x-evm:~# cd /sys/class/gpio/
root@dm816x-evm:/sys/class/gpio# echo 45 > export
root@dm816x-evm:/sys/class/gpio# cd gpio45
root@dm816x-evm:/sys/devices/virtual/gpio/gpio45# echo "out" > direction
root@dm816x-evm:/sys/devices/virtual/gpio/gpio45# echo 1 > value
root@dm816x-evm:/sys/devices/virtual/gpio/gpio45# echo 0 > value
root@dm816x-evm:/sys/devices/virtual/gpio/gpio45#
//Base Board LEDroot@dm816x-evm:/sys/class/gpio# echo 41 > export
root@dm816x-evm:/sys/class/gpio# cd gpio41
root@dm816x-evm:/sys/devices/virtual/gpio/gpio41# echo "out" > direction
root@dm816x-evm:/sys/devices/virtual/gpio/gpio41# echo 0 > value
root@dm816x-evm:/sys/devices/virtual/gpio/gpio41# echo 1 > value
root@dm816x-evm:/sys/devices/virtual/gpio/gpio41#
UBOOT: Set different serial port in U-Boot for console output (by default it is UART2)
————————————————————————————–gedit /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/include/configs/ti8168_evm.h
CTRL+F and look for: #define CONFIG_SYS_NS16550_COM1
Change from:#define CONFIG_SYS_NS16550_COM1 0x48024000 /* Base EVM has UART2 */
to:#define CONFIG_SYS_NS16550_COM1 0x48020000 /* Base EVM has UART0 */
UBOOT: Add support for recognision of an unsupported Winbond SPI memory chip (Example!)
————————————————————————————–gedit /home/vmplanet/ti-ezsdk_dm816x-evm_5_02_02_60/board-support/u-boot-2010.06-psp04.00.00.12/drivers/mtd/spi/winbond.c
Change from:#define WINBOND_ID_W25X64 0x3017
to:#define WINBOND_ID_W25X64 0x3017
#define WINBOND_ID_W25Q64 0x4017
Change from:{
.id = WINBOND_ID_W25X64,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 128,
.name = "W25X64",
},
to:{
.id = WINBOND_ID_W25X64,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 128,
.name = "W25X64",
},
{
.id = WINBOND_ID_W25Q64,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 128,
.name = "W25Q64",
},
- DM8148 开发记录 四
- DM8148 开发记录 四 opencv 应用c6accel
- DM8148开发记录 一
- DM8148开发记录 二
- DM8148 开发记录 三
- DM8148开发记录 一
- DM8148 开发记录
- DM8148 开发记录 五 dsp 端调试成功
- DM8148开发学习板
- DM8148开发学习板
- 创龙 DM8148 开发板
- DM8148芯片开发平台
- dm8148 开发记录 六 dsp和arm 端 opencv测试时间
- dm8148 多通道解码测试记录
- DM8148 摄像头采集 显示 识别测试 四
- DM8148开发板U-boot编译步骤
- DM8148 arm 端采集与显示程序设计记录
- AM1808开发记录(四)
- 【指针】【引用作形参】对三个变量排序
- struts2.1的bug:Exception starting filter struts2 java.lang.NullPointerException
- SQL中的In的用法
- LVS/DR模式原理剖析(FAQs)
- eoe里面的实现GridView 长按跨屏拖动,以及自动移位。
- DM8148 开发记录 四
- SiteServer CMS UserCenter/login.aspx页面用户名处sql注射
- linphone
- Linux环境下U盘挂载与卸载
- java环境变量设置
- 分析oracle主键的跳号现象
- 连接池中的maxIdle,MaxActive,maxWait参数
- java服务器在Linux下实现负载均衡
- cocos3d加载3Dmax模型到ios中