Cudy AP3000 Indoor AKA Jupiter 2 and OpenWRT

wiki.TerraBase.info
Revision as of 18:03, 25 March 2025 by Root (talk | contribs)
Jump to navigation Jump to search

Installing OpenWRT on Cudy AP3000 via Serial + XMODEM

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:

Item Value
DRAM Start 0x40000000
DRAM Size 0x20000000 (512 MiB)
U-Boot Relocated Addr ~0x5ff38000
Reserved Region 0x5f7fb170 – 0x5fffffff

Safe RAM Load Addresses

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)

setenv bootcmd
setenv bootdelay -1
loadx 0x42000000

On Host PC

Assuming `/dev/ttyUSB0` is your serial device:

sx -vv openwrt-mediatek-filogic-cudy_ap3000-initramfs-kernel.bin < /dev/ttyUSB0 > /dev/ttyUSB0

Image Inspection in U-Boot

iminfo 0x42000000

Result:

  • FIT image detected
  • Kernel: LZMA compressed, load/entry address: 0x48000000
  • initrd and FDT present and hash-verified

Booting the Image

bootm 0x42000000

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):

  1. Connect to LuCI via web browser (default IP: 192.168.1.1)
  2. Navigate to System → Backup / Flash Firmware
  3. Upload the permanent OpenWRT SquashFS image (`*-squashfs-sysupgrade.bin`)
  4. Choose "Do not keep settings"
  5. 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.