OpenWrt Forum Archive

Topic: bad firmware on dir-300

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

hi all,
I wanted to upgrade my dir-300 rev A1 but after uploading the firmware file, just a screen appeared just says:
"it works!"
then I refreshed the page for so many times but nothing appeared, even the it works message!
since I am a noob beginner, I found out I should make a contact with the router with its serial port after a lot of searching. built the ttl to rs232 converter exactly same as this:
http://isl3893.sourceforge.net/serial-max3232.gif
and every time I open the putty.exe with settings written in here:
http://www.dd-wrt.com/wiki/index.php/Re … _Bad_Flash
just a blank black screen opens up and nothing happens,
should I use jTag port?
how can I understand that it's bootloader is not gone? because I read somewhere if the bootloader is gone, then we should use jTag port.

sorry for my bad English, and also for my noobness big_smile
thanks a lot. smile

(Last edited by m.m.m on 7 Mar 2013, 09:48)

Have you tested your serial converter by just connecting its Tx and Rx wires together and typing something in putty? Do you see the echo of what you are typing?
If that worked, have you tried to swap Tx and Rx when connecting to the router?

thanks for the replay.
I can't even type anything in the putty terminal!
I couldn't understand you, do you mean I should connect the routers rx and tx ports directly to my serial port?
I also swapped Tx and Rx from the router but it didn't work either.
I forgot to say: I am using a rs232/usb converter because I am using a laptop.

No, I mean that you should only connect your converters Tx to your converters Rx. No connection to the router. This way you can test, if your converter works properly. Whatever you type in putty should appear instantly (check local echo settings of putty, if available - I never used it).

m.m.m wrote:

since noob beginner, I found out I should make a contact with the router with its serial port after a lot of searching. built the ttl to rs232 converter

You're doing things in either strange or even dangerous ways. As of 2013 the simplest way to convert USB to low-voltage UART is to use appropriate chip like FT232, CP201...2103 and somesuch. And of course there are ready solutions based on these ICs selling around. Starting from "old" mobile phone cables  (which convert USB to low-voltage UART excatly like that one you need) up to embedded developer tools (those guys are often use those UARTs for debug). In fact USB to UART converters are quite common and inexpensive these days. You can read openwrt wiki to get some ideas on this.

If I got it right. you are about to convert USB to RS232 first (RS232 is *not* level compatible with 3.3V UART!) and then ... downconvert it to 3.3V UART using MAX232?

Usually "USB to RS232" converter is in fact some USB to UART bridge IC like FT232, CP2101 or similar, which converts USB to low-voltage UART (like that one you actually need) and then another IC shifts levels to RS232 using IC like MAX232 to reach RS232 compatibility (i.e. bipolar 12V levels, you don't need or want them!). Then you put yet another MAX232 to ... downshift levels back to 3.3V UART? smile

Well, you see, it's a bit silly: two extra MAX232-like ICs on the way and RS232 physical level used which you don't need or want anyway. OTOH it makes things more complicated, could make signal worse and harder to troubleshoot as there are more connections involved. Though theoretically it could work and isn't anyhow invalid on it's own. Just somewhat suboptimal.

And hopefully you've never attached RS232 (bi-polar, 12V) levels to 3.3V UART. Doing so is likely to fry router CPU. Pay extra attention to this. As for me it's not a great idea to have RS232 bipolar 12V levels around when dealing with 3.3V ICs. Basically it's wrong to attach digital I/O pins to anything above IC supply (i.e. 3.3V) or below GNS (0V). Doing so is likely to fry IC. That's why modern ICs need MAX232-like level shifter to operate with ancient bipolar RS232 levels.

Then, guy suggested that
1) Grab your converter.
2) Connect converter's TX pin to converter's RX pin. There should be no other devices attached to UART (i.e. don't connect bricked device, etc).
3) Start some terminal and connect to that COM port.
4) Set up port to use no flow control. And make sure local echo is off.
5) Type something.
5) Check if you can see what you type.

If everything is done correctly and your converter actually works, you will see same text as you typed because it's transmitted via TX line and then immediately received via RX like on the same port (that's why guy asked to connect them). Note that terminal could do local echo - make sure it's off. This test allows to understand if your converter actually works and is able to transmit data and receive it back.  It's easier since no external devices involved, only converter itself should work for this test. If you can't get past this point, there is something wrong with your converter, OS drivers, port settings or something else, not anyhow related to bricked device(s) or something like that.

thanks for the replay, I tested it, when I open the putty terminal, I can type anything in it but after pressing enter, nothing appears. I could not find any settings for the local echo.
I tested these but didn't get any reaction:
echo 'hi'
echo "hi"
echo"hi"
echo 'hi';
I used my routers VCC and GND terminals as the power supply for my converter.
I have sp3232 and max232, I didn't try the max232. should I try it or are they the same?

you were supposed to receive an echo of every keypress, instantly. Since that failed, there is a problem with your converter. My recommendation is to get a cheap usb-ttl 3.3V converter (aka cell phone cable).

which one do you think I should use?
max232 (5v)
or
sp3232 (3.3v)
?
thanks.
I want to make something so I don't want to buy any modules big_smile

no offense, but this seems to be above your skills. your main focus in this forum should be to get your router running again. so do yourself a favor and get a ready built cable.

I could not find a 3.3 one at our local stores. sad I'm trying to make it, but I don't know why, it doesn't work.
and a replay to t3st3r:
do you mean I could use my rs232 - usb converter as a ttl - rs232 module too? how? I could not understand what do you exactly mean. could you please provide a schematic for that? thanks.

somebody help please!

it seems no one knows the way to fix it sad

Help with what?   You're not answering anyone's questions and you're not listening to what people are suggesting.

In Putty local echo is on the main "Terminal" settings screen.   It's an option very mysteriously called "Local echo".   For your test session turn both "local echo" and "local line editing"  to "off".    And make sure you click "save session" after you change the settings otherwise they'll only be changed for that one time.

In your video  you're seeing that when?  You haven't said what's connected to what etc.

You also haven't said what  serial settings you're using and why ( baud rate, parity , flow control etc.)

thanks for the replay, I found the local echo settings and turned it off but nothing changed sad I still get a response like this:
http://avardeh.persiangig.com/files/lesson.gif
there is a 5v ttl to rs232 converter available in stores here, but my router can only provide 3.3v.
my settings are:
speed:115200
local echo,local line editing:force off
flow control: none
parity:none
data bits:8
stop bits:1
I am making the converter currently on a breadboard.
I tried it again, it's not working anymore. I can't either type anything on terminal! yikes

a)  like @MBS said in his 2nd message.   Did you try  disconnecting tx and rx from the board and shorting them together ?      on your chip (not on the board )  to see that when you are  sending to yourself you see letters ?     

b) What speed is listed for your router in the wiki http://wiki.openwrt.org/toh/d-link/dir-300  ?

are you sure to use the right port number ? hmm
because on laptop rs232 port i think it is COM1 or 2
http://isl3893.sourceforge.net/serial-max3232.gif , if you use this one  , you don't use the usb port ?

m.m.m wrote:

I forgot to say: I am using a rs232/usb converter because I am using a laptop.

usb to RS232 + RS232 to TTL converter ?? or RS232 to TTL only ?

(Last edited by thierry69 on 26 Mar 2013, 14:15)

yes, I connected pins 13 and 14 together and I am just using my router's GND, VCC ports. so I think the speed and more options don't matter yet, and because I am using usb to rs232 converter, my com port number every time goes one up. it's com12 now.
is it wrong to use a usb to RS232 and then a RS232 to ttl converter? so what should I do? :-?

(Last edited by m.m.m on 26 Mar 2013, 14:32)

If you have already tried RS232, your router's serial is quite likely fried. RS232 is 12V nominal.
What you would be best with (if you really want to roll your own) is an old Nokia cable. There is info around the site somewhere on how to hack it. Or google "nokia serial ttl hack" or similar.

I think first of test if the comport itself is working properly
http://www.ni.com/white-paper/3450/en

Hyperterminal is a rather old program, but putty can be used for that as well.

Check if it functions properly, because usb to rs232 can be a real pain in the neck because of the issues that can occure.

And of course you also allready could have fried the routers serial as well in the process,but the voltage that comes from rs232 can be from arround 5 to 15 volt. So you can be inluck.

A lot of usb ->rs232 adapters I have used where arround 5 volt.

robthebrew wrote:

If you have already tried RS232, your router's serial is quite likely fried. RS232 is 12V nominal.
What you would be best with (if you really want to roll your own) is an old Nokia cable. There is info around the site somewhere on how to hack it. Or google "nokia serial ttl hack" or similar.

You're absolutely right, but wasn't this addressed just a few messages ago?

Also there's nothing particularly incorrect about his basic design, he's just bad about testing, and communicating (and some other things )...

m.m.m wrote:

is it wrong to use a usb to RS232 and then a RS232 to ttl converter? so what should I do? :-?



can be put together the output of rx and tx of the adapter USB/RS232  (without plugging the adapter RS232/TTL)

pin 2 and 3 and type something in your terminal ??  (maybe I say a stupidity)

http://npic.imagup.com/1/1178987108.jpg  http://npic.imagup.com/2/1178987801.jpg

i think this is your adapter  (or similar )usb/rs232 :

http://npic.imagup.com/1/1178987288.jpg

(Last edited by thierry69 on 26 Mar 2013, 20:06)

I think I do. when I type something (like afsdfgfdg, even not a echo command) and then press enter, in that line, what I wrote appears and the only thing appears is that the pointer comes to the first word of the line. just like this photo:
http://avardeh.persiangig.com/files/lesson.gif
and then when I type something new in that line, every word of it overwrites my previous command.

is it the right respond or my converter is corrupted?

hi,

i think the simply way is to buy a sub/TTL converter  about 2 or 3 €  on Eb** , 
after we can help you more easily with a good serial link.

http://npic.imagup.com/1/1179463962.jpg

I think there is problem between the driver of the first USB/RS232 converter and the second converter rs232 to ttl ...

(Last edited by thierry69 on 1 Apr 2013, 07:45)

The discussion might have continued from here.