OpenWrt Forum Archive

Topic: 16M flash can only use 4M.The log has been posted.Please help me.....

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

I have a mt7620n router.
openwrt barrier_breaker for wr8305rt default 8Mhz.
I've changed it to 16M SPI Flash.
use the default bin, it's worked very well

but i can only use 4M Flash for my package.
Log as follows:

root@alex:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    3.7M      1.1M      2.6M  30% /
/dev/root                 3.3M      3.3M         0 100% /rom
tmpfs                    30.2M      7.5M     22.8M  25% /tmp
/dev/mtdblock5            3.7M      1.1M      2.6M  30% /overlay
overlayfs:/overlay        3.7M      1.1M      2.6M  30% /
tmpfs                   512.0K         0    512.0K   0% /dev

the dmesg :

root@alex:~# dmesg |grep spi
[    0.280000] m25p80 spi32766.0: found w25q128, expected mx25l6405d
[    0.290000] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[    0.300000] 4 ofpart partitions found on MTD device spi32766.0
[    0.310000] Creating 4 MTD partitions on "spi32766.0":

root@alex:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 007b0000 00010000 "firmware"
mtd4: 006b3918 00010000 "rootfs"
mtd5: 003b0000 00010000 "rootfs_data"

I modify  target/linux/ramips/image/Makefile

Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,WR8305RT)

to

Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default16M/$(1),$(1),wr8305rt,WR8305RT)

but when i make this ,nothing to creat .
only this:
md5sums                                                        openwrt-ramips-mt7620n-vmlinux.bin
OpenWrt-ImageBuilder-ramips_mt7620n-for-redhat-x86_64.tar.bz2  openwrt-ramips-mt7620n-vmlinux.elf
openwrt-ramips-mt7620n-root.squashfs                           OpenWrt-Toolchain-ramips-for-mipsel_24kec+dsp-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2
openwrt-ramips-mt7620n-uImage.bin                              packages
I don't know the cause of the problem.

Can someone help me?

You might need additional steps. Possibly you need to set the memory size also in the device definition file, not just in the image generation code.
Probably here: https://dev.openwrt.org/browser/trunk/t … 7620n.dtsi
or here: https://dev.openwrt.org/browser/trunk/t … 8305RT.dts
For some of the ramips devices the dts files clearly specify the partitions, like here: https://dev.openwrt.org/browser/trunk/t … T7620a.dts

I am not familiar with ramips / dts files, so I can't point you to the quite correct one for your device, but investigate those files (based on your device's Makefile etc.)

One old discussion on similar topic: https://forum.openwrt.org/viewtopic.php … 19#p199719

EDIT: and you have 3.7 + 3.3 = 7 MB, not 4 MB as the title says. The remaining of the 8 MB goes to u-boot etc.

(Last edited by hnyman on 1 Jan 2015, 13:03)

hnyman wrote:

You might need additional steps. Possibly you need to set the memory size also in the device definition file, not just in the image generation code.
Probably here: https://dev.openwrt.org/browser/trunk/t … 7620n.dtsi
or here: https://dev.openwrt.org/browser/trunk/t … 8305RT.dts
For some of the ramips devices the dts files clearly specify the partitions, like here: https://dev.openwrt.org/browser/trunk/t … T7620a.dts

I am not familiar with ramips / dts files, so I can't point you to the quite correct one for your device, but investigate those files (based on your device's Makefile etc.)

One old discussion on similar topic: https://forum.openwrt.org/viewtopic.php … 19#p199719

EDIT: and you have 3.7 + 3.3 = 7 MB, not 4 MB as the title says. The remaining of the 8 MB goes to u-boot etc.

Hi,hnyman. Thanks for your reply.
I think you are right.
I tried to compile.

I modify  target/linux/ramips/image/Makefile

Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,WR8305RT)

to

Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default16M/$(1),$(1),wr8305rt,WR8305RT)

and

modify  target/linux/ramips/dts/WR8305RT.dts

                                partition@50000 {
                                        label = "firmware";
                                        reg = <0x50000 0xfb0000>;

dts syntax: reg  = <address, size>

Thanks hnyman.

The discussion might have continued from here.