OpenWrt 19.07 halted on MT7628/MT7688 when wdt reset occured

I compile openwrt19.07 for MT7628/MT7688(128MB RAM,32MB W25Q256FV Flash,module made by Hi-Link).
"reboot" works well,but the system halted when I pressed reset button(link to PERST) and wdt reset occured.Everything stopped rightnow when pressing the key or wdt reset occured.
Its completely normal with firmware provided by producer.
I think the reason might be spi flash address mode.I tried to find a place to add code changing flash address mode form 4Byte to 3Byte before reboot,but I didnt success.
May somebody help me?

Ask the vendor how to switch bootstrap configuration for booting in 4-byte address mode (if they did it correctly then it would be probably just a matter of moving one resistor to a different position). Then first switch permanently Winbond flash to 4-byte mode (see: https://www.winbond.com/resource-files/w25q256fv%20revi%2002262016%20kms.pdf, page 19, "Power-Up Address Mode (ADP)") and board to boot in 4-byte mode afterwards. There aren't any other, reliable and pure software solutions for this problem.

I guess the hardware is fine, because it works well using firmware base on openwrt14 provided by MTK.
I have checked the code about spi flash driver,and I compiled new uboot adding printf before probing spi flash,but it just halted immediately without any printout when rst was pressed,I realized that it didnt even enter uboot.
I also compiled openwrt15.05,and the same problem exists.
I have not figured it out right now.I suspect if it goes to wrong address when hard reset happened.
Do you have more advice? :sweat_smile:

I found that the problem may occur near here.Maybe 8250/16550 driver? :face_with_monocle:

[    0.613227] PCI: CLS 0 bytes, default 32
[    0.625638] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.646939] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.658362] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.695841] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.707082] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.718281] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.729524] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.743277] printk: console [ttyS0] disabled
[    0.751699] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.769508] printk: console [ttyS0] enabled
[    0.769508] printk: console [ttyS0] enabled
[    0.785990] printk: bootconsole [early0] disabled
[    0.785990] printk: bootconsole [early0] disabled
[    0.805277] 10000d00.uart1: ttyS1 at MMIO 0x10000d00 (irq = 29, base_baud = 2500000) is a 16550A
[    0.824115] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.851153] spi-nor spi0.0: w25q256 (32768 Kbytes)
[    0.860708] 4 fixed-partitions partitions found on MTD device spi0.0

Have you checked how is the board configured? Booting from SPI NOR in 3- or 4-byte mode?

I finally figured it all out .
The problem is indeed the flash addressing mode.I have not been able to figure out why there is no problem with the firmware provided by the manufacturer,because it doesn’t use 4B mode at all :sob:.It just said that there are 32M, but only half of 32M is actually used.
Thank you very much for your help :slightly_smiling_face:.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.