Search This Blog

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.

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 0xb0000000IMAGE_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.

--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.

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_ADRESSIMAGE_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.

Comments

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 ?

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.

+Bimcan 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: 0xBLUBLUBthen use this comman with the adress:flash uboot to memmory adress=0xBLUBLUB

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".

Post a Comment

Popular Posts

Installing newer gcc/g++ versions is easy: sudo apt-get install gcc-4.7 g++-4.7
If your system does not provide the new versions, you might still be able to get them via a different repository. Add the toolchain repository to your system and update your sources:sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get update
Now you should be able to install gcc/g++. The real problem comes after that. How to make use of the newer versions?

Option #1 - Uninstall older versions
This is sometimes not an option, because lots of dependencies will be uninstalled which you might need, or you want to keep those versions around for compiling stuff that still uses them.

Option #2 - Use update-alternatives to switch versionsThis informative post describes it pretty well. I'll sum it up here. First remove all update-alternatives:sudo update-alternatives --remove-all gccsudo update-alternatives --remove-all g++
Now add update-alternatives for 4.6 and 4.7 and make the g++ configuration a s…

Wow. This was a royal pita. I wanted to build this wake-up-light-alarm-clock-media-thingy for my girlfriend. Well, I got my hands on a RPi Zero and needed an LCD display. I found this nice-looking "WaveShare 4" IPS display" on Ebay and spent days trying to get it to work properly. You want a hint? DONT DO IT! BUY A HDMI SCREEN! Refresh rate sucks, Kodi is not working with hardware-acceleration, Framebuffer copying never worked. Short: It sucked!

So. Next chapter: Bought a 5" HDMI screen here. It has an HDMI input and connects to the RPi GPIO pins for power and touch functionality... and works ALMOST out of the box on a fresh Raspbian install (from 5/2016). Nice!

Sometimes you are in the need to read back the OpenGL backbuffer, or other framebuffers. In my case the question was how to read back a downsampled framebuffer resp. its texture to system memory. There are different methods for this and I wrote a small benchmark to test them on various systems.

UPDATE #1: A thing I've totally overlooked is that you can actually blit the backbuffer to the downsampled framebuffer directly, saving you the FBO overhead (memory, setup, rendering time). I've updated the page and the code reflecting that.UPDATE #2: The code now works on Windows and Linux (via GLX). Maybe I'll port it to GLES2 for the Raspberry Pi too... :)UPDATE #3: The code works on the Raspberry Pi now using OpenGL ES 2.0. Reading the framebuffer is quite slow though even with an overclocked device. It's not the actual reading that is slow, but that we have to render to another framebuffer first and back to the screen. Atm all buffers and textures use RGBA8888, which might s…