New Code to add Support for USR5465

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3  Next
Author Message
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Sun Nov 08, 2009 5:19    Post subject: New Code to add Support for USR5465 Reply with quote
I have been programming for about 30 years and building computers for at least 25. Among my specialties are designing hardware interfaces for embedded microcontrollers and writing compact code for same in assembler and higher level languages, which has been good for my wallet. I have successfully installed and configured DD-WRT on a variety of routers from multiple manufacturers, never having trouble till I undertook to try DD-WRT on one of my USR5465 routers. This post and this post detail the results of those experiments. I must say that before I tried the flash, and again before I asked for help when the flash didn't work, I searched for and read all pertinent forum posts and wiki articles for what little information there was about this device.

Since then, further experimentation has made me strongly suspect that support for the USR5465 was at best incomplete. Therefore I have dug more deeply into other resources and into the DD-WRT source code itself to resolve the matter. Finding my suspicions to have grounds in fact, I thought that the quickest way to get full DD-WRT support for the USR5465 and its "one-port twin" the USR5455 would be to simply provide the missing code myself, which I am happy to do (see below). The new code should add little overhead to the firmware, and if need be, I could help save some bytes and CPU cycles elsewhere to compensate for the addition. If this not the appropriate way to do this, I trust that others will kindly direct me how I should do otherwise. And by all means do point out any errors; that’s why I put this before the public.

Acknowledgment: I obtained the boardnum and the LED gpio assignments for the USR5465 from the diag.c code mentioned in this blog article. I was able to get the vlan ports and interface names from the nvram dump provided by the factory firmware.


Last edited by modervador on Tue Nov 24, 2009 2:58; edited 1 time in total
Sponsor
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Nov 08, 2009 9:45    Post subject: Reply with quote
I think this is a better place for code suggestions:
http://svn.dd-wrt.com:8000/dd-wrt/timeline

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Sun Nov 08, 2009 10:11    Post subject: Reply with quote
Noted. Will be added soon.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Sun Nov 08, 2009 19:02    Post subject: Reply with quote
Thanks very much to you both.

Eko, thanks for your continuous effort and I look forward to helping this project in whatever small way I can.

Frater, your link took me to a timeline with no obvious way to post code suggestions, but I took the next step and registered, and voila! a "new ticket" button appeared, which is what I presume you wanted me to find. I'm new to this ticket thing, but I'll learn. Thx.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 3:01    Post subject: Reply with quote
Thank you Eko for adding the code. Happy birthday, and congratulations on getting the N-16 going; that will make many people happy.

Here's an update. I flashed my USR5465 with dd-wrt.v24-13230_NEWD_micro-plus.bin and the behaviour is exactly the same as past experience. According to the LED patterns and ping responses (described previously), the router always reboots after turning on the USB LED and then apparently starting to bring up the radio. The evidence suggests that the internal_getRouterBrand() function of src/router/libutils/utils.c detects the USR5465 as some other router which is not compatible with the USR5465. It may be that its boardnum is not 35324 after all, and of course there is no simple way to read that parameter without the router fully booting. I'll activate a ticket. Based on private messages I've received, it seems there are several folks with USR 5465 and 5455 routers who might benefit from this.
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7632

PostPosted: Tue Nov 24, 2009 4:43    Post subject: Reply with quote
modervador wrote:
According to the LED patterns and ping responses (described previously), the router always reboots after turning on the USB LED


So are you saying that turning on the USB led causes the router to reboot?
If so, then I suggest to take out those code lines until you are sure about the gpio's and the boardnum.

Hook up the serial port and take a boot log, it will likely tell what happens.

_________________
Kernel panic: Aiee, killing interrupt handler!
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Tue Nov 24, 2009 5:14    Post subject: Reply with quote
test build,
If it runs, recheck gpios and board detection numbers.
send me cfe and nvram.

Don't use this build on any other router!



dd-wrt.v24-13299_NEWD_micro.bin
 Description:

Download
 Filename:  dd-wrt.v24-13299_NEWD_micro.bin
 Filesize:  1.62 MB
 Downloaded:  1229 Time(s)

modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 5:36    Post subject: Reply with quote
LOM wrote:
So are you saying that turning on the USB led causes the router to reboot?
If so, then I suggest to take out those code lines until you are sure about the gpio's and the boardnum.

Hook up the serial port and take a boot log, it will likely tell what happens.

I'm saying the router always reboots after turning on the USB LED and then apparently starting to bring up the radio, as described in a post cited in the first post in this thread.

Since the behaviour is unchanged after adding code to detect the USR5465, it seems likely that the problem begins there. I think the USB LED comes on because DD-WRT "thinks" it's turning some other LED on (or off) for some other router. For example, there are several routers with boardtype=="0x048e" which use gpio1 for the power LED or for some other LED.

I'm resisting the serial port because it involves purchasing, soldering etc. and my electronics shop is in transition. Software seems more straightforward at the moment. I have seen other folks receive a "test build" to get their routers running such that they could grab the CFE and nvram without hardware hacking. I hope to successfully compile of DD-WRT from source someday soon myself, and I've got Ubuntu Karmic on a few machines and I've almost got it to compile with the 24_2 kernel, but I don't think the svn repository contains all the up-to-date make/install scripts. So I'm not all the way there yet, and I depend on the kindness of friends and strangers who have the actal means to compile.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 5:40    Post subject: Reply with quote
Eko wrote:
test build,
If it runs, recheck gpios and board detection numbers.
send me cfe and nvram.

Don't use this build on any other router!

WOW!! Thanks! I guess you were busy doing actual coding while I was typing my previous post. (I am a slow typer when also looking at code on other screens.)

I am being called away now, so I will try this in a few hours and report back.


Last edited by modervador on Tue Nov 24, 2009 5:43; edited 1 time in total
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Tue Nov 24, 2009 5:41    Post subject: Reply with quote
Well... test build does exactly this. It forsecs router to your model... and I also disabled usb led.

Please test
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 5:45    Post subject: Reply with quote
Eko wrote:
Well... test build does exactly this. It forsecs router to your model... and I also disabled usb led.

Please test

I downloaded it, will test as soon as I can. Thanks again.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 19:03    Post subject: Reply with quote
Let us all break forth with the w00t. Attached screenshot is proof of the pudding. 256 kB CFE is also attached. (I'd email it to cfe dot backup at yahoo dot co dot uk but at the moment I'm behind a corporate firewall that blocks SMTP.)

WL0 LED blinks at the correct time (slowly when disconnected in client mode, swiftly when packets go in/out). External antenna is "right". Some relevant nvram values:

boardflags=0x750
boardnum=38256
boardrev=0x11
boardtype=0x048e

I'll do LED and button detection a bit later. Thank you.



WirelessStatusWeb.png
 Description:
 Filesize:  125.39 KB
 Viewed:  19400 Time(s)

WirelessStatusWeb.png



USR5465-cfe.bin
 Description:

Download
 Filename:  USR5465-cfe.bin
 Filesize:  256 KB
 Downloaded:  1067 Time(s)

modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Tue Nov 24, 2009 23:57    Post subject: Reply with quote
Broadcom detection:

gpio poll 0 thru 8: no change with reset button. Reset button causes instant reboot before the value is updated on screen.

gpio disable 7: causes instant reboot, regardless of whether gpio enable 7 was done before or not.

gpio enable 2 turns USB (printer) LED on.
gpio disable 2 turns USB (printer) LED off.

No gpio enable/disable 0 through 8 seems to affect the WAN LED, which is always off in client bridge mode.
Power LED is always on, unaffected by gpio enable/disable.

Nothing else to report at this point.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Wed Nov 25, 2009 14:09    Post subject: Reply with quote
I am corresponding with the writer of this blog, Vivek Unune. For now we can't rule out the possibility of two or more revisions for this device, each having different a boardnum. Apparently he read his as 35324, while mine is 38256. Also, he finds the USB gpio to be 1, while I find it to be 2.

Next on the agenda is to determine if the WAN LED can be made functional. Perhaps it depends on whether the router is in AP or client mode, with the WAN port enabled and/or configured as a 5th switch port.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Sun Nov 29, 2009 18:50    Post subject: Reply with quote
Results of further testing. I have flashed a second USR5465.

In client bridge and AP mode, with a cable plugged into the WAN port:
gpio enable 4 turns WAN LED on. Blinks with traffic. Goes out if cable is removed.
gpio disable 4 turns WAN LED off.

\u@\h:\w\$ nvram show | grep -i board | sort
size: 17666 bytes (15102 left)
DD_BOARD=U.S.Robotics USR5465
boardflags=0x750
boardnum=38038
boardrev=0x11
boardtype=0x048e

Note: that's another boardnum. 3 different USR5465's, 3 different boardnums.
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum