OpenWrt Forum Archive

Topic: D-Link DIR-615 HW rev C1 USB

The content of this topic has been archived between 9 Apr 2018 and 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Thanks regressor for the fine tutorial!
Reference : http://wiki.openwrt.org/toh/d-link/dir-615/c2-usb

Software : Latest trunk build with mach-dir-615-c1.c Gives the following error:
-------------------------------------------------------------------------------------------------------------
arch/mips/ar71xx/mach-dir-615-c1.c:23:21: error: dev_usb.h: No such file or directory
arch/mips/ar71xx/mach-dir-615-c1.c: In function 'dir_615c1_setup':
arch/mips/ar71xx/mach-dir-615-c1.c:151: error: implicit declaration of function 'ar71xx_add_device_usb'
make[6]: *** [arch/mips/ar71xx/mach-dir-615-c1.o] Error 1
make[5]: *** [arch/mips/ar71xx] Error 2
--------------------------------------------------------------------------------------------------------
So it seems dev_usb.h file is missing or is not in the location required.
Where can I find the proper dev_usb.h and place it before building again?

ldpinney wrote:

Thanks regressor for the fine tutorial!
Reference : http://wiki.openwrt.org/toh/d-link/dir-615/c2-usb

Software : Latest trunk build with mach-dir-615-c1.c Gives the following error:
-------------------------------------------------------------------------------------------------------------
arch/mips/ar71xx/mach-dir-615-c1.c:23:21: error: dev_usb.h: No such file or directory
arch/mips/ar71xx/mach-dir-615-c1.c: In function 'dir_615c1_setup':
arch/mips/ar71xx/mach-dir-615-c1.c:151: error: implicit declaration of function 'ar71xx_add_device_usb'
make[6]: *** [arch/mips/ar71xx/mach-dir-615-c1.o] Error 1
make[5]: *** [arch/mips/ar71xx] Error 2
--------------------------------------------------------------------------------------------------------
So it seems dev_usb.h file is missing or is not in the location required.
Where can I find the proper dev_usb.h and place it before building again?

You did install packages kmod-usb-core, kmod-usb2, kmod-usb-storage, etc... right?

No I'm trying to keep the build small and intended to install these "options" as packages after flashing.
Because if I compile in "all what you want" I know it won't fit in 4MB smile
I'll try it again WITH kmods-usb-xxx as modules
Thanks

@ldpinney

You'll actually save space by including your required packages in your build because it will go into the squashfs (compressed)... that is, your packages will be smaller in squashfs vs jffs.  And kmod-usb-core is not optional if you plan on using USB... you should build it into your image, which I think will solve your dependency on 'dev_usb.h' and 'ar71xx_add_device_usb'.

ldpinney wrote:

Thanks regressor for the fine tutorial!
Reference : http://wiki.openwrt.org/toh/d-link/dir-615/c2-usb

Software : Latest trunk build with mach-dir-615-c1.c Gives the following error:
-------------------------------------------------------------------------------------------------------------
arch/mips/ar71xx/mach-dir-615-c1.c:23:21: error: dev_usb.h: No such file or directory
arch/mips/ar71xx/mach-dir-615-c1.c: In function 'dir_615c1_setup':
arch/mips/ar71xx/mach-dir-615-c1.c:151: error: implicit declaration of function 'ar71xx_add_device_usb'
make[6]: *** [arch/mips/ar71xx/mach-dir-615-c1.o] Error 1
make[5]: *** [arch/mips/ar71xx] Error 2
--------------------------------------------------------------------------------------------------------
So it seems dev_usb.h file is missing or is not in the location required.
Where can I find the proper dev_usb.h and place it before building again?

Idpinney, dev_usb.h should be in the same directory as mach-dir-615-c1.c is. If it is there, then maybe something is wrong with the include directive,

#include "dev_usb.h"

searches for the header file in the same directory and

#include <dev_usb.h>

searches in the include path and it does not necessarily include the current directory. Hope this helps, but I guess you've solved it already.

I downloaded latest trunk code and checked for dev_usb.h
Sorry. My fault. I changed it allready with #include "dev-usb.h" in this thread and in wiki page.

(Last edited by regressor on 26 Feb 2011, 12:20)

Success! It's up and running the latest Kamikaze.
Thanks again regressor smile

Yes the dev_usb files were not included (on a fresh build)
SO...I built "fresh" firmware for my DIR-825 and that put the files in...
Then built for the DIR-615 and it works fine....I'll give it some more testing later....

This will make a fine "back-up" router while I transform my 825 into a home server smile

Actually the 615 is also a place to hone my skills ... before I hack up the more expensive 825.
So I'll try to do the 64M upgrade next smile

(Last edited by ldpinney on 27 Feb 2011, 23:57)

Seems to work OK.... However I'm getting the following (from dmesg)
ath: Failed to stop TX DMA in 100 msec after killing last frame
ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020
ath: Could not stop RX, we could be confusing the DMA engine when we start RX up
AND
ath: Failed to stop TX DMA in 100 msec after killing last frame
ath: Failed to stop TX DMA!
Both are repetitive

Googling reveals it's a common problem although I haven't found the solution...YET
If someone here already knows the solution...I would appreciate the help.

Hi ldpinney and all,

Would it be possible for you to put the firmware on your dropbox www.dropbox.com ?

(Any file you put in the public folder gets its own Internet link.)

I am a newbie with compiling. My DIR-615C1 is my main and only router right now and I would like to do this mod in the next few weeks. Now I have the solder and the lead smile .

Thank you so much for your help.

I now believe the previously mentioned the dmesg error is hardware not software related??
As my soldering skills may not be so good on things this small.
So my router reboots repeatedly but only when the radio is in use.....only the wired connections are usable at this time.
@ sint I don't have a dropbox account ...perhaps I should ? You can PM or e-mail me and I'll e-mail you my copy of the USB enabled DIR-615C1 firmware.

ldpinney wrote:

I now believe the previously mentioned the dmesg error is hardware not software related??
As my soldering skills may not be so good on things this small.
So my router reboots repeatedly but only when the radio is in use.....only the wired connections are usable at this time.
@ sint I don't have a dropbox account ...perhaps I should ? You can PM or e-mail me and I'll e-mail you my copy of the USB enabled DIR-615C1 firmware.

Would you mind send one for me? My e-mail address is: zdrzero@gmail.com. thank you.

Hi guys,

I've uploaded precompiled images of the OpenWRT Backfire 10.03.1-rc4 (the last official 10.03.1 prerelease) with USB support enabled for DIR-615 C1, TL-WR941ND and TL-WR740N:

openwrt-ar71xx-dir-615-c1-squashfs.zip
openwrt-ar71xx-tl-wr941nd-v3-squashfs.zip
openwrt-ar71xx-tl-wr740n-v1-squashfs.zip

It is preconfigured to fetch packages from the correct url (http://downloads.openwrt.org/backfire/1 … /packages/).

For USB storage you should install the following packages:

opkg update
opkg install kmod-usb-core kmod-usb2 kmod-usb-storage kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1

For TL-WR740N kmod-usb-ohci instead of kmod-usb2 should be installed.

As the flash space is very confined the filesystem can be extended on external flashdrive by installing packages block-extroot and kmod-fs-ext3 for external ext3 volume and modify /etc/config/fstab, just enable the option is_rootfs. It would be good to mount the filesystem by label as if there is more than one device there might be a confusion. Here is mine /etc/config/fstab:

config global automount
        option from_fstab 1
        option anon_mount 1

config global autoswap
        option from_fstab 1
        option anon_swap 0

config mount
        option target   /home
#       option device   /dev/sda1
        option label    nilinux
        option fstype   ext3
        option options  rw,sync
        option enabled  1
        option enabled_fsck 1
        option is_rootfs 1

config swap
#       option device   /dev/sda2
        option label    niswap
        option enabled  0

config mount
        option target   /home
#       option device   /dev/sdb1
        option label    felinux
        option fstype   ext3
        option options  rw,sync
        option enabled  1
        option enabled_fsck 1
        option is_rootfs 0

        config swap
#       option device   /dev/sdb2
        option label    feswap
        option enabled  1

With this release of Backfire fstab is moved as a service so to do a second permanent mount (not extroot) you should first enable the service:

/etc/init.d/fstab enable
reboot

I've installed also USB printer, 3g modem, USB soundcard, samba share on a external harddrive. I've also installed Debian/mips with debootstrap and (!)KDE. It did work (with external X server), but it was awfully slow because of the low amount of RAM (32MB). On 64MB mod it should run smoothly :) I may write my USB adventures but it's getting late now.

You could give it a try and give feedback.

Cheers

(Last edited by tuckata on 13 Mar 2011, 13:55)

melodic wrote:

I think usb mod is possible because many devices on AR9130 and USB onboard exist such as Linksys E2100L, Linksys WRT160NL, Alfa Networks AIP-W502U. But all of those have 8 Mb of flash memory.

I have made this mod but it is not working. (

ya i have heard about inksys E2100L, Linksys WRT160NL that they are 8 MB of flash memory but..! i have never heard about Alfa Networks AIP-W502U that it would have the same as you are talking about??

HELLO ;  I am very interested in what 'tuckata' did with his external root (extroot) I would like  to hear more about what it is that he liked about this particular setup from him.

AND if anyone else has similar types of mounts in their setups, then to help me realize the usage that is going on here?

BTW .. I am currently getting the precomputed ones also, and I like their basic packaging, I was fed up with compiling bin images that were too large.

I want to use an external root for basically all things, besides preinit. I want to re-create a preinit on the device with a minimal footprint , then ether do a pivotroot or what tuckata seems to have done cleverly.

IM Currently doing a nbd block mount it works great , but the second non is_root is confusing to me , in what way does this help create a permanency? do I create a mirror or te nilinux at felinux on my nbd-block server and give this back to the openwrt? or will felinux be somehow different, and in what little ways is it better from other methods?, and what specific ways is the two blocks  different

thanks for any help

jason

Hi Jason,

In your configuration you would only need one ext_root (nilinux in my config) and probably one swap (niswap in my config). In my setup there are two external storage devices plugged in a hub - a flash drive and an usb hard drive. The idea is that the external root filesystem is on the flash drive (mounted on /) and a home directory (the second mount) which is on the hard drive is mounted on /home. The access time to the flash drive is quick and to the hard drive is slower but the storage capacity is much larger. So, the firmware is extended on the external root on the flash drive and is accessed quick. On the hard drive there is a larger storage SAMBA share which is visible on the LAN. It doesn't have to be quick. Please note that the first ext_root flash drive mount nilinux is mounted on '/' because of the option "is_rootfs 1" and the option "target /home" in this case is ignored! I also have swaps on the two drives. For the experiments I've done I badly needed a swap but generally to have a swap on a flash drive is not preferable - it would wear out eventually. Another thing for this config - all mounts are mounted by label - and because of this it doesn't matter in what order they are plugged in the hub. In your configuration you wouldn't need labels. I have tried root and swap over nbd in a different environment and it is really great, you are on the right track!

tuckata

Thanks tuckata on the clarification, I want to do what your doing now that I think about it your way seems more NAS using my method , I had to load certain modules into the flash then clone over to the ext again then preform various time consuming upgrades, I had to do this several times before I go it just right, and I still get the occasional error and Segfaults many actually on writes and reads.

The idea of having root in use on a flash seems ideal, I wonder how your achievement into actually getting that abstraction that you have now working? or rather does it work well? I see that is some achievement.

I have seen other mods for a serial to usb in this device , something that powers a drive though would need a real usb? or a converter is still a converter isnt it and not true usb.

In my attempt to make the mod I was a bit clumsy I soldered the bottom of the PBC where the 472 resister needs to go near the processor, however I accidentally removed the smaller resistor just below it, (just plain black with no markings) It the driver didnt work with the kernel -2.6.32.27 or rather I couldn't figure out how to make it work yet.

The plan was to plug the usb into a hub that carried a mini-drive slot and various other card slots. (note that all these newer devices have a serial to usb interface in the chip, but I guess making the usb connection is far easier that manually attempting to configure a serial connection through the mini drives various directives.)

I dont know about debugging though , Im using a all linux/Unix system and have yet set up a serial port to receive the Dlink dir-615c1 Rev ::A3 serial

Hi Jason,

The firmware extension on ext_root on external USB flash drive is working pretty stable.

I see you've been fighting with the hardware for a while. What point you have reached with the software, have you installed an USB enabled firmware?

Hey, Jason,

Sorry, I've read your post again and obviously you've installed software. You've described in detail what you've done with the hardware but please also describe what you've done with the software.

The hardware mod is more simple, (just USB_RREF 4.7 Kohm, and two 22 ohm impedance matching resistors are more than enough), so I think you should focus on the software and be (almost) sure that it is working as expected.

Don't bother with that small black resistor, if you look at the schematic provided by swiftik R11/R13 form some (in my opinion not important) EJTAG_SEL bootstrap jumper. Just any resistor (1 Kohm, 4.7 kOhm, etc...) should work.

By the way, about the hardware, as the 5 volt DC-DC converter is not installed on board, I've used one from Car Cigarette Powered 1000mA USB Adapter/Charger. I'm more than happy with it, it draws 1A(!) and it is much more than the USB spec (500 mA). And also, not least, it glows in the dark smile (not that I see it under the hood) smile

Also about hardware, now there are cheap routers with USB 2.0 mounted on board, like TP-LINK TL-MR3420, so next time I may get such one.

I suppose you've used trunk, I've also started with one. And I had some strange experiences with it. I can't remember which build was it, but after everything was OK with the USB, if I've tried to execute file on USB file system it crashed with SIGSEGV and SIGILL. Eventually, it turned out that it was a bug in the file system code which didn't manage correctly the data cache page flush, and, it affected only filesystems other than the embedded (squashfs and jffs were not affected, ext2/3 and vfat were!). There was no trace of this bug in the next trunk releases. I've decided not to use trunk, but a more predictable backfire release and I've compiled backfire 10.03.1-rc4 with USB support. The benefit would be that it is known stable version, and, one could use all the precompiled packages available for download, and, in this version ext_root is supported natively - no need to explicitly recompile the firmware because of it. I've done that and now the bluetooth driver and the tun driver (used by OpenVPN) are buggy - the kernel oopses smile I do not have much time to play with the router now so I plan to recompile and install the next stable version, when it comes out.

Now, about the USB software side. When you add the "ar71xx_add_device_usb();" line to mach-dir-615-c1.c, when the ehci module ehci-hcd.ko is inserted in the kernel the following is seen in the syslog (dmesg):

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00

If you see this you are (almost) there! The USB_PLL has to be initialized, and if it is not, you won't see anything in the syslog, but nevertheless there will still be no USB communication. This is done usually in the boot loader (u-boot) in routers in which the USB is used, but is omitted in routers like D-LINK DIR-615 C1&C2 and TP-LINK TL-WR941ND, where the USB port is there but is officially not used. So, to do this you could add another line to the kernel patch or just to try it you could initialize it by hand on the u-boot command line prompt by

mw.l b8050008 1030; boot

Also, if you want just to play something without flashing the router you could use initramfs firmware image.

OK, that's it, focus on the software and when you are (almost) sure it should work grab the soldering iron and solder all around smile

tuckata, hey;

I will do what you suggest and solder later, I hope that the RC-5 hats out has some good code and stable* enough.

1.) first, Ill download it then follow the directions found at the top here>> http://wiki.openwrt.org/toh/d-link/dir-615/c2-usb

2.)Second Ill re-read what you said, and make certian that things are rolling wink with the aformentioned checkpoint you gave me, let me say that I have gotten that far allready, and I thought that the RC-5 may allready have this mod?? guess not, I can see it loading with devise usb and it actualy mounts a none on usbfs /proc/usb (not exact location but thats the idea anyway)

it did not show this last time >>
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00

so Im guessing the mod will complete when that codes finished right, im off

First of all I gotta thank every one who contributed on this thread. It's allowed me to try a bunch of things I haven't done before.

I have modded a DIR-615 C1 (flea market special $2.69) as per previous details. I got Openwrt mounted on it and booting from an external 2 GB USB flash drive.

Filesystem Mount Point Available Used
   
/dev/root     /rom     0.00 B / 1.38 MB     100% (1.38 MB)     
tmpfs     /tmp     12.98 MB / 14.41 MB     10% (1.43 MB)     
tmpfs     /dev     512.00 KB / 512.00 KB     0% (0.00 B)     
/dev/sda1     /overlay     732.39 MB / 795.21 MB     3% (22.42 MB)     
mini_fo:/overlay     /     0.00 B / 1.38 MB     100% (1.38 MB)     
/dev/sda2     /mnt/sda2     1.07 GB / 1.07 GB     0% (4.00 KB)     

I used tuckata's "openwrt-ar71xx-dir-615-c1-squashfs.zip" (thanks tuckata!) as a first go and it's running fine.

I have not managed to get  a build on Backfire-rc5 or Trunk to install.
I followed regressor's (post #37) instructions and the build goes (no error messages V=99) ok but it will not install properly.

Has any one had a similar experience?

~john

I now have build this mod on trunk and working on extroot.

~john

My DIR-615 modem has the USB port (!!) however it can't be used by default.
This modem is branded for an ISP.

http://i51.tinypic.com/dfk4nl.png
http://i53.tinypic.com/1e9s1v.png

Do you think I can get it worked using the software modifications in the wiki ?

I see it is a version G1 . I don't have any experience with this version.

The unit I have is C1.

Based on this wiki http://wiki.openwrt.org/toh/d-link/dir-615 I don't see any support for it yet.

~john

regressor, are you still around this forum?

READING an earlier post you made, you suggested that you had an innuendo to make a custom U-boot, bootloader?

How did that work out, I am scowering the internet looking for a way to access this u-boot on this hardware, it, What you suggested would require changing the NAND in the device) I was told*  by u-boot iirc that the openwrt dosent touch the factory u-boot image and that it is setup to only load what it needs to do.

So why not find out how to load a new image from the existing u-boot? Thats what I suggest anyway,

I have a question of my own > How can I actually access this type of loading in this same router dir-615 rev c2 to chain boot via the u-boot? to another kernel (not openwrt)