Tp-link wa855re flash upgrade to 16MB

How should I change the partitions to support a 16-MB flash memory ? for now I can correctly compile U-Boot for this model with the support of 16mb but I have no idea how to change the partitions .

I would start from the target/linux/ar71xx/image/tiny-tp-link.mk file.

The profile itself is found from "Device/tl-wa855re-v1". It includes a common profile "Device/tl-wa85xre" and overall settings from "Device/tplink". The MTDPARTS variable, which controls the partitioning on the MTD sublayer, is under the "tl-wa85xre".

Armed with this info, I would create a new device profile like this. In here, I combined the "tl-wa855re-v1" and the "tl-wa85xre" to a single profile:

define Device/tl-wa855re-v1-16M
  $(Device/tplink)
  TPLINK_HWREV := 0
  KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header
  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
  MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware)
  DEVICE_TITLE := TP-LINK TL-WA855RE v1 (16 MB flash)
  BOARDNAME := TL-WA855RE-v1
  DEVICE_PROFILE := TLWA855RE
  TPLINK_HWID := 0x08550001
  TPLINK_BOARD_ID := TLWA855REV1
endef
TARGET_DEVICES += tl-wa855re-v1-16M

Now adjust the MTDPARTS variable so it suits your larger flash memory. The layout shown in this profile is similar to https://openwrt.org/toh/tp-link/tl-wa850re. There's the 'uboot', 'kernel' and 'rootfs' (which when combined together are called 'firmware'). They are followed by 'config' and 'art' partitions.

To be on the safe side, I'd keep 'config' and 'art' in their current locations, as it is uncertain who or where uses these partitions. As such, their relative addresses might be hardcoded somewhere else, and it is not possible to move them around. Also, the data that is already present on your smaller flash chip might be unique to your board and as such, they cannot be replaced if lost.

It's not a complete solution, but it should get you started.

thanks for the interest, I had created a similar profile before but I was still at the layout, which is perhaps the most obvious thing . in particular I do not understand the syntax. 3648k is the size of the firmware, that is kernel + rootfs but @ 0x20000 what does it specify?

edit:
ok there are, analyzing better that @ 0x20000 is the offset, and specifies the beginning of the kernel + rootfs (firmware) right ?

I get this error bootlog maybe a problem with uboot? ubootlog

I partitioned this way

spi0.0:128k(u-boot)ro,2024k(kernel),13912k(rootfs),256k(config),64k(art),15936k@0x20000(firmware

mtdsplit: no squashfs found in "rootfs"

The "config" partition is used by stock firmware. If it is left in the OpenWrt partitioning scheme it will be unused space.

The ART should be in the last block of the flash chip. ART is produced at the factory with unit-specific data such as MAC addresses and radio calibration. OpenWrt treats it as strictly read-only. WiFi will not work if the ART is missing or corrupted.

The rootfs is placed immediately after the kernel. Since the squashfs is not ever going to be re-written at runtime, it does not need to be aligned on an erase block. I thought the kernel dynamically finds the rootfs at boot.

Many Atheros TP-Link models have tplinkparts.c in the build, which ignores any pre-defined partition table and builds a new one during boot. tplinkparts.c uses the flash chip size reported by the flash driver. Thus if you have one of these builds you can install a larger chip and the extra space will be used with the same firmware.

Edit: Removed. If mk24's comments hold true then what I said before doesn't matter. It seems the kernel cannot identify the root filesystem type. This is specified by a kernel argument, but the custom source file might change that, too.

update: problem solved, now I can properly modify the partition

how do you do it? I want to try

hi Greetings all. I tried upgrading the rom tplink wa855re-v1 to 16MB, how do I change the value in MTDPARTS

define Device/tl-wa85xre
  $(Device/tplink)
  TPLINK_HWREV := 0
  KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header
  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
  MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware)
endef

Don’t bother with ar71xx, it’s dead.

If you want to pursue, use the ath79 platform, create a new board, edit the DTS to reflect your changes.

Be aware that 32 MB of RAM is as critical an issue as is 4 MB of flash, if not more so.

2 Likes

I want to try it, can you help me? which one should i change

I no longer have this device and I don't remember the procedure but see this maybe can serve yourself .

1 Like

thanks susy very clear and beautiful tutorial

I have changed mtdparts and the build process is successful, but why are the factory.bin and sysupgrade.bin file sizes only 3mb, is there an error or the file size is that?

The image is the (compressed) size of the kernel and file system, not that of the entire flash. 3-4 MB would not surprise me

1 Like

is that normal? and can be used? sorry i asked jeff a lot

Yes that's normal if you're just building the basic system that was set up for the small chip. When you install and boot you will find there is available space of about 12 MB to install more files at runtime. Or you can build in more packages from the start.

2 Likes

As they have well said @jeff & @mk24 it is normal and depends on the size of the kernel you have compiled and on any packages inserted . A kernel configured with multiple features obviously produces a larger image same thing for additional packages

1 Like

thank you mk24 reply and explanation
Thank you also to Jeff and Susy for replying and giving a detailed explanation

hy I need your help, I plan to upgrade the mediatek tplink rom 840nv5 4mb to 16mb flash, what files should I edit