D-Link DIR-645

Supported Versions

Version/Model Launch Date S/N OpenWrt Version Supported Model Specific Notes
A1 2011-09 - Initial support since R33843-R33845. Still open: wireless -

Hardware Highlights

CPU Ram Flash Gigabit WLan USB Serial JTag
Ralink 64MB 8MB 4+1 Yes Yes Yes ?

Installation

Flash Layout

D-Link DIR-645 Rev.A1 Flash Layout
Layer0 MX24L6405D c2 2017c220 (mtd0, mtd6) 8192KiB
Layer1 mtd7
u-boot
192KiB
mtd4
devdata
64KiB
mtd3
devconf
64KiB
mtd2
upgrade
7680KiB
mtd5
langpack
128KiB
Layer2 mtd8
boot env
32KiB

kernel
1280.1KiB
mtd1
rootfs
5748KiB
mountpoints /
filesystem gzipped xml SquashFS

The original firmware in upgrade contains a 96 bytes SEAMA-header followed by the kernel padded to 64KB, followed by the rootfs. Thus the rootfs is 96 bytes off from a 64 KB boundary. Note that the SEAMA-header is variable size.

OEM easy installation

FIXME The instructions below are for Broadcom devices and only serve as an example. Don't leave them in place if they do not apply to a particular device!

This section deals with how you install OpenWrt from a device freshly opened. Plus the steps required such as reset to factory defaults if the device has already been configured

Note: Reset router to factory defaults if it has been previously configured.

OEM installation using the TFTP method

There may be an easier way to do this but this is what worked for me.

First, get your serial port going. At the moment the network interfaces aren't coming up so you'll need the console to work with it.

Get the source from D-Link at this address:

http://tsd.dlink.com.tw/GPL.asp

The file you're looking for is this DIR645A1_GPL101.tar.gz

Read the instructions and follow them till you get a successful build.

Once you get a build of the d-link linux, get your openwrt build going for this device (rt3883) but build an initramfs image.

You can use the usual tftp setup to get the initramfs running on there or you can burn it to the flash. The flash isn't supported out of the box with openwrt (as far as I can tell) so it'll need to be the initramfs kernel so that it loads everything in to ram. Hopefully someone can get the flash support going.

If you want to burn it in there you'll need to package it properly. Here's the generic procedure for this device using the dlink source for packaging it.

1. Get a kernel and a rootfs (if you build openwrt from the trunk these files will be in trunk/build_dir/linux-ramips_rt3883 as vmlinux and root.squashfs).

2. run these commands from the dlink directory (DIR645A1_GPL101).

source ./setupenv

tools/lzma/lzma vmlinux

tools/building/packimgs -o raw.img -i vmlinux.lzma -i root.squashfs

tools/seama/seama -i raw.img -m dev=/dev/mtdblock/2 -m type=firmware

tools/seama/seama -s web.img -i raw.img.seama -m signature=wrgn39_dlob.hans_dir645

tools/seama/seama -d web.img

tools/release.sh web.img DIR645A1_FW101B06_c5fl.bin

make sealpac_template

tools/release.sh sealpac.slt DIR645A1_FW101B06_c5fl.slt

(replace vmlinux and root.squashfs with correct location and names of appropriate files)

3. your image is in images as DIR645A1_FW101B06_c5fl.bin use options 2 in the serial console to burn the image to the device.

Again, if you use the kernel that comes from doing an initramfs build you'll be able to get in and work with it in ram and hopefully get the flash suport going so that a regular build can be put on.

Tftp is simple. Just set up a tftp server on a computer (probably the one that you built the image on). When the device boots up hit option 1 or 2 as appropriate (1 for ram image, 2 to burn it). The first option is the ip address for the device (the address you want the device to have), the second is the ip address of the tftp server and the third is the filename you want to grab (DIR645A1_FW101B06_c5fl.bin if you used the steps above).

Upgrading OpenWrt

generic.sysupgrade

If you have already installed OpenWrt and like to reflash for e.g. upgrading to a new OpenWrt version you can upgrade using the mtd command line tool. It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing.

LuCI Web Upgrade Process

Terminal Upgrade Process

  • Login as root via SSH on 192.168.1.1
  • Use the following commands to upgrade.

cd /tmp/
wget http://downloads.openwrt.org/snapshots/trunk/XXX/xxx.abc
sysupgrade /tmp/xxx.abc

  • If sysupgrade does not support this router, use the following commands.

cd /tmp/
wget http://downloads.openwrt.org/snapshots/trunk/XXX/xxx.abc
mtd write /tmp/xxx.abc linux && reboot

Basic configuration

Basic configuration After flashing, proceed with this.
Set up your Internet connection, configure wireless, configure USB port, etc.

Specific Configuration

Interfaces

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

Switch Ports (for VLANs)

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 router itself. 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

Failsafe mode

Buttons

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

The DIR-645 has two buttons. They are Reset and WPS. Here, we merely name the buttons, so we can use them in the above Howto:

BUTTON Event
Reset reset
Wireless Protection Setup wps

Hardware

Info

Instruction set: MIPS
Vendor: Ralink
Bootloader: U-Boot
System-On-Chip: Ralink 3883 (MIPS 74Kc)
CPU/Speed 74Kc V4.12 500 Mhz
Flash-Chip: MX24L6405D
Flash size: 8192 KiB
RAM: 64 MiB
Wireless: RT2860v2_ap 2.4GHz 802.11bgn
Switch: RealTek RTL8367RB Gigabit
USB: Yes 1 x 2.0
Serial: Yes
JTAG: ?

Photos

Model Number

Front:

Photo of front of the casing

Back:

Photo of back of the casing

Opening the case

Note: This will void your warranty!

  • To remove the cover do a/b/c

Main PCB

Photo of PCB

Serial

The serial port is connected to the header labeled JP1. The pinout is as follows:

JP1 Pins Signal
Pin Rx
no pin
Pin +3.3v
Pin Gnd
Pin Tx

Settings: 57600 8N1

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

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

Photo of PCB with markings

JTAG

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

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

Photo of PCB with markings

Debricking

generic.debrick

Like other D-Link routers it has a built-in firmware recovery mode.

To access, simply hold down the reset button while powering on the router. The WAN LED should blink. Set your computer with a static IP in the 192.168.0.x range, and open 192.168.0.101 in a web browser. Recovery mode loads up within a few seconds, but doesn't respond to pings. If the power LED is blinking the above page should be accessible.

You will need to flash either a stock firmware image or Openwrt-factory image, *not* a sysupgrade image.

Bootloader Mods

  1. you could read about bootloader in general

Hardware mods

  1. as a beginner, you really should inform yourself about soldering in general and then obtain some practical experience!

128MiB RAM Mod

I²C GPIO Mod

I²C Tiny-USB Mod

Notes

Telnet Login

Login: Alphanetworks

Password: Firmware Signatur for example: wrgn39_dlob.hans_dir645

Tags

For some Help with the Tags, please have a look here: tags

Back to top

toh/d-link/dir-645.txt · Last modified: 2014/03/19 12:27 (external edit)