1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Asus RT-N66U Low nvram

Discussion in 'Tomato Firmware' started by Dark_Shadow, May 1, 2012.

  1. Dark_Shadow

    Dark_Shadow Addicted to LI Member

    Found this on the DD-WRT forum, Posted: Tue May 01, 2012 12:40 pm

  2. Planiwa

    Planiwa LI Guru Member

    It should be very interesting to see what the Development Team comes up with.

    Meanwhile, here is how to get the facts:

    PS="$(</dev/mtd4 wc -c)"
    FF="$(</dev/mtd4 tr -c 'F' '\n' |grep -n F|sed 1q)"; FF=$((${FF%:F}-1)) # Bytes before start of 20-byte "FLSH" header.
    printf "%6s %s\n" "$PS" "NVRAM partition size (mostly unusable)."
    printf "%6s %s\n" "$(( PS -FF -20 ))" "Total usable NVRAM space (approx)."
    U="$(( $(</dev/mtd4 tr -d '\377'|tr -s '\0'|wc -c) -20 ))"
    printf "%6s %s\n" "$U" "Actually used NVRAM space (approx)."
    printf "%6s %s\n" "$(( PS -FF -20 -U ))" "Free NVRAM space (approx)." # (There are a <8 \0 pads, then 0xFF to end.)     
    V="$(( $(</dev/mtd4 tr -d '\377'|dd bs=20 skip=1 2>/dev/null|tr -d '\n'|tr -s '\0' '\n'|wc -l) ))"
    printf "%6s %s\n" $V "Used NVRAM variables (approx)."
    echo "From nvram command (not from flashed NVRAM), includes uncommitted settings:"
    nvram show|tail -1
  3. Dark_Shadow

    Dark_Shadow Addicted to LI Member

    I am running shibby's AIO builds but am reluctant to use more than 2 of the features at the same time due to the nvram shortage.

    It is possible for them to issue a firmware update that updates the CFE. I am hoping and praying they do so. That would make the 66U a King.
  4. Planiwa

    Planiwa LI Guru Member

    A CFE that does not waste most of the NVRAM partition would indeed be a good thing.

    Given the above numbers, 4437 bytes free should be enough for an additional 184 average settings.
  5. Dark_Shadow

    Dark_Shadow Addicted to LI Member

    Another update from the DD-WRT forum

  6. Toastman

    Toastman Super Moderator Staff Member Member

    That's very interesting, because now ASUS are getting, and responding, to customer feedback that 32K is not enough. They may do the same with other models.
  7. mikeownage

    mikeownage Networkin' Nut Member

  8. Toastman

    Toastman Super Moderator Staff Member Member

    RT-N66U 64K Update

    Asus recently published code which has the mod in it, although they have not yet released firmware with this feature enabled. JYAvenard has just been experimenting with this and has just added the code to Tomato - it appears to work fine. So shortly Shibby and my builds will have it also. I did post a build (1.28.0500.3) which I have since withdrawn, as the update has broken some other features.

    Please not that it isn't a cfe update, and it will only work while firmware using this code is being run. It will revert to only using 32K if any other firmware is used. If you want to experiment, please back up all your settings first using the nvram export --set method here:


    There is a possibility that this method could also be used for other routers, but it would require some additional changes. At the moment only the RT-N66U has it.
    Dark_Shadow likes this.
  9. mikeownage

    mikeownage Networkin' Nut Member

    Alright, is there a mailing list or something I can subscribe to so I can be alerted when new firmware is released and for other news regarding your build toastman?
  10. Dark_Shadow

    Dark_Shadow Addicted to LI Member

    Ready to test as always.
  11. shibby20

    shibby20 Network Guru Member

    first test Tomato 64k on RT-N66U

    Gitsum likes this.
  12. ppsun

    ppsun Networkin' Nut Member

    That's a beautiful sight, shibby! :)
  13. menses

    menses Addicted to LI Member

    Has the 32K NVRAM limit been fixed now for good? Or is it just a hack/workaround that might break in the future? :)

    Btw, is it a hardware or software issue? If I have understood correctly the NVRAM resides in the flash but it's allocated in the CFE?
  14. lefty

    lefty Networkin' Nut Member

    IIRC it hasn't been fixed properly by Asus, its a firmware fix in tomato that recognizes the extra nvram variables. The real fix would be if they could program out a 64k NVRAM CFE. And i'm only speaking from a user perspective, but i am unsure why they don't issue a real fix. Linksys basically did it with the WRT320N > E2000 and WRT610Nv2 > E3000 as both those units are identical to their successors hardware wise, but the successors have a 60k NVRAM CFE, whereas the older units have a 32k NVRAM CFE.

    But as i said, its easy for me to say, perhaps much harder to actually do, but it did make me not buy anymore of their units, my last Asus unit was an RT-N16, great unit, but lacks nvram room for much VPN or many static leases, many port forwards, virtual SSIDs etc. So it was very disappointing to me when they brought out the dark knight with such little NVRAM. So i ended up going back with good ole linksys as they have pretty much adjusted on all their units to either 60k or 64k NVRAM natively within the CFEs. Also, i do not see it being broken in the future, unless the tomato devs/coders decide not to support it anymore, which is highly unlikely.
  15. digiblur

    digiblur Networkin' Nut Member

    What are you guys running on your router? I have a about 25 static leases, few port forwards, openvpn keys, 3 SSID's, bandwidth logging, that crazy long adblocking startup script, 3 VLAN's, etc in my setup and it fits in the 32k with a little room to spare. Granted it's only 5% free but it still fits in the 32k.

    But I do agree it always feels better to have more room right?
  16. Toastman

    Toastman Super Moderator Staff Member Member

    I also agree with lefty. The real solution is a revision to the cfe. ASUS, please take note...
    koitsu likes this.
  17. mstombs

    mstombs Network Guru Member

    I know dd-wrt holding out for this, but don't hold your breath! It is clear their CFE is tolerant of a 64kB nvram block, but if there is a problem it would reset to a 32kB default. But I haven't seen lots of reports of failures with tomatousb or rmerlins asus mods?
    It would be trivial for Asus to recompile with the default nvram 64kB (or even 128kB IMHO), I think its the thought of users upgrading CFE's in the field (and the inevitable failure rate) and the need for firmware to support multiple versions which means they will hold off for ever!
  18. lefty

    lefty Networkin' Nut Member

    Feels better? Somewhat, makes the router run more stable? Indeed. :)
    And with a dual radio unit, it uses ALOT more nvram variables right off the top just for the radio configs alone. My friend has a wrt610n and flashed with dd-wrt he has 27k of 32k with nothing config'd, essentially just enough to run a basic network. Should Asus decide to really fix this problem @ the CFE, i should once again use their products, they have some nice hardware without a doubt, but with small nvram on a unit that you are going to pay $150 + on, just does not seem right to not have the added NVRAM at the CFE level. And i haven't even ventured into thinking about the RT-AC66U... hopefully it doesn't have the same problem, although it probably does.
  19. digiblur

    digiblur Networkin' Nut Member

    Ahhh..forgot about the dual band part. But some of them are place holders and don't take up much space at all when entered. But it looks like there is the fix put in for this issue, or should I say workaround which is better than nothing.
  20. gingernut

    gingernut LI Guru Member

    Could they not issue a CFE update included in a future firmware upgrade and both be updated by the user? they would probably have fewer bricked units.

    Asus let users update motherboard bioses and even give instructions on how it's to be done, most treat it like almost an art.

    At the end of the day if they wanted to they could, maybe cause they brought out the AC unit they don't care to much about this model any longer.

    The AC version does have a 64k CFE confirmed.

    BTW if anybody's interested here is a post made today about updating the units CFE to a newer version.
  21. menses

    menses Addicted to LI Member

    But in the end this is just a software issue? I.e. a new CFE could fix it for good?

    Is the CFE open source?

    Interesting... What's the purpose of the update? What's new in
    (Yes, I read the original post but didn't understand it: "The goal is to return CFE possibility to read variables from NVRAM which is lost while NVRAM been upgraded 64Кб in recent stock firmware releases." ???)
  22. mstombs

    mstombs Network Guru Member

    Broadcom did release a version of CFE as opensource, you can still get it here


    But this does not include the specific processor support for the SOC used in our routers. Asus and others do release some CFE sourcecode -some is 'shared' by the kernel, BUT it never seems to exactly match what is actually used. The code included on a CD supplied with one of my RT-N16 did include compilable CFE code - but the result was much smaller than the one in use and there were clearly 'strings' in the Asus version not present in the source-code - so didn't dare try it. I did get a self compiled CFE to boot on a WRT54G-TM (which I knew I could recover by JTAG), and it did work for a while with 128kB nvram, until it didn't and I put the original CFE back!

    In the CFE source I have seen the start of NVRAM is searched for in a number of places, but there are checksums across the nvram that use a compile time size allocation for the NVRAM_SPACE. Asus must have disabled these checks in the N66u or made the size dynamic.

Share This Page