Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:zyxel:p-2812hnu-f1 [2022/04/08 18:50] – [Replacement of factory U-Boot] mafketeltoh:zyxel:p-2812hnu-f1 [2022/10/04 13:35] – [Installing OpenWrt] minor fixes linus
Line 55: Line 55:
  
 You need the following files: You need the following files:
-  - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_ram/openwrt-lantiq-p2812hnufx_ram-u-boot.asc|openwrt-lantiq-p2812hnufx_ram-u-boot.asc]]   Right click the 'raw' button, and do 'save as'.+  - [[https://downloads.openwrt.org/releases/22.03.0/targets/lantiq/xrx200/u-boot-p2812hnufx_ram/u-boot.asc|u-boot.asc]] Right click the 'raw' button, and do 'save as'.
   - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_nandtpl/openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img|openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img]]   - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_nandtpl/openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img|openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img]]
  
Line 61: Line 61:
 and [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/calibration%20data/RT3062.eeprom|wifi calibration data]] (RT3062.eeprom) as well. and [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/calibration%20data/RT3062.eeprom|wifi calibration data]] (RT3062.eeprom) as well.
  
-Power of board.+Power off the board.
  
-Short the (R17) bootsel_1 and power on the router. +Short the (R17) bootsel_1 and power on the router. The usual method is to use a small flat screwdriver to short this while powering on the router.
  
 When CFG 02 UART Popups in terminal You can disconnect/revert bootsel pin to normal or you can wait till the end of process. When CFG 02 UART Popups in terminal You can disconnect/revert bootsel pin to normal or you can wait till the end of process.
Line 72: Line 72:
 </file> </file>
  
 +Upload the U-Boot RAM image ([[https://downloads.openwrt.org/releases/22.03.0/targets/lantiq/xrx200/u-boot-p2812hnufx_ram/u-boot.asc|u-boot.asc]]) using a
 + [[docs:techref:hardware:port.serial.cables|serial cable]] (baud 115200)
  
-Upload U-Boot RAM image ([[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_ram/openwrt-lantiq-p2812hnufx_ram-u-boot.asc|openwrt-lantiq-p2812hnufx_ram-u-boot.asc]]) using a +  * If you used cutecom for Linux, issue „Send File” 
- [[docs:techref:hardware:port.serial.cables|serial cable]] (baud 115200) via „Send File”cutecom for linux. This will take a minute or so. On windows there are some more caveats, you can try terraterm first, if it does not work, which is indicated by * signs appearing on the prompt try to set a transmit delay of 1 msec/char. If that makes the upload excruciatingly slow try realterm with the same settings. It still won't be fast but cuts the waiting game from multiple hours to about 20 minutes.  +  * If you're using Minicom, you can suspend or quite minicom after seeing the message above, then issue the upload from the command line''ascii-xfr ---u-boot.asc > /dev/ttyUSB0''then return or restart Minicom. 
-Wait for U-Boot to load and stop auto-boot process.+ 
 +This will take a minute or so. 
 + 
 +On windows there are some more caveats, you can try terraterm first, if it does not work, which is indicated by * signs appearing on the prompt try to set a transmit delay of 1 msec/char. If that makes the upload excruciatingly slow try realterm with the same settings. It still won't be fast but cuts the waiting game from multiple hours to about 20 minutes.  
 + 
 +After uploading the ''u-boot.asc'' file, wait for U-Boot to load and stop auto-boot process.
  
 <file> <file>
Line 168: Line 175:
 Bytes transferred = 231813 (38985 hex) Bytes transferred = 231813 (38985 hex)
 </file> </file>
 +
 +If tftp is not working for you, you can also upload the u-boot image over the serial port using ''loady'' and then send the file using zmodem, e.g. in Minicom Ctrl+A followed by S, then select zmodem and the u-boot.img file.
  
 **Step 5**: Type in console **Step 5**: Type in console
Line 221: Line 230:
 mtdparts add nand0 - ubi mtdparts add nand0 - ubi
 setenv ethaddr XX:XX:XX:XX:XX:XX setenv ethaddr XX:XX:XX:XX:XX:XX
-setenv nboot 'nand read 0x80800000 0x60000 0x300000; bootm 0x80800000'+setenv nboot 'nand read 0x81000000 0x60000 0x300000; bootm 0x81000000'
 setenv bootcmd 'run nboot' setenv bootcmd 'run nboot'
 saveenv saveenv
Line 232: Line 241:
 Writing to NAND... OK Writing to NAND... OK
 </file> </file>
- 
-(DGDodo, I've seen good working v21.02.0 with only the setenv-commands used + saveenv, no mtd settings adjusted!) (Mafketel these are mostly cosmetic settings the mtd sizes are hardcoded while compiling the kernel) 
- 
-Note: Starting with kernel 5.10 decompressing the kernel may take more space and will result in an overwrite error. 
-To make more space replace the nboot command above with: 
-<code> 
-setenv nboot 'nand read 0x81000000 0x60000 0x300000; bootm 0x81000000' 
-</code> 
  
 Continue further below Continue further below
 ==== Installing OpenWrt ==== ==== Installing OpenWrt ====
-At the present timethe recent openwrt releases do not include the proper initramfs image. A working version is available at ScApi 's github, see aboveAt the end we will upgrade to the latest openwrt version.+To install OpenWrt into the NAND flashyou first have to boot an initramfs image. This is a version of the OpenWrt (with linux kernel and root filesystem) that executes only from RAMYou will use this to flash the resident version of OpenWrt into the NAND flash.
  
-NOTES: Future upgrades can be done by flashing *sysupgrade.bin from web interface.+At the present time, the recent OpenWrt releases do not include a working initramfs image. Normally this would be the files named ''zyxel_p-2812hnu-f1-initramfs-kernel.bin'' but these files in the release folders are broken. A working version is available at ScApi 's github, see above. At the end we will upgrade to the latest openwrt version. 
 + 
 +NOTES: After flashing the NAND from the initramfs, future upgrades can be done by flashing ''zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin'' from each release through the web interface.
  
 **Step 1**: Place [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs|openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs]] in your tftp folder **Step 1**: Place [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs|openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs]] in your tftp folder
  
-**Step 2**: Set Your IP addres to "192.168.1.2" and start tftp server. See also above for instructions.+**Step 2**: Set Your IP address to "192.168.1.2" and start tftp server. See also above for instructions
 + 
 +**Step 3**: Upload the initramfs image.
  
-**Step 3**: Upload initramfs image 
  tftpboot openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs  tftpboot openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs
 <file> <file>
Line 273: Line 277:
 </file> </file>
  
 +If tftp is not working for you, you can also upload the initramfs image over the serial port using ''loady'' and then send the file using zmodem, e.g. in Minicom Ctrl+A followed by S, then select zmodem and the ''openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs'' file. The file is a few megabytes so this will take some time.
  
-**Step 4**: Run initramfs image and wait till fully booted and press Enter to activate the console+**Step 4**: Run the initramfs image and wait till fully booted and press Enter to activate the console
  bootm $fileaddr  bootm $fileaddr
  
Line 306: Line 311:
 </file> </file>
  
 +**Step 5**: Obtain and flash flash this image **first**:
  
-**Step 5**set root passwd.+  [[https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]]
  
- passwd  root -d yoursecretpassword +If you use a newer image there will be erase block errors when writing the image.
-**Step 6**: Log into the modem on the web interface and go to System flash firmware and flash up to and including 18 release, if you want to install snapshots or 19 and above you need to increase the space reserved for the kernel. You do this by installing this image first https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin and then go back into the web interface and flash the one you want.+
  
-(OpenWrt v21.02.0: **BEFORE** flashing to v21.02.0, really make sure you have set u-boot environment to 3MB kernel, otherwise your device get bricked and can only be fixed with TTL-serial, i.e. you have to open the device and connect TTL-serialThe above mentioned firmware does **NOT** adjust this setting!)+Log into the modem on the web interface and go to System flash firmware.
  
-This assumes that your are able to enter the webinterface, if this does not workyou can continue in the serial console this way. +This assumes that your are able to enter the webinterface, if this does not workyou can use the serial console: upload ''openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin'' to /tmp using ''scp'' or ''wget''':
-If not use Linux scp or [[https://winscp.net/eng/download.php|WinSCP]] to upload [[http://downloads.openwrt.org/releases/18.06.2/targets/lantiq/xrx200/openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]] to /tmp.+
  
-         sysupgrade -n /tmp/openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin+         cd /tmp 
 +         scp user@192.168.1.N:openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 +         sysupgrade -n openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin
  
-**Step 7**: the router Reboots itself+Since the Dropbear SSH version in the initramfs is quite old, this can lead to problems because new SSH servers will not accept the algorithms it supports. 
 + 
 +Alternatively (if you have a web server on your 192.168.1.N machine): 
 + 
 +         cd /tmp 
 +         wget http://192.168.1.N/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 +         sysupgrade -n openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 + 
 +You probably need a local web server that can use plain HTTP on port 80 because the initramfs image cannot handle SSL. 
 + 
 +**Step 6**: the router Reboots itself
  
 <file> <file>
Line 418: Line 434:
 -------------------------------------------------- --------------------------------------------------
 </file> </file>
-(DGDodoAlthough this last log is still running 2MB kernel image, not **3MB**! 'NAND read: device 0 offset 0x60000, size 0x200000'.)+ 
 +**Step 7**upgrade to the latest working release of OpenWrt 
 + 
 +The last known working version of OpenWrt for this router is the 21.02.3 release: 
 + 
 +  [[https://downloads.openwrt.org/releases/21.02.3/targets/lantiq/xrx200/openwrt-21.02.3-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-21.02.3-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]] 
 + 
 +The 22.03.0 version will brick the router and you have to reinstall from initramfs. (Back to **step 3**...) 
 ==== WIFI on openwrt ==== ==== WIFI on openwrt ====
 For as long as the standard installation deletes the whole NAND, the information the wifi drivers need to start the chip are lost. For as long as the standard installation deletes the whole NAND, the information the wifi drivers need to start the chip are lost.
  • Last modified: 2024/12/08 19:19
  • by idwv