OpenWrt Forum Archive

Topic: A5-V11 : upgrading the spi flash ...

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

This my first attempt on compiling openWRT from sources  so I decided to start by compiling an image for the super cheap (and powerful) router (A5-V11) that can be found on AliExpress for about $7.
The A5-V11 has very limited storage (4MB) that is not enough to get full advantage of the router (USB 2.0 Port, Wifi and Ethernet port) like installing the USB-related cool stuff like samba file sharing , USB-to-Serial drivers , file system ..etc
So I begun with de-soldered the spi flash and and saved it's contents as binary file (using usb spi progammer )

http://i.imgur.com/i87W8vG.jpg


http://i.imgur.com/dmCE3qh.jpg


and programmed the file contents to the new 8M spi flash (W25Q64BV) to get a working image (openWRT still reads it as 4M) and Edited the /target/linux/ramips/dts/A5-V11.dts file to:

/dts-v1/;


/include/ "rt5350.dtsi"

/ {
    compatible = "A5-V11", "ralink,rt5350-soc";
    model = "A5-V11";

    palmbus@10000000 {
        spi@b00 {
            status = "okay";
            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "W25Q64";
                reg = <0 0>;
                linux,modalias = "m25p80", "W25Q64";
                spi-max-frequency = <10000000>;

                partition@0 {
                    label = "u-boot";
                    reg = <0x0 0x30000>;
                    read-only;
                };

                partition@30000 {
                    label = "u-boot-env";
                    reg = <0x30000 0x10000>;
                    read-only;
                };

                factory: partition@40000 {
                    label = "factory";
                    reg = <0x40000 0x10000>;
                    read-only;
                };

                partition@50000 {
                    label = "firmware";
                    reg = <0x50000 0x7b0000>;
                };
            };
        };
        gpio1: gpio@660 {
            status = "okay";
        };
    };

    pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group = "i2c", "jtag", "uartf", "led";
                ralink,function = "gpio";
            };
        };
    };

    ethernet@10100000 {
        mtd-mac-address = <&factory 0x4>;
    };

    esw@10110000 {
        ralink,portmap = <0x2f>;
    };

    wmac@10180000 {
        ralink,mtd-eeprom = <&factory 0>;
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };

    gpio-leds {
        compatible = "gpio-leds";
        system {
            label = "a5-v11:blue:system";
            gpios = <&gpio0 20 1>;
        };
        power {
            label = "a5-v11:red:power";
            gpios = <&gpio0 17 1>;
        };
    };

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        reset {
            label = "reset";
            gpios = <&gpio0 0 1>;
            linux,code = <0x198>;
        };
    };

    gpio_export {
        compatible = "gpio-export";
        #size-cells = <0>;

        usb {
            gpio-export,name = "usb";
            gpio-export,output = <1>;
            gpios = <&gpio0 7 0>;
        };
        root_hub {
            gpio-export,name = "root_hub";
            gpio-export,output = <1>;
            gpios = <&gpio0 12 0>;
        };
    };
};

I successfully compiled the Chaos Calmer (r49087) with luci and flashed it with sysupgrade and the whole 8M flash is seen by openWRT:

http://i.imgur.com/ORba4Mf.png


http://i.imgur.com/V9kgw8f.png

and the pre-compiled images can be downloaded here:
https://drive.google.com/folderview?id= … sp=sharing.

TODO:

* To compile a 16M image but the problem is that i don't have a 16M flash chip so I ordered 5pcs from AliExpress and I'm waiting to get them and to test them.

* Upgrade the RAM: I have one question is there any compatible 512MBIT 54-pin TSSOP RAM with the original 256Mbit (EM63A165TS-6G) and what changes that have to be made to the software and hardware to make this upgrade ??? I will dig more about that and any help is appreciated to Make this cheap router better.

Great work. Very Interesting. Note that if you follow the instructions here, you will have plenty room for samba, mindlna, ftp, http, nfs etc without having to upgrade the spi flash or RAM. The disadvantage of the method  here is that a USB drive needs to be always connected.

vernonjvs wrote:

Great work. Very Interesting. Note that if you follow the instructions here, you will have plenty room for samba, mindlna, ftp, http, nfs etc without having to upgrade the spi flash or RAM. The disadvantage of the method  here is that a USB drive needs to be always connected.

extroot is an alternative but you have to sacrifice a usb stick and the most important you will occupy the USB port which is the key feature of this router, so why not just unsolder the flash and replace it with a 8M or even 16M ?.

Hi,

a really newbie question. I replaced the spi Flash with a 8mb one. No Problem till now. I was also able to get the System up with your 8mb sysupgrade file. I used a FT2232 Mini Module to read out an write using flashrom tool

But, how can i use the OpenWRT Image builder? I would like to add some packages, like alsa utils. But the make process says "sysupgrade.bin is too big"

Which files do i have to edit?

Thanks  for your work till now

Edit 1: I thought it should be enough to just edit the A5-V11.dts file to  ".. reg = <0x50000 0x7b0000>;" but ist doesnt build the Image. Im quite sure the Problem is in front of the Screen - but i dont get it.

Edit 2 : No idea if it was the best idea to edit this file:
OpenWrt-ImageBuilder-15.05-ramips-rt305x.Linux-x86_64/target/linux/ramips/Image/Makefile

and edited the line
Image/Build/Profile/A5-V11=$(call BuildFirmware/Poray8M/$(1),$(1),a5-v11,A5-V11)

But with this... i killed the device. So... i go back to start tomorrow.. :-(

Edit 3: Used Spi Flash: Micron  N25Q032

compatible = "N25Q64";
                reg = <0 0>;
                linux,modalias = "m25p80", "N25Q64";
                spi-max-frequency = <10000000>;

(Last edited by etlam on 7 Apr 2016, 18:43)

I've been working on exact this for WNCE2001, even has a ralink SoC. I tried flashing my image just today but it wouldn't have it.

https://forum.openwrt.org/viewtopic.php … 95#p316095

The only difference is I edited the Makefile to have it build a 8M image. Maybe that's where I went wrong.

etlam wrote:

Hi,

a really newbie question. I replaced the spi Flash with a 8mb one. No Problem till now. I was also able to get the System up with your 8mb sysupgrade file. I used a FT2232 Mini Module to read out an write using flashrom tool

But, how can i use the OpenWRT Image builder? I would like to add some packages, like alsa utils. But the make process says "sysupgrade.bin is too big"

Which files do i have to edit?

Thanks  for your work till now

Edit 1: I thought it should be enough to just edit the A5-V11.dts file to  ".. reg = <0x50000 0x7b0000>;" but ist doesnt build the Image. Im quite sure the Problem is in front of the Screen - but i dont get it.

Edit 2 : No idea if it was the best idea to edit this file:
OpenWrt-ImageBuilder-15.05-ramips-rt305x.Linux-x86_64/target/linux/ramips/Image/Makefile

and edited the line
Image/Build/Profile/A5-V11=$(call BuildFirmware/Poray8M/$(1),$(1),a5-v11,A5-V11)

But with this... i killed the device. So... i go back to start tomorrow.. :-(

Edit 3: Used Spi Flash: Micron  N25Q032

compatible = "N25Q64";
                reg = <0 0>;
                linux,modalias = "m25p80", "N25Q64";
                spi-max-frequency = <10000000>;

I have never used the image builder before because I'm a newbie too big_smile and i find compiling is more fun and straightforward.
And please let me know when you succeed by editing the makefile.

Spegs21 wrote:

I've been working on exact this for WNCE2001, even has a ralink SoC. I tried flashing my image just today but it wouldn't have it.

https://forum.openwrt.org/viewtopic.php … 95#p316095

The only difference is I edited the Makefile to have it build a 8M image. Maybe that's where I went wrong.

Yes i think (not sure but it worked for A5-V11) you have to only edit the .dts file as the makefile uses the information from .dts files to know which partition at what address and size.

Hi,

after desoldering, writing the flash and solder again i decided to take a look into TFTP functionality. Thats really cool :-)

If i use the image builder to build my own image with the standard A5-V11.dts file, my board works fine with the new spi flash.

But if i only change the firmware section to "reg = <0x50000 0x7b0000>;". Now the device doesnt boot any more. Instead it hangs after about 0.7 seconds:

[    0.660000] Bridge firewalling registered
[    0.670000] 8021q: 802.1Q VLAN Support v1.8
[    0.680000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.700000] Please append a correct "root=" boot option; here are the available partitions:
[    0.710000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.710000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Your file (..8M from google share) works fine
So i hoped you changed something elsewhere.. A place everyone knows that he has to change it, but not me... :-)

(Last edited by etlam on 9 Apr 2016, 13:40)

Abdullbasit wrote:

TODO:

* To compile a 16M image but the problem is that i don't have a 16M flash chip so I ordered 5pcs from AliExpress and I'm waiting to get them and to test them.

* Upgrade the RAM: I have one question is there any compatible 512MBIT 54-pin TSSOP RAM with the original 256Mbit (EM63A165TS-6G) and what changes that have to be made to the software and hardware to make this upgrade ??? I will dig more about that and any help is appreciated to Make this cheap router better.

You maybe need to recompile Uboot to make these changes. The reason I say this is because I been messing around with it myself lately and have found options in menuconfig for DRAM Component and DRAM Bus:

http://i.imgur.com/zuVnKlC.jpg

You may also need to add support for your flash chip.

Take a look at this fork: https://github.com/cidermole/ralink-uboot.git

You should be able to compile it for your DRAM component if you find one.

That seem very interesting... Let us know if is possible to use a 16Mb or greater flash chip

Spegs21 wrote:

You maybe need to recompile Uboot to make these changes. The reason I say this is because I been messing around with it myself lately and have found options in menuconfig for DRAM Component and DRAM Bus:

http://i.imgur.com/zuVnKlC.jpg

You may also need to add support for your flash chip.

Take a look at this fork: https://github.com/cidermole/ralink-uboot.git

You should be able to compile it for your DRAM component if you find one.

Do you mean that  u-boot is the key to change RAM ? If yes , That would be very interesting as i didn't touch u-boot before and what files are responsible for RAM type size ??
and is this the bootloader used by this router?

Dear Abdullbasit,
would You please share your saved original 4MB Flash image. I can't find it anywhere. I have bricked both of my devices (uboot and FW too). I'd like to reprogramm them, bring them back to factory condition.
Thank You, z.cseke

z.cseke wrote:

Dear Abdullbasit,
would You please share your saved original 4MB Flash image. I can't find it anywhere. I have bricked both of my devices (uboot and FW too). I'd like to reprogramm them, bring them back to factory condition.
Thank You, z.cseke

This is the folder containing the files taken from my original A5-V11 after i installed openwrt on it but you have to join all the parts and save them in one image file (sorry i don't have them as one file)

https://drive.google.com/folderview?id= … sp=sharing

part    size            file name
mtd0: 00030000  "u-boot"
mtd1: 00010000  "u-boot-env"
mtd2: 00010000  "factory"
mtd3: 003b0000  "firmware"

After receiving the 16M flash chips i ordered from aliexpress i compiled openwrt for 16M chip:
https://drive.google.com/folderview?id= … sp=sharing
firstly i programmed the blank 16M chip with a previously read working image (4M image)
in this link:
https://drive.google.com/file/d/0B80aAC … sp=sharing

then i installed the compiled image by sysupgrade and i will share the result later after testing the performance (and probably add some packages to make full use of the 16M space).

Hi, Abdullbasit!
I am also very interested in updating my router to 16Mb SPI flash. Could you give more information, what chip you had ordered?

vershinin wrote:

Hi, Abdullbasit!
I am also very interested in updating my router to 16Mb SPI flash. Could you give more information, what chip you had ordered?

I ordered W25Q128 (Winbond) from aliexpress like this:
http://www.aliexpress.com/item/Free-Shi … .69.mcn0gW

Do you have any results yet? I'm highly interested.

Also, could you tell if it is possible to use the A5-V11 as a ethernet adapter and in parallel share the ethernet connection via wifi when running openwert?

Thanks a lot.

I just flashed this file. OpenWRT is running but it asks me for the password.

https://drive.google.com/file/d/0B80aAC … dQQlE/view

@Abdullbasit did you set one?

Ok I managed to reset the a5-v11. Works now.

(Last edited by rosenrot on 18 Aug 2016, 08:57)

Hi,

I have a problem with opkg on 8Mb version.
Changing memchip and load image is fine (Thank you Abdullbasit). I've 8M.
But if I try to install kmod-usb-serial:
"opkg install kmod-usb-serial_3.18.27-1_ramips_24kec.ipk"
(downloaded from gl-inet.com)
I have:
"Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-serial:
*      kernel (= 3.18.27-1-4513bd298fb406bfd943328994a53e76) * "

Suppose I need recompile:
OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-142-gb6330a1 Release (git-15.363.78009-956be55) with Kernel Version    3.18.23 and mentioned 8M changes.

But I'm not good with it. (not try yet)

Anyone can help me?

update
opkg option --force-depends install *.ipk but its not work (no ttyUSB0 in /dev)

(Last edited by oldStrogg on 15 Oct 2017, 12:35)

The discussion might have continued from here.