小R科技-WIFI机器人网·机器人创意工作室

 找回密码
 立即注册
查看: 9420|回复: 5

能不能等路由启动之后再初始化单片机的串口呢,

[复制链接]
发表于 2013-2-17 14:49:23 | 显示全部楼层 |阅读模式
避免引起串口异常,能不能在下位机程序中加入先启动路由再初始化串口呢
如下为703N的启动信息

U-Boot 1.1.4 (Feb 28 2012 - 11:58:24)

AP121 (ar9330) U-boot

DRAM:  32 MB
led turning on for 1s...

id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7
eth0: 00:03:7f:09:0x:xx
ag7240_phy_setup
eth0 up

: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0x:xx
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup

eth1 up
eth0, eth1
Autobooting in 1 seconds

## Booting image at 9f020000 ...
   Uncompressing Kernel Image ...
O
K

Starting kernel ...

[    0.000000] Linux version 3.2.12 (zhm@ubuntu) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Sun May 20 02:02:11 PDT 2012
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN
ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback
ErrCtl register=00000000
[    0.000000] Memory: 29316k/32768k available (2055k kernel code, 3452k reserved, 392k data, 192k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] Calibrating delay loop...
265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.0900
00] MIPS: machine is TP-LINK TL-WR703N v1

[    0.330000] bio: create slab <bio-0> at 0
[    0.340000] Switching to clocksource
MIPS
[    0.350000] NET: Registered protocol family 2
[    0.350000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.350000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.360000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.360000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.370000] TCP reno registered
[    0.370000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.380000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.380000] NET: Registered protocol family 1

[    0.410000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.410000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.420000] msgmni has been set to 57
[    0.430000] io scheduler noop registered
[    0.430000] io scheduler deadline registered (default)
[    0.430000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.440000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.450000] console [ttyATH0] enabled, bootconsole disabled
[    0.
460000] m25p80 spi0.0: found en25q32b, expected m25p80
[    0.470000] m25p80 spi0.0: en25q32b (4096 Kbytes)
[    0.470000] 5 tp-link partitions found on MTD device spi0.0
[    0.480000] Creating 5 MTD partitions on "spi0.0":
[    0.480000] 0x000000000000-0x000000020000 : "u-boot"
[    0.490000] 0x000000020000-0x0000000fa30c : "kernel"
[    0.490000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.500000] 0x0000000fa30c-0x0000003f0000 : "rootfs"
[    0.510000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.520000] mtd: partition "r
ootfs" set to be root filesystem
[    0.530000] mtd: partition "rootfs_data" created automatically, ofs=340000, len=B0000
[    0.530000] 0x000000340000-0x0000003f0000 : "rootfs_data"
[    0.540000] 0x0000003f0000-0x000000400000 : "art"
[    0.550000] 0x000000020000-0x0000003f0000 : "firmware"

[    0.800000] ag71xx_mdio: probed
[    0.800000] eth0: Atheros AG71xx at 0xb9000000, irq 4

[    1.410000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[    1.410000] TCP westwood registered
[    1.420000] NET: Registered protocol family 17
[    1.420000] 8021q: 802.1Q VLAN Support v1.8
[    1.440000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.450000] Freeing unused kernel memory: 192k freed

- preinit -

Press the [f] key and hit [enter] to enter failsafe mode

- regular preinit -

[    8.800000] JFFS2 notice: (402) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 13 of xref (0 dead, 2 orphan) found.

switching to jffs2

- init -

[   11.650000] Compat-wireless backport release: compat-wireless-2012-02-27-1-r31054
[   11.660000] Backport based on wireless-testing.git master-2012-02-27

[   11.740000] cfg80211: Calling CRDA to update world regulatory domain

[   12.760000] usbcore: registered new interface driver usbfs
[   12.760000] usbcore: registered new interface driver hub
[   12.770000] cfg80211: World regulatory domain updated:
[   12.770000] cfg80211:  
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   12.780000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.780000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   12.790000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   12.800000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.810000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.810000] usbcore: registered new device driver usb

[   14.020000] ieee80211 phy0: At
heros AR9330 Rev:1 mem=0xb8100000, irq=2
[   14.030000] cfg80211: Calling CRDA for country: US

[   14.110000] PPP generic driver version 2.4.2
[   14.110000] cfg80211: Regulatory domain changed to country: US
[   14.120000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   14.130000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   14.130000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   14.140000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   14.150000
] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   14.160000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   14.160000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)

[   14.950000] ip_tables: (C) 2000-2006 Netfilter Core Team

[   15.080000] NET: Registered protocol family 24

[   15.220000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   15.220000] ath79-ehci ar933x-ehci: Atheros built-in EHCI controller
[   15.230000] ath79-ehci ar933x-ehci: new USB bus registered, assigned bus number 1
[   15.270000] ath79-ehci ar933x-ehci: irq 3, io mem 0x1b000000

[   15.290000] ath79-ehci ar933x-ehci: USB 2.0 started, EHCI 1.00
[   15.290000] hub 1-0:1.0: USB hub found
[   15.290000] hub 1-0:1.0: 1 port detected
[   15.320000] nf_conntrack version 0.5.0 (461 buckets, 1844 max)

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

[   15.770000] uhci_hcd: USB Universal Host Controller Interface driver

[   15.970000] i2c /dev entries driver

[   16.120000] usbcore: registered new interface driver snd-usb-audio

[   16.240000] Linux video capture interface: v2.00

[   16.480000] gspca_main: v2.14.0 registered
[   16.500000] usbcore: registered new interface driver zc3xx
[   16.520000] usbcore: regist
ered new interface driver uvcvideo
[   16.530000] USB Video Class driver (1.1.1)

[   19.140000] device wlan0 entered promiscuous mode

[   21.120000] device eth0 entered promiscuous mode

[   21.400000] device wlan0 left promiscuous mode
[   21.400000
] br-lan: port 1(wlan0) entering disabled state

[   21.660000] device wlan0 entered promiscuous mode

[   22.400000] br-lan: port 1(wlan0) entering forwarding state
[   22.410000] br-lan: port 1(wlan0) entering forwarding state

[   37.440000] br-lan: port 1(wlan0) entering forwarding state



好像哪位大虾讲到过,找不到贴子了,求助!

回复

使用道具 举报

发表于 2013-2-17 17:10:37 | 显示全部楼层
可以的,一上电先不要初始化串口,这样串口就不会有数据出来,延时个30秒左右,再初始化串口即可。这段时间可能比较长,所以可以仿照论坛驱动板形式,加入流水灯显示状态。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-2-17 17:37:57 | 显示全部楼层
liuviking 发表于 2013-2-17 17:10
可以的,一上电先不要初始化串口,这样串口就不会有数据出来,延时个30秒左右,再初始化串口即可。这段时间 ...

谢谢老大的回复,吼吼
能不能根据 703N的启动信息判断路由启动完毕,然后再初始化串口呢
感觉只是做延时不严密呀,贪心了,哈哈
回复 支持 反对

使用道具 举报

发表于 2013-2-17 17:47:20 | 显示全部楼层
prophet000 发表于 2013-2-17 17:37
谢谢老大的回复,吼吼
能不能根据 703N的启动信息判断路由启动完毕,然后再初始化串口呢
感觉只是做延时 ...

这个肯定不行,因为要根据串口打印来执行动作那肯定是要初始化串口的。路由启动时间一般固定,所以用延时基本没问题
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-2-18 09:50:14 | 显示全部楼层
吼吼,老大回复更加有动力了
我是个玩机新手,谢谢指点
我其实是想描述:上电 -》单片机初始化串口(只收不发,避免干扰),等待路由启动-》路由启动完毕,串口收发全开
回复 支持 反对

使用道具 举报

发表于 2013-2-18 11:20:21 | 显示全部楼层
prophet000 发表于 2013-2-18 09:50
吼吼,老大回复更加有动力了
我是个玩机新手,谢谢指点
我其实是想描述:上电 -》单片机初始化串口(只收 ...

这个貌似不行的,因为一旦初始化了,收发都会使能。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

新品特惠推荐上一条 /2 下一条

QQ|QQ技术咨询1|QQ技术咨询2|商务合作微信1:xiaorgeek001|商务合作微信2:XiaoRGEEK|诚聘英才|Archiver|手机版|小R科技-WIFI机器人网·机器人创意工作室 ( 粤ICP备15000788号-6 )

GMT+8, 2024-11-23 05:24 , Processed in 1.213129 second(s), 19 queries .

Powered by XiaoR GEEK X3.4

© 2014-2021 XiaoR GEEK

快速回复 返回顶部 返回列表