OpenWrt Forum Archive

Topic: Can a WR702 be upgraded to run OpenWrt?

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

The default flash is to small to run OpenWrt, but i have some
flash chips (16Mb) which i normally use for the wr703.

Can i fit one in the wr702 to run OpenWrt? and is the flash
layout (Uboot/data/Firmware/ART) the same?

Besides flash the ram is only 16Mb is this enough to run OpenWrt?

I know that the price difference between a wr702 and a wr703 is
very small to go throught all this trouble, but i have the hardware
and all it have to do is run a small telnet server with a bash script.

Grtzz  Mark

Do you mean 16 MB?,  also you say the RAM is 16Mb, the but the wiki says 8 MB. might be enough with a very stripped Openwrt compiled by yourself. 

I don't have this router, but I think this is possible.

Thanks for the answer, and indeed the Wiki says 8Mb ram (i thought it was 16Mb ram)
i also have some ram chips (64Mb)  but it will be a nightmare to get it in... (66 TSOP)

If it's only a FLASH/RAM problem i can solve that, the rest of the hardware is identical
to a wr703 i hope...

Grtzz  Mark

I did upgrade wr702n to 64Mbyte RAM / 16Mbyte flash and OpenWRT. It has the same hardware as wr703n, except for missing USB plug and USB related tiny pieces of hardware.

dimonix wrote:

I did upgrade wr702n to 64Mbyte RAM / 16Mbyte flash and OpenWRT. It has the same hardware as wr703n, except for missing USB plug and USB related tiny pieces of hardware.

That's good! to hear thank you for the answer, i don't need the USB, it only tears a webpage every 5 minutes and parses it
so that my AMX can telnet the data for further use, a perfect! job for a wr702.

Grtzz  Mark

dimonix wrote:

I did upgrade wr702n to 64Mbyte RAM / 16Mbyte flash and OpenWRT. It has the same hardware as wr703n, except for missing USB plug and USB related tiny pieces of hardware.

That's exactly what I'm currently doing. I've got the 64MB ram chip soldered on. I dumped the stock flash chip and replaced U-Boot on the 2MB flash with pepe2k's modified one.

So right now I do have the failsafe web interface of U-Boot. It takes the first 64KB of the 2MB, the rest is untouched. I plan on programming this 2MB image (custom U-Boot + stock firmware image) on the 16MB chip once I get it.

Now I'm not sure if it's how to do it properly... I plan on updating the firmware with an openWRT "sysupgrade" image (custom built for 16MB flash) using U-Boot firmware upgrade page. I just hope this will properly map the ART partition and retreive it from the untouched stock flash offset.

Is it how it should be done?

Should I put the 100% stock image of the TL-WR702N on the 16MB and upgrade firmware to openWRT using the 16MB build generated for when you flash from official firmware?

I just want to make sure I get the proper specific data (MAC, serial, ART) when I upgrade to openWRT!

Thanks.

EDIT:
I'd also like to get my head clear on the flash layout of the WR702N.

From what I read about WR703 the first 128KB is reserved for U-Boot(first 64KB) and specific unit Data like MAC(second 64KB). The last 64KB of the 2MB is ART partition. The rest can be considered as the "firmware" partition and contains no unit-specific data.

Is that right?

(Last edited by psyko_chewbacca on 3 Feb 2014, 04:29)

You need a SPI programmer with proper adapter to handle flash chips.
The procedure is the following (router without soldered serial port):
1) upgrade your router to openwrt.
2) backup mtd0 (you need to keep MAC and model id)  and mtd4 (ART) partitions from your router to your pc
3) dd if=mtd0.bin bs=1 skip=64K of=mtd0-1.bin && cat mtd0-1.bin >> uboot.bin
    where uboot.bin is your modified uboot with web interface.
4) program your new 16MB flash chip with uboot.bin (created above) using SPI programmer; replace your old flash with new one
5) boot the router in failsafe mode with web interface
6) program ART using mtd4.bin file; program FIRMWARE using openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
Did I miss something? smile

(Last edited by dimonix on 3 Feb 2014, 09:32)

Well first of all, I can't upgrade to OpenWRT using the stock flash chip of the WR702N (2MB). So I cannot recover mtd0 and mtd4 the way you describe.

I do have a SPI flash programmer and that's how I did manage to overwrite the U-Boot on the 2MB chips. I just need to know the current offsets of the ART partition, MAC and Model ID data to extract from the stock dump and inject into a freshly built OpenWRT image.

After thinking about it, I'll simply take the "factory" generated image and manually inject all the data (U-Boot, ART, MAC, model ID) into it before programming the 16MB flash chip with it.

I modified a few WR702/703 to 16Mb Flash/64Mb RAM, this is how i did it.
(I have a SPI Flash programmer)

1. Unbox and test if the unit works, after that upgrade the 16/32Mb ram to 64Mb,
   again test if the unit still works. (The Chinese firmware works fine with 64Mb)
2. Remove original Flash and make a dump of it, i do this always twice and compare
   these two to be 100 procent sure the data is OK.
3. Download modified U-Boot http://www.tech-blog.pl/pliki/u-boot_mo … 012014.rar
   this is the latest (for WR703) from pepe2k with overclock feature.
4. Download OpenWRT AA 12.09
   http://downloads.openwrt.org/attitude_a … actory.bin
5. From your original Flash dump only the ART section is important, it's exactly 1088bytes
   for a 4Mb Flash the ART section starts at 0x3F1000, for a 2Mb Flash it starts at 0x1F1000
   dump these 1088 bytes to a file.
6. Next step depends a little on your Flash programmer, if you can work with offsets you don't
   need to make an empty file, else you have to make a file filled with 0xFF from exactly! 16.777.216 bytes
7. My $7 dollar programmer can't so i work with this empty file and a good HEXeditor.
   at 0x000000 replace with the modified U-boot bootloader
   at 0x01FC00 is your MACaddress xx xx xx xx xx xx (you can read this from the bottom of your WR702/703)
   at 0x01FD00 is (i think) model and WPS pin, i always use 0x07 0x03 0x01 0x01 0x00 0x00 0x00 0x01
   at 0x020000 replace with OpenWRT AA 12.09
   at 0xFF1000 replace with your saved 1088bytes ART data.
8. Program your 16Mb Flash with this data, again to be sure i read the Flash and compare it with the file.
9. Put your new 16Mb Flash back in and if everything wend well you will find a fresh WR703 with OpenWRT at
   192.168.1.1
A. Be Happy, you now have an almost unbrickable WR703 :-)

Grtzz Mark

PS: Does anybody know a good utility for Ubuntu that can send UDP packets, so i can talk to pepe2k U-boot
bootloader without the need for a serial connection?

Hi Mark_V

Thank you very much for the info. As the days go by I learn about this thing more and more.

What you're writing suggest that WPS and model number might be optionnal after all. I read that WPS pin and Model number are at 2 different offsets (1FC00 and 1FD00). So it looks like you don't need to enter a proper value coming from the stock dump at these 2 offsets for OpenWRT to work properly! I don't really mind about WPS functionnality (if that's what WPS PIN does). It also look like Model number wouldn't interfer with OpenWRT either.

So I'll be maing my 16MB images real soon!

Just for info, what 16MB flash chip did you use? I ordered 2 Spansion S25FL127S but I was able to program them each only once and even with that, nothing got written between address 0x0 and 0x100... Now the chips cannot be erased or rewritten at all...

I think I'll order some Winbonds W25Q128 instead. Never had any issue with Winbond in the past. They're just a little more expensive than Spansion on Digikey.

EDIT: For your request on how to that to U-Boot via network you should check out netcat or syslog(-ng) if you just want to capture messages coming from it.

(Last edited by psyko_chewbacca on 4 Feb 2014, 03:17)

psyko_chewbacca wrote:

What you're writing suggest that WPS and model number might be optionnal after all. I read that WPS pin and Model number are at 2 different offsets (1FC00 and 1FD00). So it looks like you don't need to enter a proper value coming from the stock dump at these 2 offsets for OpenWRT to work properly! I don't really mind about WPS functionnality (if that's what WPS PIN does). It also look like Model number wouldn't interfer with OpenWRT either.

At 0x1FC00 is definitely your MAC adress, if you look at pepe2k U-boot improvements it says:

Ethernet MAC is set from FLASH (no more "No valid address in FLASH. Using fixed address")

I don't know (never tried) if OpenWRT looks at 0x1FD00 for its modelnumber, funny thing is
that all the WR702's i modified identify as WR703 v1 and that looks a lot like the hexnumbers
at 0x1FD00.

For the Flash chips i only used Winbond W25Q128 i bought them from:
http://www.ebay.nl/itm/380767987675?ssP … 1439.l2649

But... the cheap Chinese programmers do have problems with Win7 i had problems programming them
or they didn't program at all, when i used an old Window$ XP laptop all went fine. (allthough it still takes
a very! long time (+/- 30mins) to program a 16Mb Flash)
And it's wise to use Flash chips that are supported by the bootloader, for more info look at:
https://github.com/pepe2k/u-boot_mod

Happy programming

Grtzz Mark

Followed Mark_V   instructions to the T and it worked perfectly. Thank you. 
Here's my setup:
• 16MB  (128Mbit) Flash - Winbond  PN: W25Q128   (Digi-key PN: W25Q128FVSIG-ND)
• 64MB  (512Mbit) RAM   - Alliance Memory PN: AS4C32M16D1A-5TCN,  66 pin TSOP (Digi-key PN: 1450-1286-ND)
• Programmer:  EZP2010 USB HIGH Speed Programmer (ebay, Aliexpress, etc).  $11 free shipping from China, 2 weeks to U.S.
• "SOIC SO8/SOP8 (for 0.200" width body) to DIP8 EZ Programmer Adapter Socket" to be used in the programmer in order to program the flash. Look on ebay or AliExpress, should be <$5 USD.
• Hex Editor:  Hex Editor Neo

(Last edited by overstate99 on 6 Apr 2016, 06:03)

The discussion might have continued from here.