TP-Link Archer C7 - Custom build question

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


Joined: 14 Mar 2023
Posts: 6

PostPosted: Tue Mar 14, 2023 21:58    Post subject: TP-Link Archer C7 - Custom build question Reply with quote
I have a TP-Link Archer c7 v5 router. I would like to compile custom firmware (or at least the Linux kernel part of the firmware). I am looking for answers to the following questions:

- which .config* file should be used for this router from the src/router/ and src/linux/universal/linux-3.18/ directories? If there isn't exactly the right file, which one should you start from, which one is closest to this type of router?

- which Makefile should be used for the compilation from the src/router/ directory?
Sponsor
skoles321
DD-WRT Novice


Joined: 14 Mar 2023
Posts: 6

PostPosted: Sat Apr 01, 2023 13:59    Post subject: Reply with quote
I got to the point where I managed to compile the Linux 3.18-d6 kernel (vmlinux, then with objcopy -> vmlinus) and combined it with the rootfs content extracted from a working firmware using tplink_safeloader. (Before that, lzma, mkimage, and then trx_n were done, they are all functional, because it was possible to test their use on a kernel extracted from an also functional firmware.)

Now I'm at the point with my attempts, there is an almost-working firmware that doesn't boot, but it's not fully bricked either: the power led, and ~18 seconds after the start of the boot the WAN led light up, but but no other working functions: no network address, no wifi signal.

I think that not bricked because the router is in this state accepts the reset button, which, when pressed, restarts the router and stops again in the power led and WAN led (yellow) states.

If you look at a working firmware, you can see that the WPS led lights up together with the power led ~11 seconds after the router is turned on.

In the firmware I made, this WPS led lighting is missing. Unfortunately, I don't have a serial device that can be used to debug what happens ~11 seconds after the boot starts. I think that some component is missing during the compilation of vmlinux, or the kernel is misconfigured, which is possible because I edited the ${LINUXDIR}/.config file myself, starting from the ${LINUXDIR}/.config_archerc25 configuration file, but I don't know exactly what values it expects for archer c7 v5 router firmware.

So the bottom line is that it would be enough to just compile the kernel so that it is functional (bootable). Any help would be greatly appreciated Smile
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2318
Location: Canada

PostPosted: Sun Apr 02, 2023 4:07    Post subject: Supported Reply with quote
You are aware that the Archer C7 v5 is supported already right?

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/
Choose any build folder, look for tplink_archer-c7-v5 sub folder.

If you are looking to build DD-WRT from source, good luck.

I believe there are only two active devs: brainslayer (main dev, originally build dd-wrt) and one other.

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
skoles321
DD-WRT Novice


Joined: 14 Mar 2023
Posts: 6

PostPosted: Sun Apr 02, 2023 10:09    Post subject: Reply with quote
Thanks, I know Archer C7 is already supported. I want to recompile because I want at least a kernel that includes JFFS2 support (I know that it was included until the 2019-07-04 build, after which it was removed due to lack of space). My plan is to delete the contents of the rootfs/usr/share/tor/ directory because I don't use it anyway, and that way the ddwrt (mtdblock3) partition will be large enough to mount the /jffs directory.

And I would like to use one of the latest rootfs.

What I really need is information on how to configure the 3.18 kernel to work in the Archer C7 V5 router.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Sun Apr 02, 2023 10:51    Post subject: Reply with quote
The C7 v5 has a USB port. A larger picture explanation as to why you'd want space on the flash chip to wear out for some l33t k3wl sh1t would help. Multi-partition USB drive, one being opt, the other one being jffs. Keep it simple.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
skoles321
DD-WRT Novice


Joined: 14 Mar 2023
Posts: 6

PostPosted: Sun Apr 02, 2023 13:00    Post subject: Reply with quote
dale_gribble39 wrote:
The C7 v5 has a USB port. A larger picture explanation as to why you'd want space on the flash chip to wear out for some l33t k3wl sh1t would help. Multi-partition USB drive, one being opt, the other one being jffs. Keep it simple.


The setup I imagine is the following: sometimes our ISP does not provide internet access via the cable. I can handle this situation using a USB modem. This has been tested and works, I have a Huawei HiLink mode modem, I can use the usbnet.ko and cdc_ether.ko modules for this.

A small script (or scripts) is required to use this function. I know that there is an option for startup and custom scripts, but I would like to store the modem management parts of the scripts on the jffs partition, since the USB port is occupied by the modem in this case.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Sun Apr 02, 2023 17:55    Post subject: Reply with quote
If those kernel modules are already present in the firmware, that means you should have "Mobile Broadband" as a WAN option, I presume. So without further details, I resign to overly complicating something that's probably quite simple for whatever reason or logic.

https://wiki.dd-wrt.com/wiki/index.php/Mobile_Broadband

https://wiki.dd-wrt.com/wiki/index.php/Cellular_Phone/USB_Modem_as_WAN_connection

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
skoles321
DD-WRT Novice


Joined: 14 Mar 2023
Posts: 6

PostPosted: Sun Apr 02, 2023 18:08    Post subject: Reply with quote
dale_gribble39 wrote:
If those kernel modules are already present in the firmware,


No, unfortunately not all of these modules are included in the firmware, specifically cdc_ether.ko is missing. That's why jffs would be good, so that the missing modules can be stored on that partition.

This problem can still be solved in another way, by adding the missing modules to the rootfs extracted from the firmware, and creating a new firmware with the necessary programs such as mksquashfs, tplink_safeloader, trx_n.

But if there was jffs2 support in the kernel, I would prefer to store the extra modules there as well.

The main problem is that the current dd-wrt kernel lacks the necessary symbols to load the jffs2.ko module. Therefore, this special module can only be loaded for a kernel that was compiled with this support from the Linux source code.
skoles321
DD-WRT Novice


Joined: 14 Mar 2023
Posts: 6

PostPosted: Fri Apr 21, 2023 20:06    Post subject: Reply with quote
Sorry guys, I've been trying with version 02-28-2023 (r51887) until now, and while trying, I didn't notice that starting with version 03-08-2023 (r51976), jffs2 support is back in the official build. Thus, experimentation became pointless:)

Thanks to everyone for the help, but especially to BrainSlayer for putting jffs2 back into the official release Smile
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