Askey RAC2V1K / RT4230W REV6 Support

@eganov Run this in uboot:
nand erase 0x2400000 0xDC00000

@lmore377 -
here is the log from attempted sysupgrade on RAC2V1K stock with your sysupgrade.bin. appears to write to 2 partions, but fails:

sysupgrade fails from stock RAC2V1K.

Like I said a few messages back, I defined a different mtd layout in openwrt because if I didn't then we would only have half of the nand space we have now. I have a new router coming in soon so you don't really need to do any more testing

1 Like

Ok — thank you so much

Sent using the GMX mail app

I did nand erase per your instruction.
result;

(IPQ) # nand erase 0x2400000 0xDC00000

NAND erase: device 0 offset 0x2400000, size 0xdc00000
Skipping bad block at 0x0b160000
Erasing at 0xffe0000 -- 100% complete.

I have learned lots from you, Thank you
I have a smaller capacity left than yours 230Mb
is it caused by the badblock?

I am just wondering if I have same uboot like yours?
Mine is Uboot with OpenWrt GCC 5.2.0 r35193

U-Boot 1.0.6 [spf.5.0.2_csu1.1] (Nov 15 2018 - 03:26:55)
arm-openwrt-linux-uclibcgnueabi-gcc (OpenWrt GCC 5.2.0 r35193) 5.2.0
GNU ld (GNU Binutils) 2.24.0

after erase and power-cycle
put your initramfs.bin again and bootm

(IPQ) # tftpboot initramfs.bin
Using eth0 device
TFTP from server 192.168.0.118; our IP address is 192.168.0.13
Filename 'initramfs.bin'.
Load address: 0x44000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#############################
done
Bytes transferred = 6138765 (5dab8d hex)
(IPQ) # bootm

It was booting but after power off or reboot, it came back to uboot again
below with volume kernel not found

U-Boot 1.0.6 [spf.5.0.2_csu1.1] (Nov 15 2018 - 03:26:55)

smem ram ptable found: ver: 0 len: 5
DRAM: 1003 MiB
setting 0x177e as machine type from smem
NAND: SF: Unsupported manufacturer 00
ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
256 MiB
MMC:
PCI0 Link Intialized
PCI1 Link Intialized
In: serial
Out: serial
Err: serial
MMC Device 0 not found
cdp: get part failed for 0:HLOS
Net: MAC0 addr:7c:db:98:xx:xx:xx
athrs17_reg_init: complete
athrs17_vlan_config ...done
S17c init done
MAC1 addr:7c:db:98:xx:xx:xx
eth0, eth1
Hit space key to stop autoboot: 0
Creating 1 MTD partitions on "nand0":
0x000002400000-0x000010000000 : "mtd=0"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=0"
UBI: MTD device size: 220 MiB
UBI: number of good PEBs: 1759
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1738
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
Volume kernel not found!
UBI: mtd1 is detached from ubi0

thank you so much

@lmore377 this is the serial console log after bootm

https://pastebin.com/5X3VE4QE

found

[ 1.544615] mtd: partition "ubi" extends beyond the end of device "qcom_nand.0" -- size truncated to 0xdc00000

@eganov that warning about the nand is fine because the sac2v1k has a smaller nand. Did you change the bootm command to the one on GitHub and do the sysupgrade from initramfs?

yes I did below is my env

(IPQ) # printenv
baudrate=115200
bootargs=console=ttyMSM0,115200n8 ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs uboot-version=1.0.6 rea=ffffffff time=ffffffff ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs uboot-version=1.0.6 rea=ffffffff time=ffffffff\

bootcmd=setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0xDC00000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm
bootdelay=2
eth1addr=7c:db:98:xx:xx:xx
ethact=eth0
ethaddr=7c:db:98:xx:xx:xx
fdt_high=48000000
fdtaddr=0
fsbootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs
ipaddr=192.168.0.13
machid=177e
mtddevname=fs
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x6300000@0x2400000(fs),0x6300000@0x8700000(fs_1),
partition=nand0,0
reboot-reason=rea=ffffffff
reboot-time=time=ffffffff
serverip=192.168.0.118
stderr=serial
stdin=serial
stdout=serial
uboot-version=uboot-version="1.0.6

after initramfs & bootm, It was booting / load the kernel , but after power off or reboot, it came back to uboot again
below with volume kernel not found

is it caused by bad block nand?

U-Boot 1.0.6 [spf.5.0.2_csu1.1] (Nov 15 2018 - 03:26:55)

smem ram ptable found: ver: 0 len: 5
DRAM: 1003 MiB
setting 0x177e as machine type from smem
NAND: SF: Unsupported manufacturer 00
ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
256 MiB
MMC:
PCI0 Link Intialized
PCI1 Link Intialized
In: serial
Out: serial
Err: serial
MMC Device 0 not found
cdp: get part failed for 0:HLOS
Net: MAC0 addr:7c:db:98:xx:xx:xx
athrs17_reg_init: complete
athrs17_vlan_config ...done
S17c init done
MAC1 addr:7c:db:98:xx:xx:xx
eth0, eth1
Hit space key to stop autoboot: 0
Creating 1 MTD partitions on "nand0":
0x000002400000-0x000010000000 : "mtd=0"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=0"
UBI: MTD device size: 220 MiB
UBI: number of good PEBs: 1759
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1738
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
Volume kernel not found!
UBI: mtd1 is detached from ubi0

The bad nand block shouldn't really affect anything. My router had 2 bad blocks and it was fine. Can you try running these commands in uboot? They should clear out unnecessary environment variables

setenv fdt_high
setenv fdtaddr
setenv fsbootargs
setenv rootfstype
setenv mtddevname
setenv mtddevnum
setenv mtdids
setenv mtdparts
setenv partition
saveenv

Cleaned up env per your instruction

(IPQ) # printenv
baudrate=115200
bootargs=console=ttyMSM0,115200n8 ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs uboot-version=1.0.6 rea=ffffffff time=ffffffff\

bootcmd=setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0xDC00000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm
bootdelay=2
eth1addr=7c:db:98:xx:xx:xx
ethact=eth0
ethaddr=7c:db:98:xx:xx:xx
ipaddr=192.168.0.13
machid=177e
mtddevname=firmware
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0xDC00000@0x2400000(firmware)
partition=nand0,0
reboot-reason=rea=ffffffff
reboot-time=time=ffffffff
serverip=192.168.0.118
stderr=serial
stdin=serial
stdout=serial
uboot-version=uboot-version="1.0.6

Environment size: 745/262140 bytes
(IPQ) #

nand erase again

I did
tftpboot initramfs.bin
bootm it boot to kernel
but after power-cycle or reboot at root prompt, it came back to

Volume kernel not found!
UBI: mtd1 is detached from ubi0
(IPQ) #

bootm again and went to sysupgrade process

mount /dev/sda1 /mnt 
cd /mnt
sysupgrade -F openwrt-ipq806x-generic-askey_rt4230w-rev6-squashfs-nand-sysupgrade.bin

it booted successfully and reboot from root working too

Could you please check the log?

https://pastebin.com/Hu42t9Pm

Thank you

I don't know why on, initramfs.bin process did not pickup the kernel

Log seems all good. Booting the initramfs doesn't actually flash openwrt, it just copies the image to ram and boots from there so the sysupgrade is needed to actually flash openwrt to nand.

@efsg is it fine if I put the zip file from your post on getting root to my github?

Edit: I'm going to for now, but just tell me if you want me to take it down.

No problem, thanks for your work !

I figured out how to flash the RAC routers without opening them. Instructions are on the GitHub page 2 posts up. This won't work for SAC routers unfortunately

Mine is RAC but comes with 256MiB, I could get SSH access via replacing cfg, Thank you @efsg and you @lmore377 especially for this work

I would use this router mostly for VPN client

I would test this router for OpenVPN and wireguard

I have a question for error installing the package

root@OpenWrt:/# opkg install openvpn-openssl
Installing openvpn-openssl (2.4.9-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/openvpn-openssl_2.4.9-2_arm_cortex-a15_neon-vfpv4.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for openvpn-openssl:
 *      kernel (= 5.4.51-1-f1ba5f160e845c56039a1df0e340fe27)
 * opkg_install_cmd: Cannot install package openvpn-openssl.
root@OpenWrt:/#

is it related to snapshot which no longer current? I am so novice with Openwrt basically

is it possible you can build the firmware from master?
I am referring to the same question from other thread
[SOLVED]Broken OpenVPN dependencies in current snapshot(Kernel panic)

Thank you again

1 Like

Thank you tmomas and that link add my knowledge

I have to learn building the firmware by myself one day, I need to find the correct toolchain and dtb/dts for my board.

I hope I can see the update soon in this

https://openwrt.org/toh/views/toh_fwdownload?dataflt[Brand*~]=askey

@eganov tell me what packages you want and I'll build an image for you. That error is happening because the packages in the official opkg repo are rebuilt every day so they're newer than the image. Try installing again with --nodeps on the opkg command

Thank you very much @lmore377
I would like to have

nano
luci-app-sqm
kmod-tun
openvpn
openvpn-openssl
luci-app-openvpn
luci-i18n-openvpn-en
ip-full

kmod-wireguard
wireguard
wireguard-tools
luci-app-wireguard
luci-i18n-wireguard-en
luci-proto-wireguard

all packages in this repo if possible

I don't know my request above kind of too much and are overlapping

Thank you again

Do you mean you want all the packages there? or you just want them to come from there