您好,  [请登录] [QQ登录]  [支付宝登录[免费注册]

商品分类

分享到: 百度搜藏 搜狐微博 新浪微博 腾讯微博 QQ收藏 人人网 Facebook Twitter

linux下使用串口终端C-kermint连接飞凌OK6410开发板

发布日期:2011-06-23

系统:Ubuntu9.10

开发板:飞凌OK6410

最近购入一块新的开发板,芯片是基于三星的S3C6410,ARM11,使用之后发现,速度果然很不错,跟ARM9的S3C2440不可同日而语。飞凌的开发板质量很不错,跟友善之臂相比,谁比较好一目了然,当然,这二家的主要市场不太一样,友善之臂主要面向的是学生市场,价格自然要低些,但是一份价格一份货,如果要作为产品开发,自然还是要选择可靠点。不过,我纯粹是拿来学习,增长功力的。

当然,新的开发板,总要为它搭建下开发环境,虽然已经是比较熟练了,但是记录下来,既可以当作笔记,也可以帮助其他人。

飞凌的开发板比较偏向wince,自然wince的支持就比较好,而linux上就稍微薄弱了点,linux版的用户手册里甚至没记录怎么linux下进行串口的连接,只简单描述了如何用windows的超级终端连接。

一般来说,在linux下可以使用minicom和C-kerimit两款通讯软件,而我个人比较偏向C-kermit,实际开发中,我也一直使用C-kermit,原因有两个,第一,当我第一次搭开发环境时,我选择了minicom,结果在ubuntu下既乱码,显示效果又很奇怪,折腾了很久才搞定;第二,C-kermit的确是一个很强大的软件,而且配合Uboot可以完成许多特性,并且显示效果也不错,所以就一直用到了现在。

目前,ubuntu里已经集成了C-kermit,使用命令kermint就可以打开,如果需要自己编译安装,可以去官网地址下载源码包。

C-kermit官网:http://www.columbia.edu/kermit/

官网上还附带了使用手册,可以帮助来学习这个强大的工具。

第一步,就是先配置使用的参数,当然可以打开kermit后来来配置,然后一开始配置好就可以省去很多麻烦。

如果选择全局的参数配置,就使用命令:

#sudo vi /etc/kermit/kermrc

如果只针对当前的用户,就使用命令:

#vi ~/.kermrc

打开文件后,把配置参数写入进入,网上通用的参数如下:

#----- kermrc for /dev/ttyUSB0 -------------------

#设置通信的目标串口,由于我的笔记本没有串口,使用了USB转串口,所以设备为/dev/ttyUSB0

set line /dev/ttyUSB0

#设置波特率

set speed 115200

#关闭通信监视

set carrier-watch off

#设置没有握手协议

set handshake none

#数据流控制为无

set flow-control none

#设置保守安全及缓慢的传输设置

robust

#设置可以传输二进制文件

set file type bin

#限制传输文件名

set file name lit

#设置接受文件包的大小为1000字节

set rec pack 1000

#设置传输文件包的大小为1000字节

set send pack 1000

#设置窗口大小

set window 5

#---------end------------------------------------

这些参数就足够保证能初步连上OK6410,当然,C-kermit其实还有更多参数,并且在配置里还可以定制不同情况下的参数,这些属于题外话,在以后可以慢慢探讨。

第二步,就是打开命令进行连接,不过这之前,可以先了解下C-kermit的知识。

kermit有两种模式,一种为终端模式,一种为命令模式

处于终端模式时,显示从串口发回来的数据,处于命令模式时,显示命令提示符,并等待用户输入命令后,执行命令。

运行kermit,进入命令模式,输入"connect"并回车,进入终端模式。

在终端模式按下Ctrl + \, 再按下C 返回命令模式

 

 

 

常用命令

connect : 连接串口设备,连接成功后进入终端模式,简写为c

quit: 退出kermit, 简写为q

send: 使用kermit协议发送文件,与uboot传送文件时使用

run : 运行外部命令,我们将用这个命令调用xmodem发送文件。

?   : 显示全部命令

!   : 运行一个shell,需要临时离开kermit进行其它的作业的时候,可以使用叹号命令。结果操作时使用exit退出shell,返回kermit。

了解了这些知识,可以去连接OK6410了。

最后,以运行C-kermint并且连接上OK6410来结束本篇文章,在未来还可以探讨在裸机的情况下将Uboot传输进去。

# kermit

?Not confirmed - robust

Command stack:

1. File  : /home/wangchen/.kermrc (line 5)

0. Prompt: (top level)

?No keywords match - sendd

Command stack:

1. File  : /home/wangchen/.kermrc (line 9)

0. Prompt: (top level)

C-Kermit 8.0.211, 10 Apr 2004, for Linux

Copyright (C) 1985, 2004,

Trustees of Columbia University in the City of New York.

Type ? or HELP for help.

(/home/wangchen/Desktop/) C-Kermit>c

Connecting to /dev/ttyUSB0, speed 115200

Escape character: Ctrl-\ (ASCII 28, FS): enabled

Type the escape character followed by C to get back,

or followed by ? to see other options.

----------------------------------------------------

OK

U-Boot 1.1.6 (Jan 14 2010 - 00:48:10) for SMDK6410

****************************************

**    u-boot 1.1.6                    **

**    Updated for TE6410 Board        **

**    Version 1.0 (10-01-15)          **

**    OEM: Forlinx Embedded           **

**    Web: http://www.witech.com.cn   **

****************************************

CPU:     S3C6410 @532MHz

Fclk = 532MHz, Hclk = 133MHz, Pclk = 66MHz, Serial = CLKUART (SYNC Mode)

Board:   SMDK6410

DRAM:    128 MB

Flash:   0 kB

NAND:    256 MB

In:      serial

Out:     serial

Err:     serial

Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x100000, size 0x300000

3145728 bytes read: OK

Boot with zImage

Starting kernel ...

Uncompressing Linux............................................................................................................................................. done, booting the kernel.

Linux version 2.6.28.6 (jkeqiang@ubuntu) (gcc version 4.2.2) #213 Sun May 9 23:07:10 PDT 2010

CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f

CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

Machine: SMDK6410

Memory policy: ECC disabled, Data cache writeback

CPU S3C6410 (id 0x36410101)

S3C24XX Clocks, (c) 2004 Simtec Electronics

S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000

S3C64XX: HCLKx2=266000000, HCLK=133000000, PCLK=66500000

div1: 00000555

mout_apll: source is fout_apll (1), rate is 532000000

mout_epll: source is fout_epll (1), rate is 24000000

mout_mpll: source is mpll (1), rate is 532000000

mmc_bus: source is dout_mpll (1), rate is 44333333

mmc_bus: source is dout_mpll (1), rate is 44333333

mmc_bus: source is dout_mpll (1), rate is 44333333

usb-host-bus: source is mout_epll (0), rate is 24000000

uclk1: source is dout_mpll (1), rate is 66500000

spi-bus: source is mout_epll (0), rate is 24000000

spi-bus: source is mout_epll (0), rate is 24000000

audio-bus0: source is mout_epll (0), rate is 24000000

audio-bus1: source is mout_epll (0), rate is 24000000

audio-bus2: source is mout_epll (0), rate is 24000000

irda-bus: source is mout_epll (0), rate is 24000000

s3c64xx: 15728640 bytes SDRAM reserved for fimc at 0x505a3000

s3c64xx: 8388608 bytes SDRAM reserved for pp at 0x514a3000

s3c64xx: 8388608 bytes SDRAM reserved for tv at 0x51ca3000

s3c64xx: 6291456 bytes SDRAM reserved for mfc at 0x524a3000

s3c64xx: 8388608 bytes SDRAM reserved for jpeg at 0x52aa3000

s3c64xx: 8388608 bytes SDRAM reserved for cmm at 0x532a3000

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512

Kernel command line: root=/dev/mtdblock2 rootfstype=cramfs console=ttySAC0,115200

PID hash table entries: 512 (order: 9, 2048 bytes)

Console: colour dummy device 80x30

s3c24xx_serial_init_ports: initialising ports=4...

console [ttySAC0] enabled

Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)

Memory: 128MB = 128MB total

Memory: 70784KB available (3908K code, 494K data, 272K init)

SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Calibrating delay loop... 530.84 BogoMIPS (lpj=1327104)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

net_namespace: 316 bytes

NET: Registered protocol family 16

S3C6410: Initialising architecture

S3C DMA-pl080 Controller Driver, (c) 2006-2007 Samsung Electronics

Total 32 DMA channels will be initialized.

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 4096 (order: 3, 32768 bytes)

TCP bind hash table entries: 4096 (order: 4, 81920 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

NET: Registered protocol family 1

NetWinder Floating Point Emulator V0.97 (double precision)

yaffs May  9 2010 18:05:41 Installing.

msgmni has been set to 138

alg: No test for stdrng (krng)

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered (default)

S3C_LCD clock got enabled :: 133.000 Mhz

LCD TYPE :: LTE480WV will be initialized

Window[0] - FB1: map_video_memory: clear ff000000:0007f800

FB1: map_video_memory: dma=57180000 cpu=ff000000 size=0007f800

Window[0] - FB2: map_video_memory: clear ff03fc00:0003fc00

FB2: map_video_memory: dma=571bfc00 cpu=ff03fc00 size=0003fc00

[DEBUG]logo_lines 34, vc->vc_bottom 34

Console: switching to colour frame buffer device 60x34

fb0: s3cfb frame buffer device

Window[1] - FB1: map_video_memory: clear ff080000:0007f800

FB1: map_video_memory: dma=57200000 cpu=ff080000 size=0007f800

Window[1] - FB2: map_video_memory: clear ff0bfc00:0003fc00

FB2: map_video_memory: dma=5723fc00 cpu=ff0bfc00 size=0003fc00

fb1: s3cfb frame buffer device

Window[2] - FB1: map_video_memory: clear ff100000:0003fc00

FB1: map_video_memory: dma=57140000 cpu=ff100000 size=0003fc00

fb2: s3cfb frame buffer device

Window[3] - FB1: map_video_memory: clear ff140000:0003fc00

FB1: map_video_memory: dma=57280000 cpu=ff140000 size=0003fc00

fb3: s3cfb frame buffer device

enter s3c6410_leds_init

leds initialized

s3c6400-uart.0: s3c2410_serial0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10

s3c6400-uart.1: s3c2410_serial1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10

s3c6400-uart.2: s3c2410_serial2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10

s3c6400-uart.3: s3c2410_serial3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10

brd: module loaded

loop: module loaded

PPP generic driver version 2.4.2

dm9000 Ethernet Driver

eth%d: con201 Invalid ethernet MAC address. using default config,  Please set using ifconfig

eth0: dm9000 at f7b00300,f7b00304 IRQ 108 MAC: 00:e0:4a:bc:15:e7

Linux video capture interface: v2.00

s3c-fimc: controller 0 registered successfully

s3c-fimc: controller 1 registered successfully

printk ov965x_init

s3c-fimc: info ov965x_init

S3C6400 MFC Driver, (c) 2007 Samsung Electronics

S3C6400 MFC Driver, (c) 2007 Samsung Electronics

S3C PostProcessor Driver v3.12, (c) 2009 Samsung Electronics

S3C6410 TV encoder Driver, (c) 2008 Samsung Electronics

S3C6410 TV encoder Driver init OK.

S3C6410 TV scaler Driver, (c) 2008 Samsung Electronics

S3C6410 TV scaler Driver init OK.

S3C Rotator Driver, (c) 2008 Samsung Electronics

s3c_rotator_probe called

s3c_rotator_probe success

S3C JPEG Driver, (c) 2007 Samsung Electronics

s3c_g2d_probe called

s3c_g2d_probe Success

S3C G2D Init : Done

S3C G3D Driver, (c) 2007-2009 Samsung Electronics

s3c_g3d version : 0x1050000

S3C G3D Init : Done

S3C CMM Driver, (c) 2008 Samsung Electronics

Driver 'sd' needs updating - please use bus_type methods

S3C NAND Driver, (c) 2008 Samsung Electronics

S3C NAND Driver is using software ECC.

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)

Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x00040000 : "Bootloader"

0x00040000-0x00400000 : "Kernel"

0x00400000-0x05400000 : "Rootfs"

0x05400000-0x10000000 : "File System"

Samsung SoC SPI Driver loaded for SPI-0

Max,Min-Speed [33250000, 129882]Hz

Irq=80    IOmem=[0x7f00bfff-0x7f00b000]    DMA=[Rx-33, Tx-34]

Samsung SoC SPI Driver loaded for SPI-1

Max,Min-Speed [33250000, 129882]Hz

Irq=81    IOmem=[0x7f00cfff-0x7f00c000]    DMA=[Rx-35, Tx-36]

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

s3c2410-ohci s3c2410-ohci: S3C24XX OHCI

s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1

s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

s3c-udc : S3C HS USB OTG Device Driver, (c) 2008-2009 Samsung Electronics

s3c-udc : version 15 March 2009 (DMA Mode)

mice: PS/2 mouse device common for all mice

gpio keys driver.

input: gpio-keys as /class/input/input0

S3C Touchscreen driver, (c) 2008 Samsung Electronics

S3C TouchScreen got loaded successfully : 12 bits

input: S3C TouchScreen as /class/input/input1

S3C24XX RTC, (c) 2004,2006 Simtec Electronics

s3c2410_rtc: tick irq 34, alarm irq 92

s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling

s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0

i2c /dev entries driver

s3c2440-i2c s3c2440-i2c: slave address 0x10

s3c2440-i2c s3c2440-i2c: bus frequency set to 377 KHz

[OV965X]ov965x_attach_adapter.

[CAM]s3c_fimc_register_camera,cam->id=0

parent clock for camera: 266.000 MHz, divisor: 11

[CAM]RESET CAM.[CAM]Reset and init reg!1cam->client=0

[CAM]Reset and init reg!1

[CAM]Reset and init reg!3

s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz)

s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz)

s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (44333333 Hz)

[SDHCI]to add external irq as a card detect signal......

[SDHCI]if (pdata->cfg_ext_cd)......

mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA

[SDHCI]request_irq......

sdhci: card inserted.

s3c-sdhci s3c-sdhci.1: clock source 0: hsmmc (133000000 Hz)

s3c-sdhci s3c-sdhci.1: clock source 1: hsmmc (133000000 Hz)

s3c-sdhci s3c-sdhci.1: clock source 2: mmc_bus (44333333 Hz)

[SDHCI]to add external irq as a card detect signal......

mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using ADMA

usbcore: registered new interface driver usbhid

usbhid: v2.6:USB HID core driver

Advanced Linux Sound Architecture Driver Version 1.0.18rc3.

ASoC version 0.13.2

WM9713/WM9714 SoC Audio Codec 0.15

playback: 1, capture : 1

asoc: AC97 HiFi <-> s3c64xx-ac97 mapping ok

[WM9713]Open speaker volume.

ALSA device list:

#0: SMDK6400 (WM9713)

TCP cubic registered

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5

s3c2410-rtc s3c2410-rtc: setting system clock to 2000-01-04 22:07:28 UTC (947023648)

mtd->size = 5000000 blocks = 280

cheaking bad block...............

.................................................................................................................................................................................

bad block at 1620000

..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................VFS: Mounted root (cramfs filesystem) readonly.

Freeing init memory: 272K

skip bad block b1

*************************************

 

http://www.witech.com.cn

 

*************************************

mkdir: cannot create directory '/mnt/disk': File exists

yaffs: dev is 32505859 name is "mtdblock3"

yaffs: passed flags ""

yaffs: Attempting MTD mount on 31.3, "mtdblock3"

yaffs: restored from checkpoint

yaffs_read_super: isCheckpointed 1

Try to bring eth0 interface up......eth0: link down

Done

Starting Qtopia, please waiting...

touch...

Please press Enter to activate this console.

[root@OK6410 /]#