1.下载源码
http://www.columbia.edu/kermit/ckdaily.html
2.解包
3. 进入目录
4. make linux
5. 生成wermit的可执行文件
6. sudo mkdir /usr/local/man
7. sudo vi /usr/local/bin/kermit.ini
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
set rec pack 1000
set send pack 1000
set window 5
c
8.sudo make install
C-Kermit version 9.0.302 installed!
最后安装后的可执行文件是/usr/local/bin/kermit
- 使用
ctrl + \
退出串口状态,回到kermit>提示符下
connect 进入串口状态
自动执行脚本进行软件加载方法,用take commandfile方法:
(/current/dir) C-Kermit> take commandfile
其中 commandfile要以下面一行打头:
#!/usr/local/bin/kermit +
示例:
#!/usr/local/bin/kermit +
LINEOUT “reboot”
INPUT 60 “autoboot: 4”
IF FAIL EXIT 1 “timeout “
LINEOUT “^B”
input 10 “ar7240>”
IF FAIL EXIT 1 “timeout “
LINEOUT “setenv bootargs kgdboc=ttyS0,115200 console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:256k(u-boot),256k(u-boot-env),6m(rootfs0),1m(uImage0),6m(rootfs1),1m(uImage1),320k(config),1m(reserved),64k(log),64k(manu),64k(ART)”
INPUT 10 “ar7240>”
LINEOUT “set bootcmd bootm 0x9f680000”
INPUT 10 “ar7240>”
LINEOUT “set ipaddr 10.0.2.151”
INPUT 10 “ar7240>”
LINEOUT “set serverip 10.0.2.153”
INPUT 10 “ar7240>”
LINEOUT “save”
INPUT 10 “ar7240>”
if ( ( not def \%1 ) || ( ( def \%1 ) & ( eq “\%1” 1 ) ) ) {
echo “****************** load kernel **********************”
lineout “tftp 0x80060000 vmlinux.lzma.uImage && erase 0x9f680000 +0x100000 && cp.b 0x80060000 0x9f680000 ${filesize}”
input 60 “ar7240>”
IF FAIL EXIT 1 “60 seconds timeout for waiting ar7240 prompt when burn linux kernel”
}
if ( ( not def \%1 ) || ( ( def \%2 ) & ( eq “\%2” 1 ) ) ) {
echo “****************** load rootfs **********************”
lineout “tftp 0x80060000 db12x-squashfs && erase 0x9f080000 +0x600000 && cp.b 0x80060000 0x9f080000 ${filesize}”
input 160 “ar7240>”
IF FAIL EXIT 1 “160 seconds timeout for waiting ar7240 prompt when burn db12x-squashfs”
}
if ( ( not def \%1 ) || ( ( def \%3 ) & ( eq “\%3” 1 ) ) ) {
echo “****************** load config-db12x **********************”
lineout “tftp 0x80060000 config-db12x && erase 0x9fe80000 +0x050000 && cp.b 0x80060000 0x9fe80000 ${filesize}”
input 160 “ar7240>”
}
if ( ( not def \%1 ) || ( ( def \%4 ) & ( eq “\%4” 1 ) ) ) {
echo “****************** load config-portal **********************”
lineout “tftp 0x80060000 config-portal && erase 0x9fed0000 +0x100000 && cp.b 0x80060000 0x9fed0000 $filesize”
input 160 “ar7240>”
}
lineout “boot”
input 600 “login:” #wait for 100 seconds for prompt “login:”
lineout “root”
input 30 “Password:”
lineout “5up”
connect