D-Link DIR-320 H/W Ver.: B1

This device is NOT RECOMMENDED for future use with OpenWrt due to low flash/ram.
DO NOT BUY DEVICES WITH 4MB FLASH / 32MB RAM if you intend to flash an up-to-date and secure OpenWrt version onto it! See 4/32 warning for details.

1) This device does not have sufficient resources (flash and/or RAM) to provide secure and reliable operation.
This means that even setting a password or changing simple network settings might not be possible any more, rendering the device effectively useless. See OpenWrt on 4/32 devices what you can do now.

2) OpenWrt support for this device has ended in 2022.
19.07.10 was the last official build for 4/32 devices.

Please check out the article flash.layout. It contains an example and a couple of explanations.

  1. Get the firmware from here
  2. Plug off power cable
  3. Press and hold “reset” button
  4. Plug on power cable, wait for 15 seconds
  5. Setup your network manually: IP 192.168.0.2 MASK 255.255.255.0
  6. Enter web interface 192.168.0.1
  7. Chose your .bin file and submit reflashing
  8. Setup your network to get options by DHCP
  9. Wait until power led will light

Windows script using failsafe UI & curl

@echo off
set firmware=fw.bin
set router=192.168.0.1
echo ===========================================================================
echo This batch file will upload %firmware% in the current directory to
echo %router% during the router's bootup.
echo.
echo * Set your ethernet card's settings to:
echo      IP:      192.168.0.10
echo      Mask:    255.255.255.0
echo      Gateway: 192.168.0.1.
echo * Unplug the router's power cable.
echo.
echo Press Ctrl+C to abort or any other key to continue...
pause > nul
echo.
echo * Press & hold reset button.
echo * Re-plug the router's power cable.
echo * Wait 10-15 seconds, then release reset button.
echo.
echo ===============================================================================
echo Waiting for the router... Press Ctrl+C to abort.
echo.

:ping
ping -n 1 -w 50 %router% | find "TTL="
if errorlevel 1 goto ping

echo curl -v -0 --retry 100 --form firmware=@%firmware% -o %temp%\curl_out.tmp --progress-bar http://%router%
curl -v -0 --retry 100 --form firmware=@%firmware% -o %temp%\curl_out.tmp --progress-bar http://%router%
if errorlevel 1 goto ping
echo.
echo ===============================================================================
echo * WAIT for about 2 minutes while the firmware is being flashed.
echo * The default router address will be at 192.168.1.1.
echo.
pause
exit /b

RaLink 5xxx U-Boot may download a firmware from TFTP server to RAM and boot it. Next you may write image to flash using standard “Upgrade” procedure.

See also →generic.flashing.tftp

Specific values you need

Bootloader TFTP client IPv4 address 192.168.0.1
Bootloader MAC address (special) 00:AA:BB:CC:DD:10
Firmware TFTP image
TFTP Transfer Window ? sec
TFTP Window Start 1 sec
TFTP Server Required IP Address 192.168.0.2

U-Boot 1.1.3 (Mar 31 2011 - 13:19:43) Board: Ralink APSoC DRAM: 32 MB rt2880 uboot v0.00e04 05/25/2006 SERIAL_CLOCK_DIVISOR =16 kaiker,,CONFIG_BAUDRATE =57600 SDRAM SIZE:02000000 Top of RAM usable for U-Boot at: 82000000 Reserving 319k for U-Boot at: 81fb0000 Reserving 260k for malloc() at: 81f6f000 Reserving 44 Bytes for Board Info at: 81f6efd4 Reserving 36 Bytes for Global Data at: 81f6efb0 Reserving 128k for boot params() at: 81f4efb0 Stack Pointer at: 81f4ef98 relocate_code Pointer at: 81fb0000 Now running in RAM - U-Boot at: 81fb0000 monitor_flash_len =124244 ... spi_wait_nsec: 42 spi device id: ef 40 17 0 0 (40170000) find flash: W25Q64BV raspi_read: from:30000 len:1000 .raspi_read: from:30000 len:1000 .Before: 3000 reg 2000 After: 3000 ============================================ Ralink UBoot Version: 3.5.2.0 -------------------------------------------- ASIC 5350_MP (Port5<->None) DRAM_CONF_FROM: Boot-Strapping DRAM_TYPE: SDRAM DRAM_SIZE: 256 Mbits DRAM_WIDTH: 16 bits DRAM_TOTAL_WIDTH: 16 bits TOTAL_MEMORY_SIZE: 32 MBytes Flash component: SPI Flash Date:Mar 31 2011 Time:13:19:43 ============================================ icache: sets:256, ways:4, linesz:32 ,total:32768 dcache: sets:128, ways:4, linesz:32 ,total:16384 ##### The CPU freq = 360 MHZ #### estimate memory size =32 Mbytes raspi_read: from:40004 len:6 . Please choose the operation: 1: Load system code to SDRAM via TFTP. 2: Load system code then write to Flash via TFTP. 3: Boot system code via Flash (default). 4: Entr boot command line interface. 7: Load Boot Loader code then write to Flash via Serial. 9: Load Boot Loader code then write to Flash via TFTP. You choosed 4 raspi_read: from:40004 len:6 4: System Enter Boot Command Line Interface. U-Boot 1.1.3 (Mar 31 2011 - 13:19:43) RT5350 # printenv bootcmd=tftp baudrate=57600 ethaddr="00:AA:BB:CC:DD:10" ramargs=setenv bootargs root=/dev/ram rw addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) panic=1 flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr) kernel_addr=BFC40000 u-boot=u-boot.bin load=tftp 8A100000 $(u-boot) u_b=protect off 1:0-1;era 1:0-1;cp.b 8A100000 BC400000 $(filesize) loadfs=tftp 8A100000 root.cramfs u_fs=era bc540000 bc83ffff;cp.b 8A100000 BC540000 $(filesize) test_tftp=tftp 8A100000 root.cramfs;run test_tftp ethact=Eth0 (10/100-M) filesize=35f87d fileaddr=80800000 ipaddr=192.168.0.1 serverip=192.168.0.2 autostart=no bootfile=firmware.tftp bootargs=mem=32M console=ttyS1,57600n8 bootdelay=10 stdin=serial stdout=serial stderr=serial Environment size: 875/4092 bytes RT5350 # reset -blah-blah-blah 3: System Boot system code via Flash. ## Booting image at bc050000 ... raspi_read: from:50000 len:40 . Image Name: MIPS OpenWrt Linux-2.6.39.4 Created: 2011-11-20 4:14:31 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 2423308 Bytes = 2.3 MB Load Address: 80000000 Entry Point: 80000000 raspi_read: from:50040 len:24fa0c Verifying Checksum ... OK Uncompressing Kernel Image ... OK No initrd ## Transferring control to Linux (at address 80000000) ... ## Giving linux memsize in MB, 32

Jan 1 00:00:16 syslogd started: BusyBox v1.12.1 Jan 1 00:00:16 resident: init lan Jan 1 00:00:16 resident: start ipoe on br0 Jan 1 00:00:16 resident: ip_is_up on br0 Jan 1 00:00:16 resident: start dhcp+dns on br0 Jan 1 00:00:16 kernel: [17179569.380000] TCP: Hash tables configured (established 1024 bind 1024) Jan 1 00:00:16 kernel: [17179569.384000] TCP reno registered Jan 1 00:00:16 kernel: [17179569.400000] deice id : ef 40 17 0 0 (40170000) Jan 1 00:00:16 kernel: [17179569.404000] W25Q64BV(ef 40170000) (8192 Kbytes) Jan 1 00:00:16 kernel: [17179569.408000] mtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numeraseregions = 0 Jan 1 00:00:16 kernel: [17179569.412000] Creating 7 MTD partitions on "raspi": Jan 1 00:00:16 kernel: [17179569.416000] 0x00000000-0x00800000 : "ALL" Jan 1 00:00:16 kernel: [17179569.420000] 0x00000000-0x00030000 : "Bootloader" Jan 1 00:00:16 kernel: [17179569.424000] 0x00030000-0x00040000 : "Config" Jan 1 00:00:16 kernel: [17179569.428000] 0x00040000-0x00050000 : "Factory" Jan 1 00:00:16 kernel: [17179569.432000] 0x00050000-0x00130000 : "Kernel" Jan 1 00:00:16 kernel: [17179569.436000] 0x00130000-0x00000000 : "RootFS" Jan 1 00:00:16 kernel: [17179569.440000] 0x00050000-0x00000000 : "Linux" Jan 1 00:00:16 kernel: [17179569.444000] Load Ralink DFS Timer Module Jan 1 00:00:16 kernel: [17179569.448000] RT3xxx EHCI/OHCI init. Jan 1 00:00:16 kernel: [17179569.456000] squashfs: version 3.4 (2008/08/26) Phillip Lougher Jan 1 00:00:16 kernel: [17179569.456000] squashfs: LZMA suppport for slax.org by jro Jan 1 00:00:16 kernel: [17179569.460000] io scheduler noop registered (default) Jan 1 00:00:16 kernel: [17179569.496000] Ralink gpio driver initialized Jan 1 00:00:16 kernel: [17179569.888000] HDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096 Jan 1 00:00:16 kernel: [17179569.892000] N_HDLC line discipline registered. Jan 1 00:00:16 kernel: [17179569.896000] Serial: 8250/16550 driver $Revision: 1.7 $ 2 ports, IRQ sharing disabled Jan 1 00:00:16 kernel: [ Jan 1 00:00:16 kernel: 17179569.900000] serial8250: ttyS0 at I/O 0xb0000500 (irq = 37) is a 16550A Jan 1 00:00:16 kernel: [17179569.904000] serial8250: ttyS1 at I/O 0xb0000c00 (irq = 12) is a 16550A Jan 1 00:00:16 kernel: [17179569.912000] loop: loaded (max 8 devices) Jan 1 00:00:16 kernel: [17179569.916000] rdm_major = 254 Jan 1 00:00:16 kernel: [17179569.920000] PPP generic driver version 2.4.2 Jan 1 00:00:16 kernel: [17179569.924000] PPP Deflate Compression module registered Jan 1 00:00:16 kernel: [17179569.928000] PPP BSD Compression module registered Jan 1 00:00:16 kernel: [17179569.932000] PPP MPPE Compression module registered Jan 1 00:00:16 kernel: [17179569.936000] NET: Registered protocol family 24 Jan 1 00:00:16 kernel: [17179569.940000] PPPoL2TP kernel driver, V0.17 Jan 1 00:00:16 kernel: [17179569.944000] PPTP driver version 0.8.5 Jan 1 00:00:16 kernel: [17179569.964000] block2mtd: version $Revision: 1.1.1.1 $ Jan 1 00:00:16 kernel: [17179569.968000] Initializing USB Mass Storage driver... Jan 1 00:00:16 kernel: [17179569.972000] usbcore: registered new interface driver usb-storage Jan 1 00:00:16 kernel: [17179569.976000] USB Mass Storage support registered. Jan 1 00:00:16 kernel: [17179569.980000] usbcore: registered new interface driver usbhid Jan 1 00:00:16 kernel: [17179569.984000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver Jan 1 00:00:16 kernel: [17179569.988000] GACT probability on Jan 1 00:00:16 kernel: [17179569.992000] Mirror/redirect action on Jan 1 00:00:16 kernel: [17179569.996000] Simple TC action Loaded Jan 1 00:00:16 kernel: [17179570.000000] u32 classifier Jan 1 00:00:16 kernel: [17179570.004000] Performance counters on Jan 1 00:00:16 kernel: [17179570.008000] input device check on Jan 1 00:00:16 kernel: [17179570.012000] Actions configured Jan 1 00:00:16 kernel: [17179570.016000] nf_conntrack version 0.5.0 (256 buckets, 2048 max) Jan 1 00:00:16 kernel: [17179570.020000] ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone Jan 1 00:00:16 kernel: [17179570.028000] ipt_time loading Jan 1 00:00:16 kernel: [17179570.032000] arp_tables: (C) 2002 David S. Miller Jan 1 00:00:16 kernel: [17179570.036000] TCP cubic registered Jan 1 00:00:16 kernel: [17179570.040000] NET: Registered protocol family 1 Jan 1 00:00:16 kernel: [17179570.044000] NET: Registered protocol family 17 Jan 1 00:00:16 kernel: [17179570.048000] Ebtables v2.0 registered Jan 1 00:00:16 kernel: [17179570.052000] 802.1Q VLAN Support v1.8 Ben Greear Jan 1 00:00:16 kernel: [17179570.056000] All bugs added by David S. Miller Jan 1 00:00:16 kernel: [17179570.068000] VFS: Mounted root (squashfs filesystem) readonly. Jan 1 00:00:16 kernel: [17179570.072000] Freeing unused kernel memory: 112k freed Jan 1 00:00:16 kernel: [17179570.824000] Algorithmics/MIPS FPU Emulator v1.5 Jan 1 00:00:16 kernel: [17179571.172000] tun: Universal TUN/TAP device driver, 1.6 Jan 1 00:00:16 kernel: [17179571.176000] tun: (C) 1999-2004 Max Krasnyansky Jan 1 00:00:16 kernel: [17179572.088000] NTFS driver 2.1.28 [Flags: R/W MODULE]. Jan 1 00:00:16 kernel: [17179576.860000] MAC_ADRH -- : 0x00000000 Jan 1 00:00:16 kernel: [17179576.864000] MAC_ADRL -- : 0x00000000 Jan 1 00:00:16 kernel: [17179576.868000] Ralink APSoC Ethernet Driver Initilization. v2.0 256 rx/tx descriptors allocated, mtu = 1500! Jan 1 00:00:16 kernel: [17179576.872000] MAC_ADRH -- : 0x0000000c Jan 1 00:00:16 kernel: [17179576.876000] MAC_ADRL -- : 0x43305077 Jan 1 00:00:16 kernel: [17179576.884000] PROC INIT OK! Jan 1 00:00:16 kernel: [17179577.972000] MAC_ADRH -- : 0x0000b8a3 Jan 1 00:00:16 kernel: [17179577.976000] MAC_ADRL -- : 0x86ae521a Jan 1 00:00:16 kernel: [17179577.984000] Jan 1 00:00:16 kernel: [17179577.984000] phy_tx_ring = 0x01d7f000, tx_ring = 0xa1d7f000 Jan 1 00:00:16 kernel: [17179577.984000] Jan 1 00:00:16 kernel: [17179577.984000] phy_rx_ring0 = 0x01e20000, rx_ring0 = 0xa1e20000 Jan 1 00:00:16 kernel: [17179577.988000] RT305x_ESW: Link Status Changed Jan 1 00:00:16 kernel: [17179578.476000] RT305x_ESW: Link Status Changed Jan 1 00:00:16 kernel: [17179579.248000] rt2860v2_ap: module license 'unspecified' taints kernel. Jan 1 00:00:16 kernel: [17179579.296000] Jan 1 00:00:16 kernel: [17179579.296000] Jan 1 00:00:16 kernel: [17179579.296000] === pAd = c01b2000, size = 631688 === Jan 1 00:00:16 kernel: [17179579.296000] Jan 1 00:00:16 kernel: [17179579.300000] <-- RTMPAllocAdapterBlock, Status=0 Jan 1 00:00:16 kernel: [17179581.316000] RX DESC a1907000 size = 2048 Jan 1 00:00:16 kernel: [17179581.324000] <-- RTMPAllocTxRxRingMemory, Status=0 Jan 1 00:00:16 kernel: [17179581.660000] Key1Str is Invalid key length(0) or Type(1) Jan 1 00:00:16 kernel: [17179581.664000] Key2Str is Invalid key length(0) or Type(1) Jan 1 00:00:16 kernel: [17179581.668000] Key3Str is Invalid key length(0) or Type(1) Jan 1 00:00:16 kernel: [17179581.672000] Key4Str is Invalid key le Jan 1 00:00:16 kernel: ngth(0) or Type(1) Jan 1 00:00:16 kernel: [17179581.708000] 1. Phy Mode = 9 Jan 1 00:00:16 kernel: [17179581.712000] 2. Phy Mode = 9 Jan 1 00:00:16 kernel: [17179581.716000] 3. Phy Mode = 9 Jan 1 00:00:16 kernel: [17179581.720000] MCS Set = ff 00 00 00 01 Jan 1 00:00:16 kernel: [17179581.736000] SYNC - BBP R4 to 20MHz.l Jan 1 00:00:16 kernel: [17179584.604000] Main bssid = b8:a3:86:ae:52:1a Jan 1 00:00:16 kernel: [17179584.608000] <==== rt28xx_init, Status=0 Jan 1 00:00:16 kernel: [17179584.636000] 0x1300 = 00064380 Jan 1 00:00:16 kernel: [17179584.744000] eth2.4: dev_set_promiscuity(master, 1) Jan 1 00:00:16 kernel: [17179584.748000] device eth2 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.752000] device eth2.4 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.756000] eth2.3: dev_set_promiscuity(master, 1) Jan 1 00:00:16 kernel: [17179584.760000] device eth2.3 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.764000] eth2.2: dev_set_promiscuity(master, 1) Jan 1 00:00:16 kernel: [17179584.768000] device eth2.2 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.772000] eth2.1: dev_set_promiscuity(master, 1) Jan 1 00:00:16 kernel: [17179584.776000] device eth2.1 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.780000] device ra0 entered promiscuous mode Jan 1 00:00:16 kernel: [17179584.784000] br0: port 5(ra0) entering learning state Jan 1 00:00:16 kernel: [17179584.788000] br0: port 4(eth2.1) entering learning state Jan 1 00:00:16 kernel: [17179584.792000] br0: port 3(eth2.2) entering learning state Jan 1 00:00:16 kernel: [17179584.796000] br0: port 2(eth2.3) entering learning state Jan 1 00:00:16 kernel: [17179584.800000] br0: port 1(eth2.4) entering learning state Jan 1 00:00:16 dnsmasq[800]: started, version 2.40 cachesize 512 Jan 1 00:00:16 dnsmasq[800]: compile time options: no-IPv6 GNU-getopt no-RTC no-MMU no-ISC-leasefile no-DBus no-I18N TFTP Jan 1 00:00:16 dnsmasq[800]: DHCP, IP range 192.168.0.2 -- 192.168.0.100, lease time 1d Jan 1 00:00:16 dnsmasq[800]: read /tmp/hosts - 2 addresses Jan 1 00:00:16 dnsmasq[800]: read /etc/ethers - 0 addresses Jan 1 00:00:17 resident: init wan Jan 1 00:00:17 kernel: [17179585.716000] eth2.5: Setting MAC address to b8 a3 86 ae 52 1b. Jan 1 00:00:17 resident: start ipoe on eth2.5 Jan 1 00:00:17 udhcpc[830]: udhcp client (v0.9.8) started Jan 1 00:00:17 event: path = /var/lock/eth2.5.lock Jan 1 00:00:17 event: send event Jan 1 00:00:17 udhcpc[830]: Sending discover... Jan 1 00:00:17 resident: Out init_device Jan 1 00:00:18 udhcpc[830]: Lease of 172.21.0.56 obtained, lease time 600 Jan 1 00:00:18 kernel: [17179586.868000] rt3xxx-ehci rt3xxx-ehci: Ralink EHCI Host Controller Jan 1 00:00:18 kernel: [17179586.876000] rt3xxx-ehci rt3xxx-ehci: new USB bus registered, assigned bus number 1 Jan 1 00:00:18 kernel: [17179586.904000] rt3xxx-ehci rt3xxx-ehci: irq 18, io mem 0x101c0000 Jan 1 00:00:18 kernel: [17179586.908000] rt3xxx-ehci rt3xxx-ehci: USB 0.0 started, EHCI 1.00, driver 10 Dec 2004 Jan 1 00:00:18 kernel: [17179586.912000] usb usb1: Product: Ralink EHCI Host Controller Jan 1 00:00:18 kernel: [17179586.916000] usb usb1: Manufacturer: Linux 2.6.21 ehci_hcd Jan 1 00:00:18 kernel: [17179586.920000] usb usb1: SerialNumber: rt3xxx Jan 1 00:00:18 kernel: [17179586.936000] usb usb1: configuration #1 chosen from 1 choice Jan 1 00:00:18 kernel: [17179586.944000] hub 1-0:1.0: USB hub found Jan 1 00:00:18 kernel: [17179586.948000] hub 1-0:1.0: 1 port detected Jan 1 00:00:18 kernel: [17179587.152000] rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller Jan 1 00:00:18 kernel: [17179587.160000] rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2 Jan 1 00:00:18 kernel: [17179587.164000] rt3xxx-ohci rt3xxx-ohci: irq 18, io mem 0x101c1000 Jan 1 00:00:18 kernel: [17179587.228000] usb usb2: Product: RT3xxx OHCI Controller Jan 1 00:00:18 kernel: [17179587.232000] usb usb2: Manufacturer: Linux 2.6.21 ohci_hcd Jan 1 00:00:18 kernel: [17179587.236000] usb usb2: SerialNumber: rt3xxx-ohci Jan 1 00:00:18 kernel: [17179587.252000] usb usb2: configuration #1 chosen from 1 choice Jan 1 00:00:19 kernel: [17179587.260000] hub 2-0:1.0: USB hub found Jan 1 00:00:19 kernel: [17179587.264000] hub 2-0:1.0: 1 port detected Jan 1 00:00:19 resident: ip_is_down on eth2.5 Jan 1 00:00:24 resident: ip_is_up on eth2.5 Jan 1 00:00:24 resident: update dns Jan 1 00:00:24 dnsmasq[800]: read /tmp/hosts - 2 addresses Jan 1 00:00:24 dnsmasq[800]: read /etc/ethers - 0 addresses Jan 1 00:00:24 dnsmasq[800]: using nameserver 172.21.0.2#53 Jan 1 00:00:24 resident: update ntpclient Jan 1 00:00:24 resident: update rip Jan 1 00:00:24 resident: update igmp Jan 1 00:00:24 kernel: [17179592.720000] eth2.5: dev_set_allmulti(master, 1) Jan 1 00:00:31 kernel: [17179599.788000] br0: topology change detected, propagating Jan 1 00:00:31 kernel: [17179599.792000] br0: port 5(ra0) entering forwarding state Jan 1 00:00:31 kernel: [17179599.796000] br0: topology change detected, propagating Jan 1 00:00:31 kernel: [17179599.800000] br0: port 4(eth2.1) entering forwarding state Jan 1 00:00:31 kernel: [17179599.804000] br0: topology change detected, propagating Jan 1 00:00:31 kernel: [17179599.808000] br0: port 3(eth2.2) entering forwarding state Jan 1 00:00:31 kernel: [17179599.812000] br0: topology change detected, propagating Jan 1 00:00:31 kernel: [17179599.816000] br0: port 2(eth2.3) entering forwarding state Jan 1 00:00:31 kernel: [17179599.820000] br0: topology change detected, propagating Jan 1 00:00:31 kernel: [17179599.824000] br0: port 1(eth2.4) entering forwarding state Jan 1 00:00:48 kernel: [17179617.120000] RT305x_ESW: Link Status Changed Jan 1 00:00:51 kernel: [17179619.472000] RT305x_ESW: Link Status Changed

[ 0.000000] Linux version 3.7.3 (vbox@vbox-VirtualBox) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #22 Thu Jan 31 08:57:31 MSK 2013 [ 0.000000] prom: fw_arg0=00000001, fw_arg1=81f4efb0, fw_arg2=01f4f3b0, fw_arg3=00000000 [ 0.000000] env= (null) is not in RAM, skipping [ 0.000000] env= (null) is not in RAM, skipping [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU revision is: 0001964c (MIPS 24KEc) [ 0.000000] Ralink RT5350 id:1 rev:3 running at 360.00 MHz [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 02000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x00000000-0x01ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00000000-0x01ffffff] [ 0.000000] On node 0 totalpages: 8192 [ 0.000000] free_area_init_node: node 0, pgdat 802b0530, node_mem_map 81000000 [ 0.000000] Normal zone: 64 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 8128 pages, LIFO batch:0 [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 [ 0.000000] Kernel command line: board=DIR-320-B1 console=ttyS1,57600 mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,1024k(kernel),6848k(rootfs),7872k@0x50000(firmware) rootfstype=squashfs,jffs2 [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes) [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] __ex_table already sorted, skipping sort [ 0.000000] Writing ErrCtl register=00000006 [ 0.000000] Readback ErrCtl register=00000006 [ 0.000000] Memory: 29308k/32768k available (2225k kernel code, 3460k reserved, 529k data, 188k init, 0k highmem) [ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS:48 [ 0.000000] console [ttyS1] enabled, bootconsole disabled [ 0.010000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080) [ 0.080000] pid_max: default: 32768 minimum: 301 [ 0.080000] Mount-cache hash table entries: 512 [ 0.090000] NET: Registered protocol family 16 [ 0.100000] MIPS: machine is D-Link DIR-320 B1 [ 0.130000] bio: create slab <bio-0> at 0 [ 0.140000] Switching to clocksource MIPS [ 0.150000] NET: Registered protocol family 2 [ 0.160000] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 0.180000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.190000] TCP: Hash tables configured (established 1024 bind 1024) [ 0.200000] TCP: reno registered [ 0.210000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.220000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.230000] NET: Registered protocol family 1 [ 0.280000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.290000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.320000] msgmni has been set to 57 [ 0.330000] io scheduler noop registered [ 0.330000] io scheduler deadline registered (default) [ 0.720000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 0.740000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A [ 0.750000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A [ 0.770000] ramips-spi ramips-spi.0: master is unqueued, this is deprecated [ 0.790000] m25p80 spi0.0: s25fl064k (8192 Kbytes) [ 0.800000] 6 cmdlinepart partitions found on MTD device spi0.0 [ 0.810000] Creating 6 MTD partitions on "spi0.0": [ 0.820000] 0x000000000000-0x000000030000 : "u-boot" [ 0.830000] 0x000000030000-0x000000040000 : "u-boot-env" [ 0.850000] 0x000000040000-0x000000050000 : "factory" [ 0.860000] 0x000000050000-0x000000150000 : "kernel" [ 0.880000] 0x000000150000-0x000000800000 : "rootfs" [ 0.890000] mtd: partition "rootfs" set to be root filesystem [ 0.900000] mtd: partition "rootfs_data" created automatically, ofs=720000, len=E0000 [ 0.920000] 0x000000720000-0x000000800000 : "rootfs_data" [ 0.930000] 0x000000050000-0x000000800000 : "firmware" [ 0.960000] IPv4 over IPv4 tunneling driver [ 0.970000] gre: GRE over IPv4 demultiplexor driver [ 0.980000] TCP: cubic registered [ 0.980000] NET: Registered protocol family 17 [ 0.990000] 8021q: 802.1Q VLAN Support v1.8 [ 1.020000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4. [ 1.040000] Freeing unused kernel memory: 188k freed [ 8.350000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0 [ 8.580000] Button Hotplug driver version 0.4.1 [ 9.440000] Registered led device: d-link:green:status [ 9.450000] Registered led device: d-link:green:usb [ 9.450000] Registered led device: d-link:green:wps [ 13.110000] jffs2: notice: (1402) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 17 of xref (0 dead, 2 orphan) found. [ 14.640000] nls_base: exports duplicate symbol load_nls (owned by kernel) [ 15.030000] SCSI subsystem initialized [ 15.680000] usbcore: registered new interface driver usbfs [ 15.690000] usbcore: registered new interface driver hub [ 15.710000] usbcore: registered new device driver usb [ 16.980000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 18.000000] ehci-platform ehci-platform: Generic Platform EHCI Controller [ 18.010000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1 [ 18.060000] ehci-platform ehci-platform: irq 26, io mem 0x101c0000 [ 18.090000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00 [ 18.100000] hub 1-0:1.0: USB hub found [ 18.110000] hub 1-0:1.0: 1 port detected [ 18.240000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 18.260000] ohci-platform ohci-platform: Generic Platform OHCI Controller [ 18.270000] ohci-platform ohci-platform: new USB bus registered, assigned bus number 2 [ 18.290000] ohci-platform ohci-platform: irq 26, io mem 0x101c1000 [ 18.360000] hub 2-0:1.0: USB hub found [ 18.370000] hub 2-0:1.0: 1 port detected [ 18.400000] dwc_otg: version 2.72a 24-JUN-2008 [ 18.510000] usb 1-1: new high-speed USB device number 2 using ehci-platform [ 18.530000] Initializing USB Mass Storage driver... [ 18.540000] usbcore: registered new interface driver usb-storage [ 18.560000] USB Mass Storage support registered. [ 18.680000] hub 1-1:1.0: USB hub found [ 18.690000] hub 1-1:1.0: 4 ports detected [ 18.980000] usb 1-1.1: new high-speed USB device number 3 using ehci-platform [ 19.100000] scsi0 : usb-storage 1-1.1:1.0 [ 19.190000] usb 1-1.2: new high-speed USB device number 4 using ehci-platform [ 19.310000] scsi1 : usb-storage 1-1.2:1.0 [ 20.110000] scsi 0:0:0:0: Direct-Access USB Mass Storage Device PQ: 0 ANSI: 0 CCS [ 20.130000] sd 0:0:0:0: [sda] Attached SCSI removable disk [ 20.320000] scsi 1:0:0:0: Direct-Access WDC WD80 0BB-00HEA0 3G13 PQ: 0 ANSI: 2 CCS [ 20.340000] sd 1:0:0:0: [sdb] 156301488 512-byte logical blocks: (80.0 GB/74.5 GiB) [ 20.360000] sd 1:0:0:0: [sdb] Write Protect is off [ 20.370000] sd 1:0:0:0: [sdb] Mode Sense: 00 38 00 00 [ 20.370000] sd 1:0:0:0: [sdb] Asking for cache data failed [ 20.380000] sd 1:0:0:0: [sdb] Assuming drive cache: write through [ 20.400000] sd 1:0:0:0: [sdb] Asking for cache data failed [ 20.410000] sd 1:0:0:0: [sdb] Assuming drive cache: write through [ 20.440000] sdb: sdb1 [ 20.450000] sd 1:0:0:0: [sdb] Asking for cache data failed [ 20.460000] sd 1:0:0:0: [sdb] Assuming drive cache: write through [ 20.480000] sd 1:0:0:0: [sdb] Attached SCSI disk [ 41.640000] EXT4-fs (sdb1): warning: mounting unchecked fs, running e2fsck is recommended [ 41.660000] EXT4-fs (sdb1): mounted filesystem without journal. Opts: (null) [ 43.820000] Compat-drivers backport release: compat-drivers-2012-12-04 [ 43.830000] Backport based on wireless-testing.git master-2012-12-06 [ 43.850000] compat.git: wireless-testing.git [ 43.950000] cfg80211: Calling CRDA to update world regulatory domain [ 43.960000] cfg80211: World regulatory domain updated: [ 43.970000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 43.990000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 44.000000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [ 44.020000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [ 44.030000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 44.050000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 44.300000] NET: Registered protocol family 10 [ 44.600000] nls_base: exports duplicate symbol load_nls (owned by kernel) [ 45.160000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' [ 45.160000] Registered led device: rt2800pci-phy0::radio [ 45.160000] Registered led device: rt2800pci-phy0::assoc [ 45.160000] Registered led device: rt2800pci-phy0::quality [ 45.220000] NET: Registered protocol family 8 [ 45.220000] NET: Registered protocol family 20 [ 45.590000] NTFS driver 2.1.30 [Flags: R/O MODULE]. [ 45.830000] Initializing XFRM netlink socket [ 45.890000] NET: Registered protocol family 15 [ 45.980000] PPP generic driver version 2.4.2 [ 46.070000] tun: Universal TUN/TAP device driver, 1.6 [ 46.080000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com> [ 46.130000] tunnel4: exports duplicate symbol xfrm4_tunnel_deregister (owned by kernel) [ 46.210000] PPP MPPE Compression module registered [ 46.810000] l2tp_core: L2TP core driver, V2.0 [ 46.870000] l2tp_netlink: L2TP netlink interface [ 46.910000] sit: IPv6 over IPv4 tunneling driver [ 47.000000] gre: exports duplicate symbol gre_add_protocol (owned by kernel) [ 47.050000] ip_gre: GRE over IPv4 tunneling driver [ 47.110000] ip6_gre: GRE over IPv6 tunneling driver [ 47.250000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 47.680000] NET: Registered protocol family 24 [ 47.850000] nf_conntrack version 0.5.0 (460 buckets, 1840 max) [ 48.160000] l2tp_ppp: PPPoL2TP kernel driver, V2.0 [ 48.200000] PPTP driver version 0.8.5 [ 48.890000] xt_time: kernel timezone is -0000 [ 49.360000] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 49.830000] siit: module license 'unspecified' taints kernel. [ 49.850000] Disabling lock debugging due to kernel taint [ 50.060000] usbcore: registered new interface driver cdc_acm [ 50.070000] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters [ 50.180000] usbcore: registered new interface driver usblp [ 50.240000] usbcore: registered new interface driver usbserial [ 50.250000] usbcore: registered new interface driver usbserial_generic [ 50.260000] usbserial: USB Serial support registered for generic [ 50.420000] usbcore: registered new interface driver asix [ 50.470000] usbcore: registered new interface driver cdc_ether [ 50.530000] usbcore: registered new interface driver dm9601 [ 50.580000] usbcore: registered new interface driver kaweth [ 50.640000] usbcore: registered new interface driver MOSCHIP usb-ethernet driver [ 50.690000] pegasus: v0.6.14 (2006/09/27), Pegasus/Pegasus II USB Ethernet driver [ 50.710000] usbcore: registered new interface driver pegasus [ 50.840000] usbcore: registered new interface driver rndis_host [ 50.890000] usbcore: registered new interface driver ipheth [ 50.940000] usbcore: registered new interface driver sierra_net [ 50.990000] usbcore: registered new interface driver ark3116 [ 51.010000] usbserial: USB Serial support registered for ark3116 [ 51.060000] usbcore: registered new interface driver belkin_sa [ 51.070000] usbserial: USB Serial support registered for Belkin / Peracom / GoHubs USB Serial Adapter [ 51.130000] usbcore: registered new interface driver ch341 [ 51.140000] usbserial: USB Serial support registered for ch341-uart [ 51.190000] usbcore: registered new interface driver cp210x [ 51.210000] usbserial: USB Serial support registered for cp210x [ 51.260000] usbcore: registered new interface driver cypress_m8 [ 51.270000] usbserial: USB Serial support registered for DeLorme Earthmate USB [ 51.280000] usbserial: USB Serial support registered for HID->COM RS232 Adapter [ 51.300000] usbserial: USB Serial support registered for Nokia CA-42 V2 Adapter [ 51.370000] usbcore: registered new interface driver ftdi_sio [ 51.380000] usbserial: USB Serial support registered for FTDI USB Serial Device [ 51.450000] usbcore: registered new interface driver ipw [ 51.460000] usbserial: USB Serial support registered for IPWireless converter [ 51.520000] keyspan: Unknown symbol ezusb_fx1_ihex_firmware_download (err 0) [ 51.570000] usbcore: registered new interface driver mct_u232 [ 51.580000] usbserial: USB Serial support registered for MCT U232 [ 51.640000] usbcore: registered new interface driver mos7720 [ 51.650000] usbserial: USB Serial support registered for Moschip 2 port adapter [ 51.700000] usbcore: registered new interface driver moto_modem [ 51.720000] usbserial: USB Serial support registered for moto-modem [ 51.780000] usbcore: registered new interface driver option [ 51.800000] usbserial: USB Serial support registered for GSM modem (1-port) [ 51.860000] usbcore: registered new interface driver oti6858 [ 51.870000] usbserial: USB Serial support registered for oti6858 [ 51.920000] usbcore: registered new interface driver pl2303 [ 51.940000] usbserial: USB Serial support registered for pl2303 [ 51.990000] usbcore: registered new interface driver qcserial [ 52.000000] usbserial: USB Serial support registered for Qualcomm USB modem [ 52.060000] usbcore: registered new interface driver sierra [ 52.070000] usbserial: USB Serial support registered for Sierra USB modem [ 52.130000] usbcore: registered new interface driver ti_usb_3410_5052 [ 52.140000] usbserial: USB Serial support registered for TI USB 3410 1 port adapter [ 52.160000] usbserial: USB Serial support registered for TI USB 5052 2 port adapter [ 52.210000] usbcore: registered new interface driver visor [ 52.220000] usbserial: USB Serial support registered for Handspring Visor / Palm OS [ 52.240000] usbserial: USB Serial support registered for Sony Clie 5.0 [ 52.250000] usbserial: USB Serial support registered for Sony Clie 3.5 [ 52.600000] u32 classifier [ 52.600000] Performance counters on [ 52.610000] input device check on [ 52.620000] Actions configured [ 52.700000] Mirror/redirect action on

Basic configuration After flashing, proceed with this.

The default network configuration is:

Interface Name Description Default configuration
br-lan LAN & WiFi 192.168.1.1/24
vlan0 (eth0.0) LAN ports (1 to 4) None
vlan1 (eth0.1) WAN port DHCP
wl0 WiFi Disabled

Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the CPU of router. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on.

Port Switch port
Internet (WAN) 4
LAN 1 3
LAN 2 2
LAN 3 1
LAN 4 0

hardware.button on howto use and configure the hardware button(s).

The D-Link DIR-320NRU has two buttons. They are Reset and WiFi Protected Setup (WPS).

BUTTON Event
Reset reset
WPS ?
Architecture MIPS
Vendor Ralink
bootloader U-Boot
CPU/Speed MIPS 24K V4.12 model “RT5350F” 360 MHz
Flash-Chip SPI Winbond
Flash size 8192 KiB
RAM 32 MiB
Wireless (Integrated into CPU) 2.4GHz 802.11bgn 150mbit/s
Ethernet (Integrated into CPU) 100 Mbit/s w/vlan support swconfig
Internet Ethernet and 3G/LTE via USB stick
USB Yes 1 x 2.0
Serial Yes
JTAG Yes

D-Link DIR-320 H/W Ver. B1, trading name “DIR-320NRU”

Front:

Photo of front of the casing

Back:

Photo of back of the casing

Note: This will void your warranty!

To remove the cover:

  1. remove (unglue) the warranty sticker;
  2. unglue two ribbon puds;
  3. unscrew two screws;
  4. safely remove cover.

Main PCB

port.serial general information about the serial port, serial port cable, etc.

How to connect to the Serial Port of DIR-320NRU:

Pins from top to bottom:

  1. TX
  2. Ground
  3. VCC (3.3V)
  4. key
  5. RX

Serial console jack don't soldered on plant, place of jack are empty.
Warning: console port are serial 3.3 V, if you want connect router to PC RS232, it is need to use serial 3.3V to 5V converter.
Note: Serial port speed is 57600 bod

port.jtag general information about the JTAG port, JTAG cable, etc.

How to connect to the JTAG Port of this specific device:

Take solderer into hands :) and connect to console port on the board of the router using serial 3.3V to serial 5V converter. Next insert power jack into router and wait for U-boot:

...

 ##### The CPU freq = 360 MHZ #### 
 estimate memory size =32 Mbytes
raspi_read: from:40004 len:6 
.
Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 

Press “4” and next you may type command for bootloader.

You choosed 4
raspi_read: from:40004 len:6 
4: System Enter Boot Command Line Interface.
U-Boot 1.1.3 (Mar 31 2011 - 13:19:43)
RT5350 #

Default values for the load firmware via tftp:

RT5350 # printenv
bootcmd=tftp
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ramargs=setenv bootargs root=/dev/ram rw
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off
addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) panic=1
flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr)
kernel_addr=BFC40000
u-boot=u-boot.bin
load=tftp 8A100000 $(u-boot)
u_b=protect off 1:0-1;era 1:0-1;cp.b 8A100000 BC400000 $(filesize)
loadfs=tftp 8A100000 root.cramfs
u_fs=era bc540000 bc83ffff;cp.b 8A100000 BC540000 $(filesize)
test_tftp=tftp 8A100000 root.cramfs;run test_tftp
ethact=Eth0 (10/100-M)
filesize=35f87d
fileaddr=80800000
ipaddr=192.168.0.1
serverip=192.168.0.2
autostart=no
bootfile=firmware.tftp
bootargs=mem=32M console=ttyS1,57600n8
bootdelay=10
stdin=serial
stdout=serial
stderr=serial

Environment size: 875/4092 bytes
RT5350 # 
  • Official firmware contain bug in the config parser: inline code execution are allowed. Confiuration files placed in the directory /etc/default (simlink of /tmp/etc/default). You may telnet to router and insert your script call using `/path/to/script.sh` into some config file, next save your changes to NVRAM. Look a shell code example in the russian article.

Original part of /etc/default/config.json

"dmz": {
"enable": true,
"ip": "192.168.0.2"
},

Modified part of /etc/default/config.json:

"dmz": {
"enable": true,
"ip": "`/etc/default/shaper.sh`"
},
echo Set DMZ Host to 9.9.9.9 via WebIF and run me again!
echo Use /etc/default/DMZ.txt to set DMZ Host IP
sed -i s/9.9.9.9/"\`\/etc\/default\/shaper.sh\`"/g /etc/default/config.json
saveconfig

A program /usr/sbin/saveconfig writes configuration data to NVRAM. At boot a program /usr/sbin/loadconfig load a NVRAM and write config files into /etc/default/.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/02/12 08:58
  • by 127.0.0.1