Skip to content

Instantly share code, notes, and snippets.

@RikshaDriver
Last active June 20, 2025 15:57
Show Gist options
  • Save RikshaDriver/0388ba3f38f89eb975ebb0b915860ec2 to your computer and use it in GitHub Desktop.
Save RikshaDriver/0388ba3f38f89eb975ebb0b915860ec2 to your computer and use it in GitHub Desktop.
Compiling Realtek 8152, 8156 and 8157 ( RTL8152 ) drivers for QNAP NAS

Compiling Realtek RTL 8152, 8156 and 8157 drivers for QNAP NAS

Note

This guide was last updated on 17th Feb 2025

Many QNAP NAS devices only come with 1Gbe network interfaces. These devices can easily benefit from a simple network upgrade by connecting the ubiquitious 2.5Gbe USB NICs from Realtek. Unfortunately, some of the older QNAP NAS systems do not support the newer r8156 based 2.5Gbe NICs or r8157 based 5Gbe NICs as they run an older 4.x linux kernel and the r8152 source files included with the older linux kernel are based off an older codebase that predates the 8156/8157 series.

With some elbow grease however, we can build support for the 2.5 & 5 Gbe adapters and easily upgrade functionality.

rt_2 5gbe_qnap

VM & Build Environment Setup

Whilst any Linux build environment may be possible, I have chosen the older Debian 8. We need to download and install the latest Debian 8 i386 instance from Debian: https://www.debian.org/releases/jessie/debian-installer/

Build Essentials

Once our Linux VM is installed, we must also setup the environment for build. Login as "root" user and install the development packages using apt:

apt-get install build-essential libelf-dev bc

Other libraries may be required depending on the kernel/module build options

Compiler / Toolchain

In order to compile the kernel module for a respective QNAP system, we must identify the compiler on which the system was built. This can be done by querying the NAS itself using an SSH terminal:

cat /proc/version

This will show an output like:

Linux version 4.2.8 (root@U16BuildServer176) (gcc version 4.8.2 20131014 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) ) #2 SMP Thu Jun 29 05:42:26 CST 2023

In the case of the TS-431P arm based system, the kernel was built using linaro-1.13.1-4.8-2013.10, so we need the relevant cross compiler. QNAP have not included this compiler in their GPL Open Source repository so we must obtain it from linaro: https://releases.linaro.org/archive/13.10/components/toolchain/binaries/gcc-linaro-aarch64_be-linux-gnu-4.8-2013.10_linux.tar.bz2

Extract the contents to a directory such as the /opt folder.

QNAP provides other platform cross-compilers on their sourceforge repository: https://sourceforge.net/projects/qosgpl/files/QNAP%20NAS%20Tool%20Chains/

Kernel Source

The NAS Kernel source is available on sourceforge: https://sourceforge.net/projects/qosgpl/files/QNAP%20NAS%20GPL%20Source/

In the example of the TS-431P, we will download and extract GPL_QTS-5.0.0-20211101_Kernel.tar.gz

To complete the build environment, we must copy the appropriate config file for kernel compilation.

In the case of the TS-431P:

cp ~/cp GPL_QTS/kernel_cfg/TS-X31X/linux-4.2-arm.config ~/GPL_QTS/src/linux-4.2/.config

Alternatively, one could also extract this config from the running NAS by downloading and extracting the contents under /proc/config.gz (if available).

This file can then be copied to the respective linux src folder.

Example:

gunzip config.gz
cp config ~/GPL_QTS/src/linux-4.2/.config

Compile Linux Kernel

With our build environment set up, we must then compile the linux kernel.

We can do so with a simple command (ensuring we reference our extracted folder locations appropriately:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -C ~/GPL_QTS/src/linux-4.2/ scripts prepare modules_prepare

Compile Realtek Driver

Download precompiled drivers

Download optimized compiled driver:

Release Kernel Architecture Comments Link
2.19.2 4.2 ARMv7 32-bit Compiled for TS-x31x series Download

Other precompiled driver repositories:

Download from Realtek source

Download and extract the USB Linux drivers from Realtek's website: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software https://www.realtek.com/Download/List?cate_id=585

As of (updated) writing, the current version is 2.19.2

If compiling for the older 4.x Linux kernel, we must first modify the contents of the r8152.c source file and replace strscpy with strlcpy for driver versions 2.17.1 onwards. This is to allow compilation on older kernel instances as these versions do not support the strscpy function.

If we don't change this function, we will see an error like below:

make: Entering directory '/root/GPL_QTS/src/linux-4.2'

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /root/r8152-2.17.1/r8152.o
/root/r8152-2.17.1/r8152.c: In function ‘rtl8152_get_drvinfo’:
/root/r8152-2.17.1/r8152.c:18623:2: error: implicit declaration of function ‘strscpy’ [-Werror=implicit-function-declaration]
  strscpy(info->driver, MODULENAME, sizeof(info->driver));
  ^
cc1: some warnings being treated as errors
scripts/Makefile.build:270: recipe for target '/root/r8152-2.17.1/r8152.o' failed
make[1]: *** [/root/r8152-2.17.1/r8152.o] Error 1
Makefile:1503: recipe for target '_module_/root/r8152-2.17.1' failed
make: *** [_module_/root/r8152-2.17.1] Error 2
make: Leaving directory '/root/GPL_QTS/src/linux-4.2'

We can quickly replace the functions in the file using sed:

sed -i -e 's/strscpy/strlcpy/g' r8152.c

Download From GitHub

Alternatively, download forked source from GitHub which contains the necessary fixes and enhancements: https://github.com/RikshaDriver/realtek-r8152-linux

Compilation

Now we can finally compile the Realtek module:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -C ~/GPL_QTS/src/linux-4.2 M=`pwd` modules EXTRA_CFLAGS='-O2'

We should now have the succesfully compiled kernel module r8152.ko

Install Realtek Driver

In order to install the Realtek USB driver on our Linux system, we must overwite the existing r8152.ko module under /lib/modules/<kernel-version>/

For a quick an dirty test, upload the kernel module to a folder on the NAS, copy to the modules directory and run modprobe to remove and probe the kernel module. For example, the command for TS-431P (and related devices):

cp r8152.ko /lib/modules/4.2.8/
modprobe -r r8152
modprobe r8152

The Realtek driver should immediately show up as a network interface:

dmesg | grep 8152
[16401.642702] usbcore: deregistering interface driver r8152
[16404.197265] usbcore: registered new interface driver r8152
[16404.851196] r8152 2-4:1.0 eth2: v2.17.1 (2023/06/13)
[16404.856178] r8152 2-4:1.0 eth2: This product is covered by one or more of the following patents:

Tip

If experiencing adapter stability issues, it is possible the NAS may not be providing sufficient power to the adapter. Consider using an externally powered USB 3 Hub or a USB 3 Y cable which is connected to an external USB power source.

Install using autorun.sh

For a more permanent installation, the same commands can be run at startup using the autorun.sh capability of the NAS.

We must first tick the "Run user defined process during startup" option to allow autorun.sh loading during bootup.

The autorun.sh file must be stored on the flash storage.

QNAP provides a few methods of mounting the flash storage: https://www.qnap.com/en/how-to/faq/article/running-your-own-application-at-startup

In our case, we will do as follows:

/etc/init.d/init_disk.sh mount_flash_config

We can now manually create or upload our autorun.sh file to /tmp/nasconfig_tmp/autorun.sh

Example autorun.sh:

#!/bin/sh

echo "############ autorun.sh script start ############" >> /dev/kmsg

cp /share/CACHEDEV1_DATA/r8152.ko /lib/modules/4.2.8/
cp /share/CACHEDEV1_DATA/50-usb-realtek-net.rules /lib/udev/rules.d/50-usb-realtek-net.rules
modprobe -r r8152
modprobe r8152

sleep 5

udevadm control --reload-rules && udevadm trigger

sleep 10

echo "############  autorun.sh script end  ############" >> /dev/kmsg

Ensure autorun.sh is executable:

chmod +x /tmp/nasconfig_tmp/autorun.sh

Once completed, unmount the flash drive:

cd ~/
/etc/init.d/init_disk.sh umount_flash_config

Reboot and enjoy 2.5Gb/s or 5Gb/s speeds!

Install using QPKG

The Kernel module can also be packaged as a QPKG and run at startup as an application. This is similar to what is done with the Advanced Network Drivers application from QNAP.

Refer to the QDK guide for more details on creating a QPKG: https://cheng-yuan-hong.gitbook.io/qdk-quick-start-guide/

#!/bin/sh
echo "############ autorun.sh script start ############" >> /dev/kmsg
cp /share/CACHEDEV1_DATA/r8152.ko /lib/modules/4.2.8/
cp /share/CACHEDEV1_DATA/50-usb-realtek-net.rules /lib/udev/rules.d/50-usb-realtek-net.rules
modprobe -r r8152
modprobe r8152
sleep 5
udevadm control --reload-rules && udevadm trigger
sleep 10
echo "############ autorun.sh script end ############" >> /dev/kmsg
@kawan2
Copy link

kawan2 commented May 25, 2025

Some ideas -

  1. Could the 431P2 be short of memory? Are there many additional applications running in the 431P2? In r8152.c - if routine alloc_all_mem encounters some kind of memory error then goto err1 which issues free_all_mem around line 2586.

  2. You might issue dmesg then scroll down to the modprobe r8152, and start looking for interesting messages. Don't use grep. There could be interesting messages without 'r8152'. Maybe post the messages from the modprobe r8152 to the error messages, hopefully there are other messages with this chunk which shed more light on the situation.

Good luck!

@xoxide101
Copy link

xoxide101 commented May 25, 2025 via email

@thomaslehmann1234
Copy link

Some ideas -

  1. Could the 431P2 be short of memory? Are there many additional applications running in the 431P2? In r8152.c - if routine alloc_all_mem encounters some kind of memory error then goto err1 which issues free_all_mem around line 2586.
  2. You might issue dmesg then scroll down to the modprobe r8152, and start looking for interesting messages. Don't use grep. There could be interesting messages without 'r8152'. Maybe post the messages from the modprobe r8152 to the error messages, hopefully there are other messages with this chunk which shed more light on the situation.

Good luck!

Thank you @kawan2 for the ideas.

  1. Memory issue:
    My 431P2 got a memory upgrade from 1GB to 8GB some years ago and I am using docker containers on my NAS. But from my perspective not so much and we hit that issue direct after a reboot. Do we have any memory limit in that driver above 4GB RAM?

  2. interesting dmesg messages without 'r8152'.
    I am away from home and run more tests later after my return.

I think we are hitting some memory limits with the 8GB RAM installed in my 431P2. Do we have any compiler options to prevent that?

Thanks, Thomas

@ScottJD
Copy link

ScottJD commented May 25, 2025

Just a note that the TS431P and its other TS x31x based relatives are on kernel 4.2.8 which has limitations. Unless there is a kernel patch or upgrade, you will only ever see 2.5Gbps speeds. Not to mention that the USB interfaces on TS-x31x series are USB 3.0, so only rated for 5Gbps, whereas the 8157 adapters require USB 3.2 (10Gbps).

Thanks, I wasn’t aware of the kernel limitations. The adapters I purchased only will to 5Gbps because I knew the USB port is only a 3.2 Gen 1 and 5Gbps would be the limit on those ports. Both adapters I bought seem to work good and show up on my 10G switch as a 5 connected port, but tests are not showing its running that fast and the kernel limit is probably the reason.
FYI: The WaVLink 5Gbps USB C one stays cooler, but I also purchased the SABRENT USB-C to 5Gbps one that also worked.

@eldoctorcool
Copy link

eldoctorcool commented May 25, 2025 via email

@thomaslehmann1234
Copy link

@kawan2 please find the requested output of dmesg during driver installation for my TS431P2:

[182039.948426] usb 2-2: new SuperSpeed+ USB device number 3 using xhci_hcd
[182040.099179] usb 2-2: reset SuperSpeed+ USB device number 3 using xhci_hcd
[182040.320610] r8152 2-2:1.0 eth2: v2.19.2 (2024/10/21)
[182040.325665] r8152 2-2:1.0 eth2: This product is covered by one or more of the following patents:
[182040.325665] US6,570,884, US6,115,776, and US6,327,625.
[182040.325665]
[182040.528431] usb 2-2: reset SuperSpeed+ USB device number 3 using xhci_hcd
[182040.681259] r8152 2-2:1.0 eth2: v2.19.2 (2024/10/21)
[182040.686313] r8152 2-2:1.0 eth2: This product is covered by one or more of the following patents:
[182040.686313] US6,570,884, US6,115,776, and US6,327,625.
[182040.686313]
[182040.797509] [usb.002.003] /sys/devices/platform/soc/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/usb2/2-2 added.
[182041.472736] !@[/etc/init.d/net_event_setup.sh]rename_trct_nic() called
[182042.167240] interfaces: eth2 flags = 1043, old flags = 1002
[182042.172926] ------------[ cut here ]------------
[182042.177639] WARNING: CPU: 1 PID: 4428 at /root/realtek-r8152-linux/r8152.c:2586 free_all_mem+0xe0/0xf8 r8152
[182042.187902] Modules linked in: xt_ipvs ip_vs_rr ip_vs_ftp ip_vs xt_nat xt_addrtype r8152(O) rfcomm iscsi_tcp(O) libiscsi_tcp(O) libiscsi(O) scsi_transport_iscsi(O) fbdisk(O) xt_conntrack dummy br_netfilter bridge stp bonding xt_connmark xt_TCPMSS xt_LOG xt_set ip_set_hash_netiface ip_set_hash_net ip_set ipt_MASQUERADE xt_REDIRECT nf_nat_redirect iptable_nat nf_nat_masquerade_ipv4 nf_nat_ipv4 nf_nat xt_policy xt_mark qelf(PO) 8021q ipv6 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev snd_usb_caiaq snd_usb_audio snd_usbmidi_lib snd_hwdep snd_pcm_oss snd_mixer_oss snd_seq_dummy snd_pcm snd_seq_oss snd_seq_midi snd_seq_midi_event snd_seq snd_rawmidi snd_seq_device snd_timer snd fnotify(O) udf isofs exfat ufsd(PO) jnl(O) cdc_acm pl2303 usbserial qm2_i2c(O) flashcache(O) dm_tier_hro_algo dm_thin_pool dm_bio_prison dm_persistent_data hal_netlink(O) usbnet mii igb e1000e(O) mv14xx(PO) raid_class scsi_transport_fc usblp al_nand m25p80 [last unloaded: r8152]
[182042.275755] CPU: 1 PID: 4428 Comm: ifconfig Tainted: P O 4.2.8 #2
[182042.283064] Hardware name: Annapurna Labs Alpine
[182042.287779] [<800163d4>] (unwind_backtrace) from [<800131ac>] (show_stack+0x10/0x14)
[182042.295607] [<800131ac>] (show_stack) from [<8073bcc0>] (dump_stack+0x84/0x94)
[182042.302918] [<8073bcc0>] (dump_stack) from [<800246a0>] (warn_slowpath_common+0x80/0xb0)
[182042.311095] [<800246a0>] (warn_slowpath_common) from [<8002476c>] (warn_slowpath_null+0x1c/0x24)
[182042.319966] [<8002476c>] (warn_slowpath_null) from [<7f26542c>] (free_all_mem+0xe0/0xf8 [r8152])
[182042.328866] [<7f26542c>] (free_all_mem [r8152]) from [<7f26a278>] (rtl8152_open+0x310/0x41c [r8152])
[182042.338088] [<7f26a278>] (rtl8152_open [r8152]) from [<805ff2b0>] (__dev_open+0xa8/0x10c)
[182042.346342] [<805ff2b0>] (__dev_open) from [<805ff540>] (__dev_change_flags+0x94/0x158)
[182042.354430] [<805ff540>] (__dev_change_flags) from [<805ff61c>] (dev_change_flags+0x18/0x48)
[182042.362954] [<805ff61c>] (dev_change_flags) from [<8067b160>] (devinet_ioctl+0x750/0x780)
[182042.371215] [<8067b160>] (devinet_ioctl) from [<8067c80c>] (inet_ioctl+0x194/0x1c0)
[182042.378958] [<8067c80c>] (inet_ioctl) from [<805e258c>] (sock_ioctl+0x1d0/0x2a0)
[182042.386441] [<805e258c>] (sock_ioctl) from [<80118d44>] (do_vfs_ioctl+0x434/0x628)
[182042.394105] [<80118d44>] (do_vfs_ioctl) from [<80118fa4>] (SyS_ioctl+0x6c/0x7c)
[182042.401499] [<80118fa4>] (SyS_ioctl) from [<8000fbe0>] (ret_fast_syscall+0x0/0x3c)
[182042.409150] ---[ end trace 5b56eae7e4b7ead0 ]---
[182042.413849] ------------[ cut here ]------------

And I tried also default version v2.20.1 from https://github.com/kawan2/realtek-r8152-linux/releases

[ 361.752405] ############ autorun.sh script start ############
[ 361.980435] usbcore: deregistering interface driver r8152
[ 362.040145] usbcore: registered new interface driver r8152
[ 362.163214] usb 2-2: reset SuperSpeed+ USB device number 2 using xhci_hcd
[ 362.315370] r8152 2-2:1.0 eth2: v2.20.1 (2025/05/13)
[ 362.315370] USB dongle hardware version 0x000e
[ 362.315370] compiled with gcc 14.2.1 20241119
[ 362.329298] r8152 2-2:1.0 eth2: This product is covered by one or more of the following patents:
[ 362.329298] US6,570,884, US6,115,776, and US6,327,625.
[ 362.329298]
[ 362.365553] !@[/etc/init.d/net_event_setup.sh]rename_trct_nic() called
[ 362.955399] kjournald starting. Commit interval 5 seconds
[ 362.960916] EXT3-fs (loop0): mounted filesystem with writeback data mode
[ 363.086622] interfaces: eth2 flags = 1043, old flags = 1002
[ 363.092214] ------------[ cut here ]------------
[ 363.096908] WARNING: CPU: 3 PID: 20174 at r8152-2.20.1/r8152.c:2645 sg_en_show+0x1b0/0x2fc r8152
[ 363.106050] Modules linked in: r8152(O) rfcomm iscsi_tcp(O) libiscsi_tcp(O) libiscsi(O) scsi_transport_iscsi(O) fbdisk(O) xt_conntrack dummy br_netfilter bridge stp bonding xt_connmark xt_TCPMSS xt_LOG xt_set ip_set_hash_netiface ip_set_hash_net ip_set ipt_MASQUERADE xt_REDIRECT nf_nat_redirect iptable_nat nf_nat_masquerade_ipv4 nf_nat_ipv4 nf_nat xt_policy xt_mark qelf(PO) 8021q ipv6 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev snd_usb_caiaq snd_usb_audio snd_usbmidi_lib snd_hwdep snd_pcm_oss snd_seq_dummy snd_mixer_oss snd_pcm snd_seq_oss snd_seq_midi snd_seq_midi_event snd_seq snd_rawmidi snd_seq_device snd_timer snd fnotify(O) udf isofs exfat ufsd(PO) jnl(O) cdc_acm pl2303 usbserial qm2_i2c(O) flashcache(O) dm_tier_hro_algo dm_thin_pool dm_bio_prison dm_persistent_data hal_netlink(O) usbnet mii igb e1000e(O) mv14xx(PO) raid_class scsi_transport_fc usblp al_nand m25p80 [last unloaded: r8152]
[ 363.189555] CPU: 3 PID: 20174 Comm: ifconfig Tainted: P O 4.2.8 #2
[ 363.196876] Hardware name: Annapurna Labs Alpine
[ 363.201525] [<800163d4>] (unwind_backtrace) from [<800131ac>] (show_stack+0x10/0x14)
[ 363.209294] [<800131ac>] (show_stack) from [<8073bcc0>] (dump_stack+0x84/0x94)
[ 363.216560] [<8073bcc0>] (dump_stack) from [<800246a0>] (warn_slowpath_common+0x80/0xb0)
[ 363.224673] [<800246a0>] (warn_slowpath_common) from [<8002476c>] (warn_slowpath_null+0x1c/0x24)
[ 363.233488] [<8002476c>] (warn_slowpath_null) from [<7f265158>] (sg_en_show+0x1b0/0x2fc [r8152])
[ 363.242299] [<7f265158>] (sg_en_show [r8152]) from [<7f27015c>] (rtl8152_open+0x340/0x3f8 [r8152])
[ 363.251281] [<7f27015c>] (rtl8152_open [r8152]) from [<805ff2b0>] (__dev_open+0xa8/0x10c)
[ 363.259481] [<805ff2b0>] (__dev_open) from [<805ff540>] (__dev_change_flags+0x94/0x158)
[ 363.267499] [<805ff540>] (__dev_change_flags) from [<805ff61c>] (dev_change_flags+0x18/0x48)
[ 363.275969] [<805ff61c>] (dev_change_flags) from [<8067b160>] (devinet_ioctl+0x750/0x780)
[ 363.284161] [<8067b160>] (devinet_ioctl) from [<8067c80c>] (inet_ioctl+0x194/0x1c0)
[ 363.291820] [<8067c80c>] (inet_ioctl) from [<805e258c>] (sock_ioctl+0x1d0/0x2a0)
[ 363.299239] [<805e258c>] (sock_ioctl) from [<80118d44>] (do_vfs_ioctl+0x434/0x628)
[ 363.306827] [<80118d44>] (do_vfs_ioctl) from [<80118fa4>] (SyS_ioctl+0x6c/0x7c)
[ 363.314150] [<80118fa4>] (SyS_ioctl) from [<8000fbe0>] (ret_fast_syscall+0x0/0x3c)
[ 363.321711] ---[ end trace 07c8ba7ed4cbe713 ]---
[ 363.326349] ------------[ cut here ]----------

Any ideas? Thank you.

@kawan2
Copy link

kawan2 commented Jun 10, 2025

On my NAS, the messages look like below. After the "interfaces: ..." message then you get the "carrier on" message when the ethernet becomes active.

Have a look at the "cut here" part of your log. From the "interfaces: ..." message to the "r8152.c:2645" message.

See if there are any clues about what is causing the r8152 driver to error out. If there are no helpful messages in the log then we'll need a crystal ball :(

= = =
[ 297.663202] r8152 2-2.3:1.0 eth2: This product is covered by one or more of the following patents:
[ 297.663202] US6,570,884, US6,115,776, and US6,327,625.
[ 297.663202]
[ 297.733235] !@[/etc/init.d/net_event_setup.sh]rename_trct_nic() called
[ 299.215097] interfaces: eth2 flags = 1043, old flags = 1002
[ 301.543235] r8152 2-2.3:1.0 eth2: carrier on

@thomaslehmann1234
Copy link

Thank you @kawan2 for looking into that issue. Do we have an memory issue here? As mentioned I upgraded my NAS from 1GB to 8GB RAM. How much RAM do you have? Thanks.

@kawan2
Copy link

kawan2 commented Jun 10, 2025

I have a ts-431p with 1 GB that cannot be upgraded. On the face of it ... at startup + 8 GB RAM, it should not be short of memory. If it is easy to do, you can try downgrading 8 GB -> 1 GB and see if any difference. This is all poking around in the dark :)

@xoxide101
Copy link

xoxide101 commented Jun 10, 2025 via email

@RikshaDriver
Copy link
Author

RikshaDriver commented Jun 10, 2025 via email

@xoxide101
Copy link

xoxide101 commented Jun 10, 2025 via email

@klemen866
Copy link

Hi, can anyone compile driver version 2.20.1 (May 2025)? Thanks in advance.
Another question, what is the status of potential support for WOL feature? There was an attempt to include support for WOL a few months ago, but the drivers did not work correctly and there was no follow-up afterwards (at least that is my understanding).

@kawan2
Copy link

kawan2 commented Jun 19, 2025

You can try the v2.2 here https://github.com/kawan2/realtek-r8152-linux/releases/tag/2024-11
The ts-431p gives error messages (usb_autopm absent in the linux kernel) when loading the driver with WOL enabled.

@NotSure9000
Copy link

Can someone please explain all different versions (for ARMv7)? Ox - is I'm guessing compiler optimizations, are those significant?
But -d ?? -Os? Thank you!
My 431P is still working near perfectly with uGreen 2.5G adapter wired via UNpowered usb 3 hub (weird but I just don't touch it).
My performance is 1.7gbps avg via that interface, no device dropouts (24/7 cycle).

@kawan2
Copy link

kawan2 commented Jun 19, 2025

You can experiment to see which code size works best for you. The -d files are the original output from the compiler and contain debugging symbols. The smaller files are with the debugging symbols stripped out.
O2 - default for kernel compiles
Os - same as O2 excluding techniques that increase code size
O3 - more optimizations than O2

The Debug versions produce info and statistics for the dongle. Issue "ifconfig" to see the correct ethN number for you eg.
$ cat /sys/class/net/eth3/nic_swsd/ocp
eth3
v2.20.1 (2025/05/13)
RTL_VER_13
tgphy_ramcode_v21_usb_20220324
...

@NotSure9000
Copy link

Thank you! Will experiment

@NotSure9000
Copy link

So far 2.20.1 is super slow for me compared to 2.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment