Configuring MTDPARTS in lede 17.01

Hi guys, I updated my tp-link 3220 from 4mb flash to 16mb flash and insaled openwrt 19, but when 3 users are connected to the WiFi router just resets so I want to go back to 17.01 but I dont know how to configure MTDPARTS in old openwrt. I found example on one device in tp-link.mk

define Device/cpe510-520
  DEVICE_TITLE := TP-LINK CPE510/520
  DEVICE_PACKAGES := rssileds
  MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)

So I need to configure MTDPARTS in my 3220

define Device/tl-mr3220-v1
    $(Device/tplink-16m)
    DEVICE_TITLE := TP-LINK TL-MR3220
    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
    BOARDNAME := TL-MR3220
    DEVICE_PROFILE := TLMR3220
    TPLINK_HWID := 0x32200001
endef

currently my art partition is at 0xff0000

                        partition@3f0000 {
-                               reg = <0x3f0000 0x10000>;
+                               reg = <0xff0000 0x10000>;
                                label = "art";
                                read-only;

can some one help me configure MTDPARTS ?

Read this topic. It's not for lede 17.01 but changes will be similar.

No, thats my thread for opnwrt 19 but its diferent for 17.01 every config for MTDPARTITIONS is on one line

MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware)

but I dont have 128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro, those partitions and dont know how to tell in MTDPARTS that my art partition is at 0xff0000

If you place a copy of the ART at 0x3fffff it should run a 4 MB firmware OK, it just won't use the extra space.

At some point the AR71xx builds for TP-Link models added a bit of code (mktplinkparts.c ?) that dynamically generates the partitions at boot time based on the flash driver's reported chip size. This is still in ar71xx. You can flash such a release ar71xx directly to a unit with a larger flash chip and it will use the extra space properly.

Model-specific code in the kernel is discouraged though, so the ath79 builds do not work that way. The flash partitions are hard defined in the dts.

I suspect the crashing is due to lack of RAM if you're running more packages than the basic build, and didn't upgrade the RAM.

But you don't test it. As @mk24 said in ar7xx 17.01 release there exist mtd autopartitioning in kernel code. So you only need change firmware size value only as you did before in the related topic.

1 Like

When you own-build ar71xx and want to build a ROM that is larger than 4M, you do need to increase the firmware size check value so it actually creates an image. If the final firmware ends up larger than the build system's configured chip size, it will not write out the .bin file.

If you're having crashes I'd suggest trying a release build or even stock firmware to rule out hardware problems. You can install a release build then at runtime install packages that exceed 4 MB.

Don't do that. It has known security vulnerabilities and by using it you are opening up your router and network for attacks. Try to make a lighter version of 19.07.4 by excluding things you do not need, or upgrade the router.

1 Like

Ok i did it, let me tell you its fast, here are diff changes that I made for 16MiB flsah

git diff
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index b76ed02ca3..0e8e0c17ae 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -77,6 +77,12 @@ $(Device/tplink-nolzma)
   IMAGE_SIZE := 7936k
 endef
 
+define Device/tplink-16m
+$(Device/tplink-nolzma)
+  TPLINK_FLASHLAYOUT := 16M
+  IMAGE_SIZE := 16192k
+endef
+
 define Device/tplink-4mlzma
 $(Device/tplink)
   TPLINK_FLASHLAYOUT := 4Mlzma
@@ -376,9 +382,10 @@ define Device/tl-mr3040-v2
 endef
 
 define Device/tl-mr3220-v1
-    $(Device/tplink-4m)
+    $(Device/tplink-16m)
     DEVICE_TITLE := TP-LINK TL-MR3220
     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
+    MTDPARTS := spi0.0:128k(u-boot)ro,0xfd0000(firmware),64k(art)ro
     BOARDNAME := TL-MR3220
     DEVICE_PROFILE := TLMR3220
     TPLINK_HWID := 0x32200001