Skip to content

WRT1900AC corrupt bootloader recovery

Chad McCue edited this page May 10, 2018 · 29 revisions

New instructions and u-boot binaries are available in my McDebian wiki

https://github.com/Chadster766/McDebian/wiki/C.-U%E2%80%90Boot-Recovery

My beloved WRT1900AC got its bootloader corrupt after a bluescreen during firmware update. Reviving it took me 2 weeks and countless hours of reading various bits and pieces of info on the web but it wouldn't have been possible without the help of Stefan Roel from the authors of u-boot (http://www.denx.de). To keep things short and concise, this is how anyone in the same situation as me can revive it.

  1. Get yourself a PC running a flavor of Linux (I personally used the 64-bit Ubuntu 14.04 with 32-bit libraries installed).

  2. A USB-TTL adapter (get one from Amazon, Ebay, etc…). I used an old Nokia DKU-5 cable stripped off at the phone end.

  3. Download kwboot from here: http://www.protechs-online.com/downloads/McWRT/Images/UBootRecoveryImages/kwboot/kwboot.tar and save it to your home directory (to keep command lines short). First of all get root acces in the Terminal. Type sudo -i and press Enter, then install kwboot by going to the location you saved it to (Home directory in my case) cd /home/test/ Unzip the archive tar –xvf kwboot.tar Actual compilation of kwboot: gcc kwboot.c

  4. Download the 2 files needed for unbricking the router from here: http://www.protechs-online.com/downloads/McWRT/Images/UBootRecoveryImages/ . As you noticed, one file is for booting from UART, the other will be transferred to the router and written to its NAND. Save them in the kwboot directory (/home/test/kwboot/ in my case)

  5. Now let’s set the executable bit on kwboot file chmod 777 kwboot

  6. Connect the USB-TTL adapter to the bricked router and the PC. DO NOT POWER ON THE ROUTER YET! Wait a few seconds then issue the following command: dmesg | grep USB and make note of the number after /dev/ttyUSB (it usually is 0) set the following bits to the adapter: chmod 666 /dev/ttyUSB0

  7. Now let’s get down to the interesting part: getting the router to boot from the UART image. In the Terminal window issue the following command:

./kwboot –t /dev/ttyUSB0 –b u-boot-uart.kwb –a

or

./kwboot -B 115200 -t /dev/ttyUSB0 -b u-boot-uart.kwb -a

and power on the router. Note of the arguments used in the command above: -a = use Armada XP timings -t = open a terminal in the same window after transfer completes -b = file that is to be booted from After the transfer finishes, you should be at the Marvell>> prompt. If you are not, power off the router, disconnect the USB-TTL adapter from the PC and get get back to step 3.

  1. If you are at the Marvell>> prompt, set up TFTP server on the PC (I used Ubuntu’s tftpd package) and put the u-boot-nand.kwb file in its tftpboot folder.

  2. Set your PC IP address to 192.168.1.2 then issue the following commands in the terminal window at the Marvell>> prompt (one at a time): setenv ipaddr 192.168.1.1; setenv serverip 192.168.1.2; tftp 2000000 u-boot-nand.kwb; nand erase 0 e0000; nand write 2000000 0 e0000

  3. If the above commands complete successfully we are ready to reboot the router. At the Marvell>> prompt issue the following command: reset

  4. In the same terminal window you should see the router booting up and stopping at the Marvell>> prompt

  5. Download the firmware image for WRT1900AC (either the stock image or McWRT) and save it to the tftpboot directory.

  6. At the Marvell>> prompt issue the following commands tftp 192.168.1.2 then get <firmware image name>

  7. VERY IMPORTANT! After transfer completes successfully, do NOT issue run flash_pri_image or run flash_alt_image commands, they will brick the router again and send you to step 3. Instead, the following command is to be used: run_linksysnandboot (if it fails, issue run_linksysaltnandboot)

  8. Leave the router to boot fully up then open its http management page to make sure it is running correctly.

  9. Power off the router and remove the USB-TTL adapter from the router.

  10. Power on the router.

  11. Happy surfing on the internet with your recovered WRT1900AC!

You can’t perform that action at this time.