Using the Easybox 803A (Arcadyan ARV752DPW22) with OpenWRT 14.07 / 15.05

The Vodafone Easybox 803A has nice router hardware. I found one on the trash recently and decided to put OpenWRT on it. Here's how. This is based on the instructions found in the OpenWRT wiki, the OpenWRT forum and random bits on the net.

UPDATE2: I have updated the post to make it clearer what to do, but please read this WHOLE POST to understand what's going on technically! If you are not sure, read it again...

UPDATE: I updated the router to OpenWRT 15.05 "Chaos Calmer" and it works just fine. You can get the binaries here. If you have already installed 14.07 you can just update via the router firmware upgrade page in the web interface.

I used Ubuntu 14.04 and did most image uploads using ubootwrite.py, because everything else didn't work reliably for me, especially with older U-Boot versions. Also note that the U-Boot version contained in OpenWRT 12.09 (~2010.03) does not work with any of the LAN functions (BOOTM, ARP, TFTP). You have to use a newer version of U-Boot for this to work or use ubootwrite.py to upload via the serial port. Note that depending on your configuration you might need to prepend commands using the serial port with "sudo". I made a package with the binaries I've used. This is OpenWRT 14.07 Barrier Breaker release for the ARV752DPW22 and includes the bootloader, a backup booloader in ASCII format for restoring via UART and the actual OpenWRT image.
Please refer to the original OpenWRT page for additional instructions and images.

First part: Preparing a stock Easybox 803A for OpenWRT

Please note:
[bl] = Original/stock ARV752DPW22 bootloader
[ub] = U-Boot
[lo] = Local PC

Dumping your original firmware

This is really the first thing you should do. You do need parts of it later (the board configuration area) and it might come in handy to have a backup! The stock firmware has a BRN bootloader.
  • [lo] Download brntool using git: 'git clone http://github.com/rvalles/brntool'.
  • [lo] Change to directory: 'cd brntool'
  • Connect your USB to serial adapter to the router.
  • [lo] Start CuteCOM serial terminal: 'cutecom &'
  • Open the port (115200 Baud, 8 data bits, 1 stop bit).
  • Power-cycle / power up the router.
  • [bl] Be quick to press SPACE three times to stop the router from booting. Then press '!' to get into administration mode.
  • Close CuteCOM or disconnect it from the port so that brntool has access to it.
  • [lo] Dump the firmware: 'sudo python brntool.py --read=ARV752DPW22_orig.dump --addr=0xB0000000 --verbose --size=0x800000'
  • This will take some time (~1 hour). When finished, power-cycle the router
  • [bl] Be quick to press SPACE three times to stop the router from booting. Then press '!' to get into administration mode.
  • [lo] Dump the firmware again: 'sudo python brntool.py --read=ARV752DPW22_orig2.dump --addr=0xB0000000 --verbose --size=0x800000'
  • [lo] Compare the two firmwares (should give NO output): 'diff ARV752DPW22_orig.dump ARV752DPW22_orig2.dump'
  • [lo] If both files are the same, remove one of the files: 'rm ARV752DPW22_orig2.dump'
  • [lo] Extract the WiFi configuration from the original firmware: 'dd if=ARV752DPW22_orig.dump bs=1 skip=$((0x7f0000)) count=$((0x10000)) of=ARV752DPW22_orig_boardconfig.dump'

Load U-Boot into RAM and execute it

  • Power-cycle / power up the router and open the serial port.
  • [bl] Be quick to press SPACE three times to stop the router from booting. Then press '!' to get into administration mode.
  • [bl] Choose '[M] Upload to memory' and the default adress 0x80002000.
  • Close serial terminal or disconnect it from the port so that sx has access to it.
  • [lo] Send U-Boot image via XMODEM: 'sx IMAGE_FILE_NAME <USB_DEVICE >USB_DEVICE'
USB_DEVICE = Path to your USB to serial converter, e.g. /dev/ttyUSB0.
IMAGE_FILE_NAME = The image file you want to upload. I used the bootloader from "openwrt-lantiq-arv752dpw22_brn-u-boot.img" (2nd stage bootloader for brnboot).
  • When finished sx will tell you the amount of bytes uploaded. Convert this to hexadecimal to use it for copying to flash in later steps.
  • [bl] When done, open the port again in CuteCOM and press ENTER.
  • [bl] Choose '[Y] Go to memory' and the default adress 0x80002000.
  • [ub] U-Boot will now start. Press ENTER quickly to prevent it from trying to load the kernel.
You could now, if you want, upload the U-Boot image "openwrt-lantiq-arv752dpw22_nor-u-boot.img" (standalone bootloader) into the flash to overwrite the stock bootloader or use the in-memory U-Boot to load an OpenWRT image, put it into flash and start it. I'd go the route of first putting U-Boot into flash, but please note that if this fails your booloader is broken and the router won't boot anymore. You will have to put it into UART mode to revive it!

Copy U-Boot image into flash

  • [ub] Turn off flash protection: 'protect off all'
  • [ub] Erase flash before writing: 'erase 0xb0000000 +IMAGE_SIZE'
  • [ub] Write image into flash: 'cp.b 0x80040000 0xb0000000 IMAGE_SIZE'
0xb0000000 = For U-Boot / bootloader images, use 0xb0000000, for OpenWRT images use 0xb0020000 (OpenWRT 12.09) resp. 0xb0040000 (OpenWRT 14.07 and later)
IMAGE_SIZE = The size of the image / file you've uploaded as a hexadecimal number, e.g. 0x........ You will get this e.g. from the sx command line program or ubootwrite.py after uploading.
  • Now if you power-cycle the router the new U-Boot version should start automatically.
You are done with the first necessary steps to get a working U-Boot bootloader into flash. Now that you have done that, use one of the two following methods to copy and flash an OpenWRT image to the device:

Second part: Installing OpenWRT on the Easybox 803A

A: Upload new U-Boot or kernel image using U-Boot with ubootwrite.py

  • Connect to terminal and boot into U-Boot bootloader (press ENTER after booting).
  • Close serial terminal or disconnect it from the port so that ubootwrite has access to it.
  • [lo] Get ubootwrite.py script
  • [lo] Write the data to the device RAM: 'sudo python ubootwrite.py --serial=USB_DEVICE --write=IMAGE_FILE_NAME --addr=0x80040000'
--addr=... is the adress where to put the data. Use 0x80040000 as a safe value in memory BEHIND the booloader. Otherwise you would be overwriting the booloader...
IMAGE_FILE_NAME = The image file you want to upload. I used the OpenWRT image "openwrt-lantiq-xway-ARV752DPW22-squashfs.image".
  • When finished ubootwrite will spit out a CRC32 value you should check, and a hexadecimal image size you can use to copy the image into flash.

B: Upload new U-Boot or kernel image using XMODEM

  • Connect to terminal and boot into U-Boot bootloader (press ENTER after booting).
  • [ub] Load data to RAM using XMODEM: 'loadx 0x80040000'
  • Close serial terminal or disconnect it from the port so that sx has access to it.
  • [lo] Send data using XMODEM: 'sx IMAGE_FILE_NAME <USB_DEVICE >USB_DEVICE'
IMAGE_FILE_NAME = The image file you want to upload. I used the OpenWRT image "openwrt-lantiq-xway-ARV752DPW22-squashfs.image".
  • When finished sx will tell you the amount of bytes uploaded. Convert this to hex to use it for copying to flash.
Now that you have a you have the data in RAM you can copy and flash it to the device...

Copy uploaded image into flash

  • [ub] Turn off flash protection: 'protect off all'
  • [ub] Erase flash before writing: 'erase 0xb0000000 +IMAGE_SIZE'
  • [ub] Write image into flash: 'cp.b 0x80040000 FLASH_ADRESS IMAGE_SIZE'
FLASH_ADRESS = For U-Boot / bootloader images, use 0xb0000000, for OpenWRT images use 0xb0020000 (OpenWRT 12.09) resp. 0xb0040000 (OpenWRT 14.07 and later)
IMAGE_SIZE = The size of the image / file you've uploaded as a hexadecimal number, e.g. 0x........ You will get this e.g. from the sx command line program or ubootwrite.py after uploading.

Now if you power-cycle the router and don't interrupt the boot process, OpenWRT should start. Let it start completely one time until no more new messages appear on the terminal and see something along the lines "init complete". OpenWRT will have extracted the squashed image to flash (you see messages like "erasing all blocks after the end marker... done."). This will possibly overwrite the WiFi configuration area that you must rewrite to the device for WiFI to work. This only muste be done if you flash OpenWRT via uboot and not when you upgrade OpenWRT via the web interface:

Rewrite WiFi configuration area to device

  • Connect to terminal and boot into U-Boot bootloader (press ENTER after booting).
  • Close serial terminal or disconnect it from the port so that ubootwrite has access to it.
  • [lo] Write configuration area to RAM: 'sudo python ubootwrite.py --serial=USB_DEVICE --write=ARV752DPW22_orig_boardconfig.dump --addr=0x807f0000'
  • Connect to terminal again.
  • [ub] Turn off flash protection: 'protect off all'
  • [ub] Erase flash before writing: 'erase 0xB07f0000 +0x00010000'
  • [ub] Write image into flash: 'cp.b 0x807f0000 0xB07f0000 0x00010000'
  • Power-cycle the router.
If WiFi is still not working after this, reset the router configuration using the LuCI tool / Router Web-GUI.

Comments

Galaxy S3mini said…
Excellent guide. Very well structured!
ps. Witch image did you install for 15.05 because i cant manage to start the wifi
https://downloads.openwrt.org/chaos_calmer/15.05/lantiq/xway/openwrt-15.05-lantiq-xway-ARV752DPW22-squashfs.image ?
Bim said…
Sorry. Didn't see your comment. I think you need to use the squashfs image version. Make sure to properly save and rewrite the WiFi configuration area, otherwise you will have problems! If it does not work on the first boot, try to reset the router configuration using the LuCI tool / Router Web-GUI. That worked for me.
gross912 said…
'erase 0xb0000000 +IMAGE_SIZE' ?????
U-boot erase?????
Unknown said…
nice destroyed my box with this

cp.b 0x80040000 0xb0000000 0x00480004

used your openwrt-lantiq-arv752dpw22_brn-u-boot.img
Unknown said…
With the two wires on the reistors i can't get it to uart recovery boot :-(
ROM VER: 1.0.3␍␊
[15:31:37:159] CFG 05␍␊
[15:31:37:159] Read EEPROMX␍␊
[15:31:37:159] X␍␊
[15:31:37:159] SFLASH␍␊
[15:31:37:159] X␍␊
[15:31:37:159] SFLASH␍␊
[15:31:37:159] X␍␊
[15:31:37:159] SFLASH␍␊
[15:31:37:159] X␍␊
Unknown said…
would be nice if you do a guide you should not give too many options and especially show how you converted your uploaded bytes given from sx to hex format...

When finished sx will tell you the amount of bytes uploaded. Convert this to hex to use it for copying to flash.

fail does'nt work for me
Unknown said…
When i get it to the srial emergency boot can i flash uboot+openwrt in one go to the non volatile memmory?
Minkerstinker said…
+Bim
can you please elaborate on how to flash the uboot to nand, how to calculate the right adress? Would be real nice to get an actual example like:
ok Uploaded uboot with xmodem sx command...
linux command line says: xyz bytes transfered..
thats in hex: 0xBLUBLUB
then use this comman with the adress:
flash uboot to memmory adress=0xBLUBLUB
Bim said…
Everybody: Please try and understand what's going on! If a sentence has an e.g. in it, you have to figure out that part or value yourself! I can not do it for you...

On topic: Afair, when you already have uboot in RAM, you have to upload "openwrt-lantiq-arv752dpw22_nor-u-boot.img" (NOR, as-in: "can write it to flash") using the upload method A or B and then follow the section "Copy U-Boot image into flash".
u-boot.asc from your archive not have loadx command :-(
Bim said…
No idea. I didn't build that. I just packaged what I found...