Can't program region at 0xbffa0000: Unknown error

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Mon Apr 26, 2021 23:42    Post subject: Can't program region at 0xbffa0000: Unknown error Reply with quote
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:
Code:
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??

regards
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14102
Location: Texas, USA

PostPosted: Tue Apr 27, 2021 5:36    Post subject: Reply with quote
Read the wiki, I am presuming you have a rev A since you posted in the Atheros forum:

https://wiki.dd-wrt.com/wiki/index.php/D-Link_DIR300_rev_A
Quote:
Don't use Builds 21676 - 23503 as it has a restart loop.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Tue Apr 27, 2021 13:50    Post subject: Reply with quote
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?
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Thu May 06, 2021 0:04    Post subject: Reply with quote
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:

Quote:
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:

Code:
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:

Code:
fpp@DESKTOP-PG3VV3J:~/DD-WRT/toolchains$ ls
sources
staging_dir_powerpc
toolchain-aarch64_thunderx_gcc-7.3.0_musl
toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.2.0_musl_eabi
toolchain-arm_cortex-a9+vfpv3_gcc-8.2.0_musl_eabi
toolchain-arm_cortex-a9_gcc-8.2.0_musl_eabi
toolchain-arm_mpcore+vfp_gcc-8.2.0_musl_eabi
toolchain-armeb_xscale_gcc-8.2.0_musl
toolchain-i386_pentium_gcc-8.2.0_musl
toolchain-mips64_octeon_64_gcc-7.3.0_musl
toolchain-mips_24kc_gcc-8.2.0_musl
toolchain-mips_mips32_gcc-8.2.0_musl
toolchain-mipsel_1004kc+dsp_gcc-5.1.0_musl-1.1.10
toolchain-mipsel_24kc_gcc-7.1.0_musl
toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2
toolchain-mipsel_3.3.6_BRCM24
toolchain-mipsel_4.1.1_BRCM24
toolchain-mipsel_74kc_gcc-8.2.0_musl
toolchain-mipsel_gcc-linaro_uClibc-0.9.32
toolchain-mipsel_gcc4.1.2
toolchain-mipsel_mips32_gcc-8.2.0_musl
toolchain-powerpc_603e_gcc-5.4.0_musl-1.1.16
toolchain-powerpc_8540_gcc-8.2.0_musl
toolchain-powerpc_e300c3_gcc-4.8-linaro_uClibc-0.9.33.2
toolchain-powerpc_gcc-4.6-linaro_uClibc-0.9.33
toolchain-x86_64_gcc-8.2.0_musl

So, there is no 4.1.0-uclibc folder, so I don't really know what to do. Does anyone know where I have to point the PATH variable to?
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14102
Location: Texas, USA

PostPosted: Thu May 06, 2021 6:01    Post subject: Reply with quote
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.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12814
Location: Netherlands

PostPosted: Thu May 06, 2021 7:46    Post subject: Reply with quote
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

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Fri May 07, 2021 18:49    Post subject: Reply with quote
kernel-panic69 wrote:
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?

egc wrote:
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
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Wed May 12, 2021 2:28    Post subject: Reply with quote
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:
Code:
./extract-firmware.sh ../DIR-300_FW/linux.bin fw_extract/

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:
Code:
./build-firmware.sh fw_extract/

After running the command, this two errors showed up:
Code:
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?
fpp
DD-WRT Novice


Joined: 26 Apr 2021
Posts: 24

PostPosted: Sun May 16, 2021 21:49    Post subject: Reply with quote
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
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum