Cudy AP3000 Indoor AKA Jupiter 2 and OpenWRT: Difference between revisions

Created page with "Hello <br />"
 
mNo edit summary
Line 1: Line 1:
Hello
= Installing OpenWRT on Cudy AP3000 via Serial + XMODEM =


<br />
== Overview ==
This page documents the manual serial-based installation of OpenWRT on a Cudy AP3000 using U-Boot and XMODEM transfer. It covers bypassing non-functional network booting, uploading an initramfs image over serial, booting it safely, and flashing the permanent OpenWRT SquashFS image from within the running RAM environment.
 
== Hardware Setup ==
* Target Device: Cudy AP3000 (MediaTek MT7981 SoC)
* Access: Serial console via FTDI or CH340 USB-UART adapter
* Host OS: Rocky Linux 9 (also applicable to any Linux distro with ckermit/lrzsz)
* Tools used: `sx`, `loadx`, `iminfo`, `bootm`, `LuCI`
 
== U-Boot Setup and Memory Layout ==
From `bdinfo` output:
 
{| class="wikitable"
|-
! Item !! Value
|-
| DRAM Start || 0x40000000
|-
| DRAM Size || 0x20000000 (512 MiB)
|-
| U-Boot Relocated Addr || ~0x5ff38000
|-
| Reserved Region || 0x5f7fb170 – 0x5fffffff
|}
 
=== Safe RAM Load Addresses ===
 
{| class="wikitable"
|-
! Label !! Address !! Offset (from 0x40000000) !! Status
|-
| Known Good || 0x42000000 || 32 MB || ✅ SAFE
|-
| Default (`loadaddr`) || 0x46000000 || 96 MB || ✅ OK (tight)
|-
| High (bad) || 0x48000000 || 128 MB || ❌ Caused crash on decompression
|}
 
== Uploading OpenWRT initramfs FIT image ==
 
=== In U-Boot (via serial) ===
<syntaxhighlight lang="bash">
setenv bootcmd
setenv bootdelay -1
loadx 0x42000000
</syntaxhighlight>
 
=== On Host PC ===
Assuming `/dev/ttyUSB0` is your serial device:
<syntaxhighlight lang="bash">
sx -vv openwrt-mediatek-filogic-cudy_ap3000-initramfs-kernel.bin < /dev/ttyUSB0 > /dev/ttyUSB0
</syntaxhighlight>
 
=== Image Inspection in U-Boot ===
<syntaxhighlight lang="bash">
iminfo 0x42000000
</syntaxhighlight>
 
Result:
* FIT image detected
* Kernel: LZMA compressed, load/entry address: 0x48000000
* initrd and FDT present and hash-verified
 
== Booting the Image ==
<syntaxhighlight lang="bash">
bootm 0x42000000
</syntaxhighlight>
 
This succeeded once the image was loaded at `0x42000000` — avoiding the earlier problem of overlapping the kernel decompress target address `0x48000000`.
 
== Permanent Installation ==
After booting into OpenWRT RAM (initramfs):
 
# Connect to LuCI via web browser (default IP: 192.168.1.1)
# Navigate to ''System → Backup / Flash Firmware''
# Upload the permanent OpenWRT SquashFS image (`*-squashfs-sysupgrade.bin`)
# Choose "Do not keep settings"
# Flash the image and reboot
 
== Final Result ==
OpenWRT was permanently installed on flash using the SquashFS image, without requiring a network or TFTP boot. All steps were performed over a serial console with full visibility into memory layout and safe load addresses.
 
== Notes ==
* Always verify the image format (`iminfo`) before booting.
* Do not load images to `0x48000000` if that is also the decompress target.
* To make this repeatable, avoid saving `bootcmd` unless a custom autoboot is configured.