Adding support for Wise Tiger RT-8501 (current issue: kernel panic)

Attempting to add support for a cheap Chinese router I had lying around, the Wise Tiger RT-8501. It comes pre-loaded with a modified snapshot of OpenWRT, which I'm trying to replace with a full-featured build. I'll update this post with progress.

Current Problem: Kernel panic when booting initramfs image from TFTP

Kernel Panic Log
Flash Layout Information
DTS File
Stock Firmware Bootlog

The DTS file is mostly copied from mt7620a_dlink_dir-510l.dts due to the similarities between the two devices. I could use another set of eyes on the flash portion; if I had to guess where the problem was coming from, I'd guess there.

My second guess would be the fact that I've directly edited the flash memory chip with a CH341A USB Programmer. The boot delay parameter originally had no number defined for it, preventing me from attempting a boot from TFTP. I changed a . to 5, and now it exhibits some unusual behavior (throwing additional errors on startup, going into a kernel panic after a poweroff command) but still works fine when booted normally. I could try reverting those changes, but then I'd have to figure out how to get access to U-Boot by other means.

My final guess would be that the initramfs image isn't being successfully transferred over TFTP or loaded at all and I'm totally misinterpreting this output.

Grateful for any guidance or suggestions!

Device Details

  • SoC: MediaTek MT7620A
  • Flash: 8 MiB (Macronix MX25L6433F)
  • RAM: 64 MiB (Winbond W9751G6KB-25)
  • Ethernet: 5x 10/100 Mbps (4x LAN, 1x WAN)
  • WiFi: dual band, 802.11bgn + 802.11ac

Photos

how are you loading it to TFTP exactly?

we need a full kernel log... I cannot tell where in the boot process it is failing. It is possible that the kernel is too large to decompress so you have to load an uncompressed or gzip compressed image

if you have serial access then you probably have u-boot access, but they don't tell you this in the console

for example if you are selecting option 2 to load an image over TFTP, options 3 and 4 and 5 may exist but are not printed on screen

edit: the flash node with the partitions has no effect when booting initramfs from TFTP

2 Likes

boot delay is probably not required to interrupt boot. what you have to do is hold whatever key you need to hold while powering the board

also you should have replaced '.' with '5.'

the period (0x20 in hex) denotes the end of the variable, so you might now have a uboot environment variable that is mashed up with another one and might look like this

bootdelay=5stderr=serial

edit: however, the uboot environment is probably not being used anymore, because it is protected by a checksum. When you change a value, a new checksum must be written at the start of the partition. I recommend you put it back if you have a copy of the original uboot environment

1 Like

Goes to show I should think a little harder before trying clever solutions like directly editing memory. I was basing my process off the techniques applied in this thread.

I got past the kernel panic issue, which I think was actually the result of incorrectly-configured TFTP settings. Now I've got a working initramfs image, but attempting to load and write a squashfs image just causes a reboot with no apparent changes. Here are the full boot logs including the U-Boot portion.

initramfs Boot Log
squashfs Boot Log

Luckily the byte I edited was followed by a . (0x20), so I don't think it caused that large of a problem.

Probably it's not safe to rely on the bootloader to write to flash for you...

ideally, you should be able to get TFTP server started by holding reset while powering on...

last resort, test as much as you can on initramfs then do a sysupgrade from the initramfs image, adding LuCI to the build helps

before doing the sysupgrade you should use LuCI to copy all MTD partitions just in case

you can try to add uboot-env support for the board as well by editing this file
package/boot/uboot-envtools/files/ramips
you also have to add uboot-envtools to DEVICE_PACKAGES in the makefile

then you can make sure the uboot env is clean by overwriting it with the correct values (make sure you have a copy of it first)
in openwrt the commands are
fw_printenv
fw_setenv
be aware that fw_setenv will write to flash right away, compared to uboot which uses an extra command for committing to flash saveenv

again make sure you have a copy first
syntax is like this for each variable
fw_setenv bootdelay 5

however at the end you should find a way to upgrade this without serial console, so that other users can easily replicate the process

1 Like

This is great information, thanks. Going to continue experimenting with the initramfs image to figure things out.

(NOTE: Two edits at bottom of post.)

Well, onto the next problem: when using the initramfs image, I can't get it to connect to my network or communicate with my PC via direct ethernet connection.

initramfs Boot Log
uci show Output

My network settings should be correct, but I could be missing something. I've got my home network's main router (a TP-Link Archer C2 running stock firmware) connected to LAN port 4 of the device, and my laptop connected to LAN port 2.

Wise Tiger IP: 192.168.0.3
Stock Router IP: 192.168.0.1
Laptop IP: 192.168.0.102 (wireless), 192.168.0.5 (wired)

Output from ifconfig below.

root@OpenWrt:/# ifconfig
eth0      Link encap:Ethernet  HWaddr CE:70:18:19:5A:65
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::cc70:18ff:fe19:5a65/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3784 errors:0 dropped:5 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:715007 (698.2 KiB)  TX bytes:12078 (11.7 KiB)
          Interrupt:5

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:650 errors:0 dropped:0 overruns:0 frame:0
          TX packets:650 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53520 (52.2 KiB)  TX bytes:53520 (52.2 KiB)

EDIT 1:

Decided to try the mt7620 evaluation board initramfs image for the hell of it, and the device connects to everything just fine from there. Got LuCI installed and running. I'm guessing I should compare boot logs or see what packages might be missing from my firmware, but I only did this a few minutes ago so I haven't had time yet.

MT7620 Evaluation Board initramfs Boot Log


EDIT 2:

Boot Log Differences: Custom vs. Eval Board

The only differences in installed packages shown by opkg list-installed are the following which appear only on the custom firmware:

  • kmod-mt76-core - 5.4.85+2020-12-18-4a90fdf6-4
  • kmod-mt76x0-common - 5.4.85+2020-12-18-4a90fdf6-4
  • kmod-mt76x02-common - 5.4.85+2020-12-18-4a90fdf6-4
  • kmod-mt76x0e - 5.4.85+2020-12-18-4a90fdf6-4

looks like you have issues with your DTS or with the makefile where you added the profile for this board

I suggest looking at other commits for boards with MT7620A and try a bunch of things until it works

Thought that might be it. Is there something in particular that points to the DTS or profile being the issue?

no I don't know which one...I have no experience with MT7620

I would just compare both DTS and the profile with other devices...

I started out with the DTS and profile being more or less copied from another similar device with a few small modifications. I compared it to the DTS and profile for the eval board, and made some more changes to my files to bring my entries closer in line with the eval board's. Same results. I'll take another look soon.

Is there anything else it could be? Something that was included in the eval board firmware image when it was built? The installed packages seem to be almost identical on both images (based on opkg list-installed), but I don't know if there are other differences located elsewhere that might have an impact.

Hi! i have the same router and i was looking to flash an openwrt based firmware, because i dont trust the one that came stock.
I think these routers original brand is Phicomm (as seen on the power adapter) and the model is K2. Though the firmware that comes with Phicomm's routers is different but the hardware is pretty much the same.
I watched this video of a guy installing openwrt in a Phicomm k2 router via Breed.
@WiredLuddite have you figured it out how to flash OpenWrt in this Wise Tiger router? if not could you please resume this project.