OpenWrt Forum Archive

Topic: U-Boot mod for routers with AR9331/AR9344

The content of this topic has been archived between 3 Apr 2015 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Menion wrote:

I see... thanks!
After your reply I went through the entire README and in the section "other" (I would suggest to better rename this section and write somewhere clearly that the server ip address is 192.168.1.2) I read:[...]

I will make Wiki and describe it better as soon as I have some free time, I have just returned from my holidays.

Menion wrote:

Could you please help me in how use the reset button? I mean: router off, power up while holding the reset button for the above duration, till I get the netconsole output?

Power up, then press and hold button (you can power up with button pressed, but that will also set default/safe clocks). There will be one LED blink during network initialization and just after that you will see all LEDs blinking ~once per second. Hold the button for at least 7 blinks (excluding one blink during network initialization) and then try to access U-Boot CLI over netconsole.

Thank you very much Pepe

Hi Pepe
I have tried, it works now
I have flashed the uboot embedded in the ready BB image tagged as 2014-11-19 release on a WDR3600 and a couple of TL841N V8.
Following refers to the WDR3600
The LED sequence is a little bit different, what I see is:

1) All led on for about one second, eccept the 5Ghz wireless
2) Power, star and 2.4Gh wireless led on
3) Led of the connected switch port turn on for one second
4) Led off
5) Start of operwrt/lede (if I press here the reset button I can enter failsafe)

If at stage 2 I press and keep pressed the reset button, something happens, the star and 2.4Ghz led blink at 1 sec for 6 time (7 including the first power on), the power and connected switch port turn on, I'm in uboot now, netconsole works, but httpd server must be started manually
I wanted to upgrade uboot, but I'm little doubious about the uboot_upg env script:

uboot_addr=0x9F000000
uboot_name=uboot.bin
uboot_size=0x10000
uboot_upg=if ping $serverip; then tftp $loadaddr $uboot_name && if itest.l $filesize == $uboot_size; then erase $uboot_addr +$filesize && cp.b $loadaddr $uboot_addr $filesize && echo OK!; else echo ERROR! Wrong file size!; fi; else ERROR! Server not reachable!; fi
firmware_addr=0x9F020000

The expected uboot size is set to 64kb, but the images on your server are of 123kb. I know the in the image, only the first 64kb are occupied by uboot, then there are the writable env variables and the last 5kb of the 128kb are the ART sector, but with this 123kb image I guess the script will fail, right?

Menion wrote:

I have flashed the uboot embedded in the ready BB image tagged as 2014-11-19 release on a WDR3600 and a couple of TL841N V8.[...]

It's really, really old version, without writable environment support and 64 KB image limit on TP-Link devices.

Menion wrote:

Following refers to the WDR3600
The LED sequence is a little bit different, what I see is:[...]

That's normal, I don't control LEDs connected directly to external Ethernet switch chip on WDR3600 and WDR4300.

Menion wrote:

The expected uboot size is set to 64kb, but the images on your server are of 123kb. I know the in the image, only the first 64kb are occupied by uboot, then there are the writable env variables and the last 5kb of the 128kb are the ART sector, but with this 123kb image I guess the script will fail, right?

If you still have there my BB image, you can upload new U-Boot image and use the same script.

But... there is some bug with clocking on AR9344 (https://github.com/pepe2k/u-boot_mod/issues/128), so it would be better to wait for fix as it hurts main time clock on the router.

Hi Pepe
Ok I'll wait. So I have to skip the uboot_upg script in this uboot version, right?
I perfectly understand the procedure to manually update uboot within uboot itself, so dump 128kb (0x20000) from flash, offset 0x0, to ram (normally 0x80800000), tftpboot the new uboot image to the same ram location, in order to merge the last 5kb of the old flash content with the new uboot, and then erase the 128kb of flash and write the, merged, 128kb of data from ram to flash.
But just a question: is it working with this old uboot version? Or some more adaptation are needed?
Bye

Menion wrote:

So I have to skip the uboot_upg script in this uboot version, right?

Yes, it won't allow you to use image bigger than 64 KB.

Menion wrote:

I perfectly understand the procedure to manually update uboot within uboot itself, so dump 128kb (0x20000) from flash, offset 0x0, to ram (normally 0x80800000), tftpboot the new uboot image to the same ram location, in order to merge the last 5kb of the old flash content with the new uboot, and then erase the 128kb of flash and write the, merged, 128kb of data from ram to flash.

Exactly!

Menion wrote:

But just a question: is it working with this old uboot version? Or some more adaptation are needed?

Yes, it will work.

Last question: since it will involve several steps, is it safe to do so in netconsole? I mean, safe as it can be upgrade the bootloader, I just want to avoid that some operation (erase, flash) could interfere with the networking

Menion wrote:

Last question: since it will involve several steps, is it safe to do so in netconsole? I mean, safe as it can be upgrade the bootloader, I just want to avoid that some operation (erase, flash) could interfere with the networking

Honestly, I haven't tested this approach, but I don't see any reason why it might cause this kind of problems.

http://i64.tinypic.com/j0csjp.png
I get this when I try to install it on my WR842N v3 router
Did I done something wrong???

(Last edited by AnteLo on 3 Jun 2017, 07:37)

https://forum.openwrt.org/viewtopic.php?id=33205  That guy modded u-boot 1.3.0 to make it work with atheros SOCs. I wonder if it could be done to QCA SOC routers as well, I understand newest u-boot takes too much space on flash, but 1.3.0 would probably fit.

I installed the version u-boot_mod__tp-link_tl-wdr3600__20170510__git_master-0c183583.bin on my TP-link router.

After this i'll try to install/test a SOPHOS uimage version (with the same hardware) to this device.
File info:
AP15.uimage: u-boot legacy uImage, MIPS OpenWrt Linux-3.18.11, Linux/MIPS, OS Kernel Image (gzip), 6880877 bytes, Tue Feb 21 11:46:07 2017, Load Address: 0x80060000, Entry Point: 0x80060000, Header CRC: 0x78E832C4, Data CRC: 0x3DD99FCA

When i try to boot this image i get:
u-boot> bootm
Booting image from 0x80800000...

   Image name:    MIPS OpenWrt Linux-3.18.11
   Build date:    2017-02-21 09:40:42 UTC
   Architecture:  MIPS
   OS/image type: Linux Kernel
   Compression:   unknown
   Data size:     6.8 MB (7132205 bytes)
   Load address:  0x80060000
   Entry point:   0x80060000

   Header CRC...  OK!
   Data CRC...    skipped

Stopping network... OK!
## Error: unsupported compression type 'unknown'!

So i think there is no gzip compiled in the uboot source. Is that this issue and can you resolve this?

(Last edited by jongerenchaos on 24 Jun 2017, 13:17)

jongerenchaos wrote:

I installed the version u-boot_mod__tp-link_tl-wdr3600__20170510__git_master-0c183583.bin on my TP-link router.

After this i'll try to install/test a SOPHOS uimage version (with the same hardware) to this device.
File info:
AP15.uimage: u-boot legacy uImage, MIPS OpenWrt Linux-3.18.11, Linux/MIPS, OS Kernel Image (gzip), 6880877 bytes, Tue Feb 21 11:46:07 2017, Load Address: 0x80060000, Entry Point: 0x80060000, Header CRC: 0x78E832C4, Data CRC: 0x3DD99FCA

What is SOPHOS?

jongerenchaos wrote:

So i think there is no gzip compiled in the uboot source.

Exactly.

jongerenchaos wrote:

Is that this issue and can you resolve this?

https://github.com/pepe2k/u-boot_mod/issues

Hi pepe,
I flashed your u-boot (latest version from your build server) to my wr841n v9.1.
It boots great, but when I try to enter web UI I can't get it working.
I'm turning router off with power button, pressing reset button, turning it back on, holding about 5 seconds.
I tried to connect ethernet to every lan and wan ports.
Router probably stops at u-boot like it should, but network stack seems not to work.
Ethernet leds are not blinking or shining.

I don't have USB->TTL cable, so I can't tell you what's on serial hmm

juniorjpdj wrote:

Hi pepe,
I flashed your u-boot (latest version from your build server) to my wr841n v9.1.
It boots great, but when I try to enter web UI I can't get it working.
I'm turning router off with power button, pressing reset button, turning it back on, holding about 5 seconds.
I tried to connect ethernet to every lan and wan ports.
Router probably stops at u-boot like it should, but network stack seems not to work.
Ethernet leds are not blinking or shining.

I don't have USB->TTL cable, so I can't tell you what's on serial hmm

Power up router with cable in LAN, press reset button, wait for first LED blink, then count 3-4 blinks and release the button. In latest version, LEDs should be blinking if the router is in web recovery mode.

Thanks, got it working.
I was pressing button before powering on router, when tried like you told me to it worked first time smile

(Last edited by juniorjpdj on 11 Sep 2017, 23:20)

I've seen, you was doing something for 1043nd.
Is it still valid?
And if yes, which hw versions will it cover?

(Last edited by juniorjpdj on 29 Sep 2017, 01:50)

Hi guys

I'm struggling with this u-boot mod on my tl-wdr4300 v1.4.
I've successfully used the 'u-boot-upgrade' script of the 2014-11-19 release (here I see 64KiB images all around, which is confusing). After 30+ tries I finally managed to reach the web-failsafe interface. http://192.168.1.1/uboot.html didn't accept the 123KiB image "u-boot_mod__tp-link_tl-wdr43x0_v1__20170831__git_master-b29f18ad.bin" downloaded from http://projects.dymacz.pl/:

Something went wrong during update
Probably you have chosen wrong file (TOO BIG OR TOO SMALL) or you were trying to update ART on device with
unknown FLASH type (and size) which is not allowed. Please, try again or contact with the author of this
modification. You can also get more information during update in U-Boot console.

At this point, instructions are sort of unclear.
Could anyone give a hint how to upgrade then u-boot mod to the latest available version? (Preparing my own 123+5KiB image in "the dd-wrt way" of the official page, and using the 2014-11-19 release might work. The only concern is if my router will boot after mtd-ing this image. It is also suspicious, that normally http://192.168.1.1/uboot.html should do this.)

Thank you in advance.

Meanwhile I've read somewhere that the 2014-11-19 release supports only the 64KiB images

Restating my previous assumption: Preparing my own 123+5KiB image in "the dd-wrt way" of the official page, and using the Barrier Breaked image with unlocked firmware partition might work?

You don't need to use unlocked image, just use mtd-rw (in repo of LEDE and OpenWRT).
Also you can use u-boot-upgrade script, modify it or just read it - it will learn you how to flash u-boot wink

Github links (add github[dot]com at front):
latest version of helpful script: pepe2k/u-boot_mod/blob/master/target_util/u-boot-upgrade
mtd-rw (eg. how-to-use example is available here): jclehner/mtd-rw

(Last edited by juniorjpdj on 29 Sep 2017, 01:48)

I found fork which adds 1043nd v1 support.
Pepe, can you do something with it?

ranma/u-boot_mod/tree/tl-wr1043nd

I don't really know what can I do to help you apply changes to current branch.

AnteLo wrote:

I get this when I try to install it on my WR842N v3 router
Did I done something wrong???

I have the same issue.
I have installed the latest openwrt-15.05.1-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin for my MR3020 but I cannot upgrade the u-boot:

-ash: u-boot-upgrade: not found



Probably I miss something but I do tot understand what ...
... on site it says :
Starting from official release "2014-11-19", you will find ready OpenWrt images, with unlocked u-boot partition, embedded U-Boot image and dedicated small script for easy update process inside release tarball. All you need to do is download last release, select proper OpenWrt image for your device, install it and invoke one command: u-boot-upgrade
???? i am wired.

Please assist me in this silly question...

(Last edited by miazza on 13 Jan 2018, 22:55)

Hi,

I try to update the uboot on wr703 with the last version.

I have upload your script "u-boot-upgrade" on /tmp and the right files (uboot.bin and md5sum) into /etc/u-boot_mod directory.

I have install the package "opkg install kmod-mtd-rw" and the device work on last Openwrt 17.01 (Lege)

I have this message at the end of your script execution:

=======================================================
DISCLAIMER: you are using this script at your own risk!

The author of U-Boot modification and this script takes
no responsibility for any of the results of using them.

     Updating U-Boot is a very dangerous operation
   and may damage your device! You have been warned!
=======================================================

-----> Do you want to continue (type 'yes' or 'no')? yes

[ ok ] Found U-Boot image file: 'u-boot_mod__tp-link_tl-wr703n_v1__20180204__git_master-4fbf43bf.bin'

-----> Do you want to use this file (type 'yes' or 'no')? yes

[ ok ] MD5 checksum of new U-Boot image file is correct
[ ok ] Backup of /dev/mtd0 successfully created

-----> Do you want to store backup (recommended) in '/etc/u-boot_mod/backup/' (type 'yes' or 'no')? no

[info] Partition '/dev/mtd0' is writable
[ ok ] New U-Boot image successfully combined with backup file
[info] New U-Boot image is ready to be written into FLASH

-----> Do you want to continue (type 'yes' or 'no')? yes

[warn] Could not write new U-Boot image into FLASH
[ ok ] Original '/dev/mtd0' partition content was not changed

Do you have any ideas?

BR, Xavier

The discussion might have continued from here.