您尚未登录。

楼主 # 2021-06-08 01:48:49

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

F1C200S看门狗死机

RT,使用TINY200主线LINUX,修改linux自带的看门狗工具将V去掉( 退出程序不会关闭看门狗),然后在preinit里watchdog-utils -t 16 -e设置看门狗时间16S,系统启动后echo 0>/dev/watchdog不断喂狗然后停止喂狗,然后就死机了。。。。出现过好几次,大部分时间能正常重启,但是偶尔整个系统就死掉。串口也没反应,系统的heartbeat灯也没了。通过RST脚能够复位。
心里好慌!!!!!都要小批产品了。。。。。
看了看门狗驱动,有个reset function寄存器设置为2,不知道有没解释,难道不是时间到,强制复位ARM吗?难道还不是强制复位,软中断什么的处理balabala???

离线

楼主 #1 2021-06-08 02:10:59

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

另外求下各位大神,把看门狗驱动移植到UBOOT里:) ,因为发现F1C200S实在太脆弱,搭一下FLASH就可能死在UBOOT SPL里,因为没法加载UBOOT,想在SPL跟第二阶段的UBOOT看门狗都打开

离线

楼主 #3 2021-06-08 13:21:48

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

你用的是什么 flash 呢?

nor flash w25q126 16M

离线

楼主 #5 2021-06-08 15:13:21

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:
lonerwolf 说:
哇酷小二 说:

你用的是什么 flash 呢?

nor flash w25q126 16M

16M的flash应该不会出现这种问题,可以一直用串口监视数据吗?

是的,我也怀疑是不是F1C200 的串口RX脚如果外部拉高是不是就无法复位。

离线

楼主 #6 2021-06-08 15:15:47

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:
lonerwolf 说:
哇酷小二 说:

你用的是什么 flash 呢?

nor flash w25q126 16M

16M的flash应该不会出现这种问题,可以一直用串口监视数据吗?

复现问题很简单,拿块F1C200的板子,启动初始化的时候开启看门狗,后面一直喂狗然后停掉就行,很容易死。我在PREINIT里开启看门狗,后面INIT.D的各种脚本里都加了喂狗,很容易就死了。
还有种最简单的复现办法就是用busybox的watchdog,PREINIT里加一句watchdog -t 16000 /dev/watchdog,10次9次死

离线

楼主 #8 2021-06-08 15:26:41

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

有没有串口终端日志?

没记录,还在测试,发现了立马上传

离线

楼主 #9 2021-06-08 15:40:58

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

有没有串口终端日志?

U-Boot SPL 2020.07 (Jun 08 2021 - 15:14:56 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI


U-Boot 2020.07 (Jun 08 2021 - 15:14:56 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM:  64 MiB
MMC:
In:    serial
Out:   serial
Err:   serial
No USB gadget device found
Hit any key to stop autoboot:  0
Booting from SPI-NOR...
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x70000, size 0x240000
SF: 2359296 bytes @ 0x70000 Read: OK
## Loading kernel from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'kernel@0' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x810000cc
     Data Size:    2116800 Bytes = 2 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80000000
     Entry Point:  0x80000000
     Hash algo:    crc32
     Hash value:   9f741519
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x81204e70
     Data Size:    14485 Bytes = 14.1 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   44e7638e
   Verifying Hash Integrity ... crc32+ OK
   Booting using the fdt blob at 0x81204e70
   Loading Kernel Image
   Loading Device Tree to 817f9000, end 817ff894 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.110 (root@5129cc159053) (gcc version 9.3.0 (Buildroot -gb2f76347)) #1 Tue Jun 8 15:15:38 CST 2021
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: zgtech GW-001
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x83000000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootwait init=/etc/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 39936K/65536K available (5120K kernel code, 161K rwdata, 1044K rodata, 1024K init, 142K bss, 9216K reserved, 16384K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x240/0x3a4 with crng_init=0
[    0.000042] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000119] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000644] Console: colour dummy device 80x30
[    0.000728] Calibrating delay loop... 298.59 BogoMIPS (lpj=1492992)
[    0.070153] pid_max: default: 32768 minimum: 301
[    0.070539] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070576] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.071827] CPU: Testing write buffer coherency: ok
[    0.073458] Setting up static identity map for 0x80100000 - 0x80100058
[    0.074525] devtmpfs: initialized
[    0.081287] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.081345] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.084681] pinctrl core: initialized pinctrl subsystem
[    0.085664] NET: Registered protocol family 16
[    0.088158] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.089751] cpuidle: using governor menu
[    0.112134] usbcore: registered new interface driver usbfs
[    0.112268] usbcore: registered new interface driver hub
[    0.112388] usbcore: registered new device driver usb
[    0.114595] clocksource: Switched to clocksource timer
[    0.138501] NET: Registered protocol family 2
[    0.139641] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.139701] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.139742] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.139775] TCP: Hash tables configured (established 1024 bind 1024)
[    0.140028] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.140082] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.140525] NET: Registered protocol family 1
[    0.140883] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.142547] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.157513] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.157545] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.231808] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.231840] io scheduler mq-deadline registered
[    0.231855] io scheduler kyber registered
[    0.241793] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.257622] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.263030] printk: console [ttyS0] disabled
[    0.283280] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6250000) is a 16550A
[    0.638106] printk: console [ttyS0] enabled
[    0.664191] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 25, base_baud = 6250000) is a 16550A
[    0.695049] 1c25800.serial: ttyS2 at MMIO 0x1c25800 (irq = 26, base_baud = 6250000) is a 16550A
[    0.718225] loop: module loaded
[    0.724470] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.730382] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.736833] Creating 4 MTD partitions on "spi0.0":
[    0.741639] 0x000000000000-0x000000070000 : "u-boot"
[    0.749127] 0x000000070000-0x0000002b0000 : "kernel"
[    0.756534] 0x0000002b0000-0x000000530000 : "rom"
[    0.763563] 0x000000530000-0x000001000000 : "overlay"
[    0.771626] usbcore: registered new interface driver cdc_ether
[    0.777673] usbcore: registered new interface driver rndis_host
[    0.783662] usbcore: registered new interface driver cdc_subset
[    0.789645] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.796190] ehci-platform: EHCI generic platform driver
[    0.801682] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.807971] ohci-platform: OHCI generic platform driver
[    0.813612] usbcore: registered new interface driver usbserial_generic
[    0.820320] usbserial: USB Serial support registered for generic
[    0.826463] usbcore: registered new interface driver option
[    0.832087] usbserial: USB Serial support registered for GSM modem (1-port)
[    0.840560] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    0.846494] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    0.856353] hub 1-0:1.0: USB hub found
[    0.860240] hub 1-0:1.0: 1 port detected
[    0.866114] i2c /dev entries driver
[    0.871036] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.914704] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    0.924127] NET: Registered protocol family 17
[    0.939553] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[    0.951625] random: fast init done
[    0.959379] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    0.974369] devtmpfs: mounted
[    0.981132] Freeing unused kernel memory: 1024K
[    0.986113] Run /etc/preinit as init process
[    1.277227] random: crng init done
[    1.786305] watchdog: watchdog0: watchdog did not stop!
Mounting OverlayFS: [    1.964920] overlayfs: upper fs does not support tmpfile.
[    1.970338] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
OK
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [    2.834555] udevd[85]: starting version 3.2.9
[    3.244454] udevd[86]: starting eudev-3.2.9
done
Saving random seed: OK
Starting network: OK
APP Check:OK
Starting APP Start: /etc/init.d/S99-App: line 8: can't create /dev/watchdog: Resource busy
app/
app/start.sh
app/app
/etc/init.d/S99-App: line 8: can't create /dev/watchdog: Resource busy
Starting SQL init:
256+0 records in
256+0 records out
mke2fs 1.45.6 (20-Mar-2020)

Filesystem too small for a journal
Creating filesystem with 256 1k blocks and 32 inodes

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

mk sql.img OK
[    8.150982] EXT4-fs (loop0): mounted filesystem without journal. Opts: (null)
mount sql.img OK
SQL init end
OK

Welcome to zgtech
zgtech login:

离线

楼主 #10 2021-06-08 15:41:24

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

有没有串口终端日志?

用了busybox的watchdog立马复现

离线

楼主 #12 2021-06-08 16:10:33

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

日志里面没有看到 开启看门狗, 喂狗?

[    0.986113] Run /etc/preinit as init process
[    1.277227] random: crng init done
[    1.786305] watchdog: watchdog0: watchdog did not stop!
这里开启看门狗
PREINIT里面是watchdog -t 16000 /dev/watchdog

好几句
can't create /dev/watchdog: Resource busy
这个是echo 0 > /dev/watchdog
busybox的watchdog好像是独占的,用LINUX自带的watchdog才不会后台锁死这个文件,但是一样会死机

离线

楼主 #14 2021-06-08 16:20:43

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

死机之后是一点串口信息都没有?

没有,系统直接挂了的样子,板子上有一个led灯是heartbeat,这个灯也灭了。刚才试过拔掉调试串口,一样会死机,LED不亮了。但是板子上还有一个单片机通过串口连着F1C200,但是单片机只有RX也就是F1C200的TX被上拉

离线

楼主 #15 2021-06-08 16:22:07

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

死机之后是一点串口信息都没有?

看门狗时间到就死机,没到就可以继续操作终端,登入使用命令等等,和平时一样。用LINUX自带的看门狗工具没有复现这么快,但是也是会死机,10次大概1 2次,busybox的watchdog10次有9次死

离线

楼主 #16 2021-06-08 16:23:54

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

死机之后是一点串口信息都没有?

yikes yikes 欲哭无泪,芯片缺货涨价又疫情,接到单,却是不知道什么下场。。。。。。。。。。。。。。。。。。!!!!!!!!!!!!!!。。。。。。。。。。。。

离线

楼主 #18 2021-06-08 16:48:28

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

不用急,凡事都有解决方案。

看下这个有没有启发?


关于v3s在运行一段时间后偶发的直接硬件挂死
https://whycan.com/t_6572.html#p63931
(出处:哇酷开发者社区)

这几天看到过,我板子上也有USB连着4G模块,但是测试的时候我已经把他断开。而且我拿自己最小的开发板试过,就是EAXXXX电源接F1C200S,然后IO口全部拉出,之前在论坛发过图片 https://whycan.com/t_5636.html 。用这个板子一样,我基本确定不是外部干扰,最小系统因为没有灯所以连着串口线,而串口线的TX不接的话,就是F1C200S的RX不接(为了串口线的TX电流不流入F1C200),然后启动看门狗测试,过一段时间再接上TX,发送命令已经发送不了,说明已经死机。唯一的外部接线就是串口线的RX了。其他干扰都弄开了。主要还没找到关键点。

离线

楼主 #19 2021-06-08 16:51:26

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

不用急,凡事都有解决方案。

看下这个有没有启发?


关于v3s在运行一段时间后偶发的直接硬件挂死
https://whycan.com/t_6572.html#p63931
(出处:哇酷开发者社区)

另外芯片,淘宝买的,感觉应该是原装。。。。。。不用看门狗没什么问题,一开始做产品觉得看门狗这些细节放最后,没想到最后出事故了。。。。。。。想过外部看门狗,但是想想消费类的没这么恐怖,。。。ARM独立看门狗应该算成熟,准备工业类的加个外部看门狗,但是看到上面的帖子又有点慌。。。。因为做工作高压的,周边都是15KV环境,还有一个板载4G模块,感觉这料铁定吃不消

离线

楼主 #20 2021-06-08 16:59:42

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

不用急,凡事都有解决方案。

看下这个有没有启发?


关于v3s在运行一段时间后偶发的直接硬件挂死
https://whycan.com/t_6572.html#p63931
(出处:哇酷开发者社区)

这里有一个大区别,我按RST脚可以复位,他那个不行

离线

楼主 #22 2021-06-08 22:07:07

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

你在串口终端执行 reboot 看能否重启


你可以在看门狗驱动的restart那里加调试语句。


今天确定了一件事情, linux的reboot命令到最后会调用看门狗的restart函数重启
https://whycan.com/t_5521.html
(出处:哇酷开发者社区)

死机的时候串口是没法发送命令的

离线

楼主 #24 2021-06-08 22:44:27

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

@lonerwolf
平时执行,不是死机时候。

因为reboot就是开看门狗自杀的

平时都没问题的,刚开始做的时候就试过看门狗,不过就是打开看看能不能复位,没有像现在这样一个个功能仔细测试

离线

楼主 #25 2021-06-10 01:34:02

lonerwolf
会员
注册时间: 2020-09-02
已发帖子: 59
积分: 56.5

Re: F1C200S看门狗死机

哇酷小二 说:

@lonerwolf
平时执行,不是死机时候。

因为reboot就是开看门狗自杀的

。。。。。。。。。把主频拉到600M,就没出现过。。。。。已经搞不懂了。。。408M太容易死了,看门狗驱动加printk,死机的时候没法打印

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn