Our OpenWRT device lacks of memory? Let's add bigger flash chip!!

Preface

So we have our TP-Link WR1043ND router, and we like to install some additional software…

Openwrt
NOT SO FAST!!!
... but the problem we probably face is lack of flash memory. In this article I will outline steps needed to expand OpenWRT device's flash memory. I will also show two major modifications in OpenWRT code that change sizes of partitions. This modification is also called OpenWRT Flash mod.

Roadmap

What we need?

  1. Our OpenWRT device - TL-WR1043ND (why? because it’s inexpensive, has Gigabit Ethernet Port and full N type radio) v2.1
  2. SPI flash memory programmer - I use MiniPRO TL866A.
  3. Hexadecimal calculator
  4. Open mind:)

Steps:

  1. Desolder original memory chip
  2. Read flash data from that memory(8MB)
  3. Write already read data to bigger chip(16MB)
  4. Solder new chip into the device
  5. Check if device boots and works(if not, You can solder back the old memory chip)
  6. Prepare OpenWRT build system
  7. Modify the firmware - change partitions sizes in qca9558_tplink_tl-wr1043nd.dtsi according for Your flash memory
  8. Modify the firmware - select different flash layout in generic-tp-link.mk for Your device
  9. Compile the firmware
  10. Flash new firmware
  11. Go WILD!

Hardware modifications

I will describe hardware modifications in the future(together with photos). The most tricky part is the software modification and I will focus on that.

Major software modifications

Device Tree

Device tree is file that describes hardware that our firmware will be running on. For TL-WR1043ND v2.1 - we are interested in file openwrt/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi. We want to change this part

Openwrt
Device tree flash layout modification
Openwrt
Our flash layout looks like that - before and after modification

Generated image size

OpenWRT also generates images that can be flashed on routers. We have to set in our device definition bigger flash size. This can be done in file openwrt/target/linux/ath79/image/generic-tp-link.mk.

Openwrt
Setting bigger image - 16MB

WHY?

Because we increase functional value of device with a little of labour and knowledge. And because I CAN!