Si, definitiva perché le infomazioni che si trovano sulla rete sono frammentarie e spesso non corrette. In altre parole hanno un rapporto segnale/rumore poco favorevole. Non che quello che scriverò sarà tutto lo scibile sulla Fonera, ma se seguirete alla lettera la procedura che ora vi vado a descrivere avrete il 99% di possibilità di ripristinarla correttamente (parlo di software ovviamente, se si tratta di hardware, beh, buona fortuna).
Nonostante non sia affatto un utente Windows, vi descrivo come si fa la cosa su Windows, al fine di poter aiutare il maggior numero possibile di persone che si trovano di fronte a questo problema. Gli utenti *nix dovrebbero riuscire a capire da soli cosa cambia….
DISCLAIMER: Se distruggete qualcosa (la Fonera, il vostro computer, un vostro occhio perché è esploso un condensatore e vi è arrivato in faccia…) sono tutti c***i vostri.
Di cosa avete bisogno (a.k.a. se non avete TUTTO quello che ho messo in questo elenco, lasciate stare):
- Cavo JTAG
- Cavo seriale con level shifter (MAX232 per intenderci)
- Un cavo ethernet
- Saldatore
- Pompetta succhia-stagno
- Stagno
- TJTAG 3.0.1
- RedBoot per la Fonera
- Il template della Board Configuration
- Tecnologimski Hackman
Il cavo JTAG:
Questo tipo di cavo vi serve per andare ad intervenire sulla flash della Fonera, e se non ce l’avete potete costruirlo con 2 euro. Per farlo vi servono i seguenti componenti:
- Connettore DB25 maschio
- 5 resistori da 100 ohm
- Un connettore tipo quelli da piattina a 14 pin (SV1)
L’immagine è presa da dd-wrt.com. Notate che questo è un cavo “per poveri” nel senso che lui funziona, ma è veramente al limite. Ogni disturbo potrebbe compromettere la comunicazione e costringervi a rifare da capo l’upload. Per tanto le regole sono le seguenti:
- Costruite il cavo cercando di fare ottime saldature
- Tenete il cavo il più corto possibile…20 cm potrebbe essere un’idea
- Quando lo usate tenetelo lontano da qualunque altro cavo, soprattutto dall’alimentazione ma anche da USB, Ethernet…lontano da tutto insomma
- Cercate di non accendere/spegnere elettrodomestici nelle vicinanze, tipo ventilatori, aspirapolvere…
- Se volete usate del cavetto schermato, usando però la schermatura “con la testa”
- Tenete presente che potrebbe essere anche la porta parallela della vostra macchina a fare scherzi, se proprio non funziona provate ad usare un altro computer, magari bello vecchiotto.
Se non seguite queste regole, poi quando andrete ad usare TJTAG per fare l’upload nella flash vedrete problemi legati al watchdog, upload che si interrompono a caso, ecc…
Il cavo seriale:
Questo cavo è molto meno critico, ma ugualmente metteteci cura nel costruirlo. Vi servono i seguenti componenti:
- MAX232 o equivalente, ad esempio HIN232
- 4 condensatori da 1 microF
- 1 connettore DB9 femmina
Anche questa volta non avevo voglia di fare il disegno: ho trovato l’immagine sopra che, per quanto chiara, presenta un circuito che ha ottime possibilità di non funzionare. Infatti il MAX232 richiede da 4.5 a 5.5 volt (datasheet) per il suo corretto funzionamento. Per cui alimentate questo circuito (linea rossa) con 5 volt invece che con l’alimentazione che vi da la Fonera, che è di 3.3 volt. Il connettore dove c’è scritto “Fon Router” è il J2 della Fonera. Se volete alimentare il circuito con i 3.3V della Fonera, usate il MAX3232, stessa piedinatura, condensatori da 0,1microF.
Prepariamo la Fonera all’intervento:
Prendete la scheda della Fonera ed individuate il connettore J1. Come vedrete praticamente tutti i fori sono stagnati: il vostro obiettivo è aprirli. Non serve aprirli tutti, bastano i fori corrispondenti ai pin 1, 2, 3, 5, 7, 9 e 14. Per cui prendete saldatore e pompetta, aprite i fori e con i reofori che vi avanzano dalle resistenze dopo aver costruito i cavi, fate i pin per J1. Ricordate: ottime saldature!
Ora prendete il cavo JTAG ed il cavo seriale e attaccate tutto.
Iniziamo:
Create una directory tipo c:\fon e metteteci dentro tutta l’immondizia software che vi ho elencato prima. Lanciate loaddrv.exe, specificate c:\fon\giveio.sys, date Install e poi Start.
Date watt alla Fonera e provate a vedere se TJTAG riesce a parlarle:
tjtag3 -probeonly
Dovrebbe uscirvi una cosa simile a questa. Se vi si blocca su “resuming processor” (come a me) non vi preoccupate, la cosa non crea problemi: date un CTRL-C e siete a posto. In giro per la rete vi dicono di usare /fc:25. Se siete costretti ad usarlo (serve a specificare a mano che flash c’è sulla fonera), forse c’è qualcosa che non va…
Ora ariamo l’intera flash:
tjtag3 -erase:custom /window:a8000000 /start:a8000000 /length:800000
Fatto questo, copiate redboot.bin in custom.bin e date:
tjtag3 -flash:custom /window:a8000000 /start:a8000000 /length:30000
Bene. Il processo ora può durare anche più di un’ora per cui andate a farvi un giro e non toccate nulla. Una volta finito, aprite board_config_template.bin con Hackman, andate a 0×60 ed inserite il mac address riportato sulla Fonera. Subito di seguito inserite quello stesso mac address a cui ci sommate 1. Saranno rispettivamente i mac della scheda Wifi e della scheda Ethernet della fonera.
Fatto ciò, copiate board_config_template.bin in custom.bin e date:
tjtag3 -flash:custom /window:a87f0000 /start:a87f0000 /length:10000
Ora siete a posto. Spegnete e riaccendete la Fonera: sulla seriale (impostata a 9600-8-N-1) dovreste veder apparire il prompt di RedBoot.
Ora siete pronti a caricare DD-WRT o quello che vi pare…
Lo so, la guida è molto stringata, per cui in via del tutto eccezionale apro i commenti su questo post (che cmq verranno moderati), tramite i quali potete esprimere perplessità o chiedere chiarimenti.
Ora la tua fonera vive di nuovo, Omar!





Turbo come sempre
Adesso (se non hai già provveduto) bisogna piazzarne una dove tu sai
Hi!,
I’m very interested in your article. I’m trying to debrick my fon 2200 some month’s ago but I don’t have the cfe.bin file backed up from my hardware to restore it with jtag. Could you please send me yours? I’ll be very pleased!
Thank’s
Hello!
As far as I know you can use only RedBoot and not CFE on the fonera (but I might be wrong), so I don’t have any cfe.bin
I have only the images for RedBoot and for the Board Configuration (the hardware-dependent parameters). These images are sufficient to restore your fonera to a perfecty working state.
Could you post some link about CFE on the fonera?
As soon as I find some time I will translate the whole article in English, but basically the steps to restore your hardware are the following:
1) Wipe the whole flash
2) Load RedBoot via JTAG
3) Load the board configuration, after having edited the 12 bytes starting at 0×60 with the two MAC addresses of your fonera.
After that you can load (for example) dd-wrt via TFTP.
Feel free to ask if you have any question.
Bye!
Hi, again. Thanks for your answer.
I’m not sure, buy I think that redboot is a specific name for the generic bootloader of the router (cfe). So, I think you are right and I only need your redboot.bin. The problem is that I can’t download it from your link because I get an error.
If your fonera is model 2200, could you please send me redboot.bin file?
I have read that editing this file with an hex editor is possible to change the mac instead of merging your second file. I’m not sure, but it seems meaningfull.
Thanks in advance.
Not sure too, but CFE stands for “Common Firmware Environment” and is the bootloader normally employed on Broadcom-based hardware. Anyways, I didn’t notice that links didn’t work…it was because file permissions were set at 0700…now they should work.
I worked on fonera 2100 but the hardware is almost the same as the 2200; you can use without problems my redboot.bin.
To change the mac addresses you must edit board_config_template.bin and flash that file, but don’t do that if you see that by simply flashing the redboot.bin everything goes fine. I should edit my article, the described procedure is necessary only for heavily compromised hardware…
So, after having downloaded redboot.bin do:
tjtag3 -erase:custom /window:a8000000 /start:a8000000 /length:30000
This erases the area of the flash dedicated to RedBoot.
Next, take redboot.bin, rename it to custom.bin and do:
tjtag3 -flash:custom /window:a8000000 /start:a8000000 /length:30000
This is a very long process…if the process fails tell me where, I can give you some hints. Next try to load dd-wrt from TFTP. Make sure wifi works correctly, if not you must flash also board_config_template.bin.
In both cases, do this:
tjtag3 -backup:custom /window:a87f0000 /start:a87f0000 /length:10000
It should appear a file named custom.bin or backup.bin (I don’t remember) that contains your old board_config. It would be nice if you could send me that file, so I can see the differences between it and my board_config_template.bin (and I can publish the board_config for the 2200 if is different).
For any doubt I’m here.
Bye!
Now I could dowload the redboot.bin file!
I will try now to recover my fonera and I’ll give you some news.
Thank’s a lot!
I have bad news…
Your redboot.bin is the same I have taken from:
http://www.vslinux.net/openwrt/redboot/fonera_2200
I have successully put this file with tjtag (with the /fc:22 argument, if not it doesn’t recognizes the flash board) and finished ok.
But the fon doesn’t respond. No power, no ethernet led on.
The problem was months ago when I wanted to update the firmware and something was wrong. The firmware was corrupted, I did a tjtag -erase:wholeflash and since that I get no power led in the unit.
I have tried a lot of things and your post is the last opportunity before send my fon to trash.
If you have any good idea I’ll be interested in trying it.
Thanks!
Yes, redboot.bin should be that one…
What version of tjtag are you using? With 3.0.1 you should use /fc:25. But it is strange you must use that switch…What type of JTAG cable are you using? How long it is? If it is too long it can pick up environmental noise and the flash fails to be recognized. Can you post the output of tjtag3 -probeonly?
You said that the fonera does not reply, have you tried using serial port?
Anyway, try the following:
Erase the whole flash:
tjtag3 -erase:custom /window:a8000000 /start:a8000000 /length:800000
Rename redboot.bin to custom.bin and flash redboot:
tjtag3 -flash:custom /window:a8000000 /start:a8000000 /length:30000
Rename board_config_template.bin to custom.bin and flash it (don’t take care of editing it, you can set the correct mac addresses later):
tjtag3 -flash:custom /window:a87f0000 /start:a87f0000 /length:10000
Hope that helps…
I’m using tjtag 3.0.1 and I think that my flash chip is a Macronix MX25L6405D because it was detected by tjtag when I first try to flash the fonera some time ago.
My tjtag cable is handmade with about 20 cms long. It’s based on your pics above.
As I said before, I’ve tried everything and, of course, I’ve tried serial connection with a circuit based on a Max233 serial converter chip. I know it does work because before the fonera bricked I could start redboot on it with this cable. But know there’s no response.
Do you know if the problem can be in hardware instead of software?
Thanks.
I’m starting to think exactly that, maybe the problem is in hardware and not in software…but I can’t tell this without doing some tests on it.
No good if tjtag does not recognize flash by itself and if all the leds are off
If you want, and if you trust me, I can try to recover your fonera if you send it to me….
Sai dirmi se la versione dei file bin che hai pubblicato sono idonei per la Fonera + 2201 ??
Uhm…per quel che riguarda il redboot sarei propenso a dirti di si, per quel che riguarda la board config sarei invece propenso al no…La 2100 e la 2200 hanno l’hardware identico, la 2201 cambia…prova a cancellare e riflashare solo redboot, non flashare la board config…
Il problema è che io voglio fare un flash completo, mica hai dei link dove poter trovare i file bin che mi occorrono?
Se li avessi sarebbero postati
Spesso cmq capita che la board config sia sana, quindi io la prova del redboot la farei…
Come seconda prova puoi fare il backup della tua area di board config e poi fare la procedura che ho descritto…se la mia board config non è adatta te ne accorgi subito…