Posted: Mon Apr 26, 2021 23:42 Post subject: Can't program region at 0xbffa0000: Unknown error
So, after flashing DD-WRT v24-SP1 on my D-Link DIR-300, and noticing that it had a worse performance than the stock fw (in terms of wifi speed), i decided to flash the lastest beta aviable for this router (04-24-2021-r46446). And i tried so, but with no luck, and only to get this error message after running fis create linux:
Can't program region at 0xbffa0000: Unknown error
Now, I decided to check on the filesize of the v24-SP1 linux.bin (3.645.440 bytes) and compare it with the latest beta linux.bin (3.664.526 bytes), and i noticed that the older linux.bin was smaller than the latest linux.bin. So, i begun looking for a beta build that was equal or smaller than the v24-SP1 linux.bin, and i found one (05-27-2013-r21676). Its linux.bin file, weighs 3.637.248 bytes, and so, is smaller than the v24-SP1, and, for my suprise, it flashed succesfully to the router. Now, i dont know if it was something that i did wrong, but it didnt booted. I can acces the bootloader via telnet, but nothing else. Maybe this is one of those builds that dont work? IDK, i want to flash the lates beta aviable at the time.
Does anyone knows what can i do to succesfully flash this fw??
Yes, i have Rev A, and i actually used that same wiki that you sent to update the firmware (i forgot to say it on the first post), but, as i said, i got no success. Also, thakns for the quote about the builds that have restart loops, its actually the one that i tested and didnt booted.
I only have a question, since i had some problems to go back to v24-SP1. Why is the update procedure different than the 1st install procedure (after redboot and the custom bootloader is flashed). When i flashed r21676, and tried to go back to v24-SP1, i had to do all the 1st time install procedure to get the router back to boot. Is it becasue any specific reason? Also, as i read more and more about different routers with this problem, i find out that some people try to "remap" the flash partition so it avoids the "bad bits". Is it possible to do so with the D-Link DIR-300? I know that it has a little flash, but, maybe there are only a few bad bits and i can avoid them at the moment of flashing?
Ok, after some research, I figured out that the flash memory had some dead/stuck bits, and, afaik, the only way to fix them, is by replacing the flash chip, or, remapping the stuck/dead bits (thing that I don't know how to do, but it would be great to do this instead of what I'm about to explain)
The other thing that I thougt, is, maybe I can build my own DD-WRT firmware, and try to get to get the same filesize as the v24 SP1 release (the difference in filesize is pretty small actually, the V24 SP1 file weights 3.645.440 bytes, and the release r46446 weigts 3.664.526 bytes, a difference of only 20KB). As this is my only option at the moment, I begun by reading this guide on the official DD-WRT wiki. The only thing, is that I'm stuck, and I dont know what to do. Here is the part where I'm stuck:
You'll need the 3.4.6 and 4.1.0 mipsl uclibc toolchains. They are available at toolchains.tar.xz. The mips-uclibc 3.4.6 toolchain is used for building the kernel and the 4.1.0 mipsel-uclibc toolchain is used for building the user-mode packages. Unpack the toolchains wherever you desire, the scripts below will set up symlinks appropriately.
To build DD-WRT you simply need to:
0. Run ready_ddwrt.sh and ready_ddwrt_root.sh (the scripts are below).
1. Add the 4.1.0 toolchains bin folder to your path environment variable. i.e. PATH=$PATH:/home/db90h/toolchains/4.1.0-uclibc/bin
I've already downloaded the file toolchains.tar.xz, and uncompressed it, but, I can't find the folder that the guide shows me that I have to add to the PATH variable. This is all I got from the toolchains.tar.xz file:
That wiki is slightly outdated and incorrect (it was written when Broadcom routers were the only ones supported, I think)... and the toolchains tarball is also outdated.
Oh, its good to know, is there any updated guide to try it out?
Compiling DDWRT is extremely difficult, I do not know your level of expertise in compiling but you must be a real wizard to pull it off.
I know of only a handful of people getting it done
Really? I mean, the wiki that i used doesnt seems to be very hard. I dont have a lot of knoweldge, but i already compiles two or three times androidx86. Idk if compiling DD-WRT its very different from androidx86.
In any case, isnt there any tool to easily strip out some components from a DD-WRT firmware? I just want to remove everything that has to do with PPPOE, because im going to use this router as a repeater or wifi extender. Is there anything else i can remove if im just going to use this router as a repeater? As i said, i only need the image to be 25-30kb smaller than it already is
Well, after giving up trying to build DD-WRT, i decided to modify an existing image with the Firmware Modification Kit. I begun by cloning the repositopry from github, and then unpacked the firmware with the next command:
After doing so, I started to look what i wanted to delete. I decided that PPP was something i wasnt interested on having on my router, so i started looking where could the binaries be. I found the pppd binarie on /usr/sbin/pppd. Its size is around 183K, more than i needed to free up, so, i decided to delete that binarie and rebuild the image. I did so with the next command:
After running the command, this two errors showed up:
CRC update failed.
Firmware header not supported; firmware checksums may be incorrect.
It appears that the firmware did succesfully rebuild, so i decided to not pay attention to those two error mesagges. After checking the output file, i noticed that the file sized the same as before, and i think that it has to do with the block size, its 256K. By my understanding, i must take out more than 256K to notice a difference, so i continued with the previous task, finding more ppp related things to remove. I came across this two files (rp-pppoe.so and pppol2tp.so), both located under /usr/lib/. I searched a bit about them, and i found out that theyre plugins to do certain actions related to ppp directly with the kernel, so, in theory deleting them wont cause anything go wrong, rigt? Also, i still didnt reach the 256K that i had to get rid of, i only did 208K. So, i continued looking for files, and came across the ipkg binarie. Im not interested in having any package manager included on my router, since i cant do a lot with its mediocre specs, so, will something go wrong if i remove it? Also, is there anything else i can remove? i only got up to 236K of removed files.
On a side note, i tried to flash the first and only rebuilded firmware i made, an i dont know why, i cant telnet to the bootloader. I tried everything, from pressing the reset button 2s after the switch LEDs lit up, right after pluging in the router, pressing the reset button for more than 10s before and after the switch LEDs lit up, without pressing the reset button, and i got no luck, i always get a Network Error: Connection timed out. error in PuTTY. Im using the attached script to automatically telnet to the router's bootloader. Also, i attach my current ip configs. What am i doing wrong?
Appearenly, i just decided to use the latest dir300-firmware.bin and update trhough the http ui, and it updated succesfully... I dont know what to say. I really dont...
I gues its the end of this thread. Ill try to again set up bridging and see if i get a better or equal performance from the stock fw