Skip to content
mofmanPublic

About

Turn off the driver-free virtual CD of a Realtek RTL8821CU / RTL8811CU USB Wi-Fi dongle, permanently.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtl-nocd

Turn off the driver-free virtual CD of a Realtek RTL8821CU / RTL8811CU USB Wi-Fi dongle, permanently.

Python Hosts Chip Status License Buy Me A Coffee

Warning

fix and undo can brick your dongle, permanently. They burn the chip's eFuse, which can never be erased. If anything goes wrong while bytes 0x000–0x00F are being written, the dongle may stop showing up on USB at all, and then it can never be read, repaired or written again. Examples: a bad value, a write that only partly takes, the dongle being unplugged, or a USB error.

This code has NOT been fully tested.

  • Reading (list, check, dump) has been checked against one real dongle.
  • Writing has been done once on real hardware, on the W69. That burn went through Realtek's driver in its factory test mode, from a Linux VM, and wrote the same 8 bytes at the same offset that this tool plans. The driver ran the same register sequence that rtl_nocd/efuse.py copies from it. This tool's own Python version of that sequence, sent straight over USB, has only been tested against a simulated chip. It has not yet burned a real dongle.
  • Only one dongle model (the W69 below) has been examined at all.

Use it only on a dongle you can afford to lose. Run check and fix --dry-run first, and read what they say. There is no warranty, and you use it entirely at your own risk (see the licence).

Many cheap dongles first appear as a CD drive (0bda:1a2b, "Realtek DISK") that holds Windows drivers. They become Wi-Fi (0bda:c820 and similar) only after the CD is ejected. On Linux, embedded systems and car head units that means usb_modeswitch or an eject at every plug-in.

On at least one such dongle, the dongle maker turned the CD on after factory programming by adding three bits to the chip's eFuse. This tool looks for that exact pattern. If it finds it, it sets those bytes back to the values the dongle's own eFuse shows they held before. The dongle then starts straight as Wi-Fi.

  • Pure Python. Works on macOS, Linux and Windows. No driver, no Docker, no VM.
  • check and dump only read.
  • fix and undo write the eFuse, which is permanent. They refuse to run unless every guard passes (below).

Status

Pattern Found on one dongle: W69 / board YH-3, RTL8821CU, sold as JAPOO on Amazon UK. Fixed there through Realtek's driver; it now enumerates as 802.11ac NIC.
This tool's reads Checked against that dongle: the physical map matches the driver's dump byte for byte.
This tool's writes Experimental. The register sequence is ported from Realtek's halmac driver and tested against a simulated chip. The planned bytes equal what the driver burned. A real write through this tool has not been done yet.
Other dongles Unknown; see Verified dongles. Please send a report, whether it matches or not.

Verified dongles

Only dongles whose eFuse has actually been read are listed. "Result" is what happened after a power cycle.

Brand / seller Model Board marking Chip USB ID: CD → Wi-Fi Verdict before Fixed with Result Date
JAPOO (no-name W69) W69 600 Mbps dual-band (Amazon UK, B0F7RVSXRW) YH-3 RTL8821CU (chip ID 0x09), 25Q64 SPI flash 0bda:1a2b → 0bda:c820 MATCH Realtek driver, MP mode Starts as 802.11ac NIC, no CD 2026-11-22

To add a dongle, open an issue with:

  • rtl-nocd dump -o report.json;
  • the brand, model and seller;
  • a photo of the board marking, if you can see it;
  • the result after fix: unplug, plug in again, then run rtl-nocd list.

Dongles with NO-PATCH or UNKNOWN are wanted too. They are listed once they're understood.

Install

pip install git+https://github.com/mofman/rtl-nocd      # or: pip install .   from a clone

This pulls in pyusb and libusb-package, which bundles libusb. Nothing else is needed on macOS or Linux.

  • Linux: run with sudo, or add a udev rule for 0bda. A kernel Wi-Fi driver (rtw88_8821cu, 8821cu) may be bound; reading is fine, and fix detaches it first.
  • Windows: Windows has no generic USB access. Use Zadig to install the WinUSB driver for the dongle in Wi-Fi mode (0bda:c820). Afterwards, put the Realtek driver back from Device Manager.

Run from source

git clone https://github.com/mofman/rtl-nocd
cd rtl-nocd
python3 -m venv .venv
.venv/bin/pip install -e .          # Windows: .venv\Scripts\pip install -e .
.venv/bin/rtl-nocd list             # Windows: .venv\Scripts\rtl-nocd list

Or activate the venv once (source .venv/bin/activate; on Windows, .venv\Scripts\activate) and type rtl-nocd on its own. Because -e installs in editable mode, your changes to the source take effect without reinstalling.

To run it without installing, install the two dependencies and run the package as a module from the repository folder:

pip install pyusb libusb-package
python3 -m rtl_nocd check

Tests (no dongle needed; they use a real eFuse map and a simulated chip):

.venv/bin/pip install -e '.[test]'
.venv/bin/python -m pytest -q

On Linux, sudo rtl-nocd will not find the venv's copy, so use sudo .venv/bin/rtl-nocd ….

Use

rtl-nocd list                 # dongles found, their mode, chip and CD flag
rtl-nocd check                # read only: is the known pattern there?
rtl-nocd fix --dry-run        # show exactly which bytes would be burned
rtl-nocd fix                  # burn (asks you to type BURN-xxxx, the last 4 digits of the MAC)
rtl-nocd undo                 # bring the CD back (burns the patch again)
rtl-nocd dump -o report.json  # full report, MAC redacted

check and dump work in either mode. fix and undo need the dongle in Wi-Fi mode, so eject the CD first:

  • macOS: eject "REALTEK" in Finder.
  • Windows: eject the drive in Explorer.
  • Linux: eject /dev/srN or usb_modeswitch.

Every command except list also takes --file report.json (or a driver efuse_get realraw dump) to work offline.

Reading the report

check lists every logical byte that a later eFuse entry changed after it was first written. The first value is normally the factory programming. Later values come from whoever wrote the chip afterwards, usually the dongle maker. For each change it shows the entry number (#), the physical offset (@), and the bits added (+) or removed (-). On the W69 after the fix:

Changed after first programming (later eFuse entries override earlier ones):
  0x006  first 21 (#6 @0x02C)  ->  31 (#24 @0x0A7) [+10]  ->  21 (#26 @0x0AF) [-10]   <- CD signature byte
  0x008  first 6E (#7 @0x02F)  ->  6F (#25 @0x0AA) [+01]  ->  6E (#27 @0x0B2) [-01]   <- CD signature byte
  0x00C  first 10 (#7 @0x033)  ->  12 (#25 @0x0AC) [+02]  ->  10 (#27 @0x0B4) [-02]   <- CD signature byte

Here entries #24/#25 are the dongle maker's late patch (CD on), and #26/#27 are the fix (CD off). Add -v to list every entry, with the late ones marked *.

dump puts the same information in the JSON as changed_after_first_programming and late_entries. That makes it easy to compare dongles: a different maker might patch other bytes, and those bytes would show up here. MAC bytes are shown as xx, or zeroed in the JSON, unless you pass --keep-mac.

Verdicts:

Verdict Meaning
MATCH The late patch is there; fix can reverse it
ALREADY-FIXED The patch is in the history and already reversed; undo can bring the CD back
NO-PATCH The CD bits were never set; this dongle starts some other way (or has no CD)
UNKNOWN Anything else. Nothing will be burned. Please send rtl-nocd dump -o report.json

How it works

The chip's ROM reads the eFuse at power-on. Bytes 0x000–0x00F of the logical map are chip settings.

On the W69 dongle, the factory programming wrote 0x006=21, 0x008=6E and 0x00C=10. Two later entries changed them to 31, 6F and 12, adding one bit to each. With those bits set, the ROM runs a USB CD emulator from the dongle's SPI flash and shows 0bda:1a2b. With the factory values, it skips the flash and starts as Wi-Fi.

Which of the three bits is the switch is not known; all three are set back together. Realtek's documents for this are partner-only, so the meaning is inferred from the result.

The physical eFuse is append-only, and later entries override earlier ones. The fix therefore adds two small entries (8 bytes) at the end, the same ones Realtek's factory tool would write:

07 21 00          block 0, word 3      -> 0x006 = 21
1A 6E 04 10 00    block 1, words 0, 2  -> 0x008 = 6E, 0x00C = 10

The eFuse is read and written through the chip's eFuse controller registers, using the same USB vendor request (0x05) as Realtek's drivers:

  • Read: write the address to 0x0030 and poll bit 31.
  • Write: write the unlock code 0x69 to 0x00CF, enable the 2.5 V LDO (0x0037 bit 7), write the address and data to 0x0030 with bit 31 set, and poll until bit 31 clears.

See rtl_nocd/efuse.py; it follows halmac_efuse_88xx.c.

Guards

fix and undo burn nothing unless all of these hold:

  1. The chip ID (register 0x00FC) is RTL8821C.
  2. Two full eFuse reads agree, and the map decodes cleanly to its end marker.
  3. The verdict is MATCH for fix, or ALREADY-FIXED for undo.
    • The values written back are ones that this dongle's own eFuse history already holds.
    • No other byte of 0x000–0x00F was changed late.
  4. The new entries touch only the two signature words. The space after the last entry is blank, and at least 16 bytes stay free.
  5. Simulating the burn gives exactly the intended logical map, with no other byte changed.
  6. A backup of the full eFuse, MAC included, is saved to rtl-nocd-backups/.
  7. The eFuse controller is idle and the programming LDO responds.
  8. You type BURN- plus the last 4 hex digits of the dongle's MAC.

Then each byte is written and read back. The tool stops at the first mismatch and ignores Ctrl-C during the write. Finally the whole map is re-read and compared.

Risks

  • eFuse bits cannot be erased. undo works by adding newer entries, while space lasts (about 230 bytes on the W69).
  • Bytes 0x000–0x00F are loaded by hardware at power-on. A wrong value there could stop the dongle enumerating, after which it can never be read or written again. This is why the tool writes only values the dongle has already run with.
  • The direct-USB write path is new. The path that has actually been used went through Realtek's driver in its factory test mode on Linux.
  • These dongles cost about £8. Don't try this on something you can't afford to lose.

Reports wanted

See Verified dongles for what to send. Reports from dongles that do not show a CD are just as useful: comparing them would show which of the three bits is the real switch.

Disclaimer

This project is not affiliated with or endorsed by Realtek Semiconductor Corp. or any dongle maker or seller. Product names are used only to identify hardware. Burning an eFuse is permanent: the software is provided without any warranty, and you use it entirely at your own risk.

License

GPL-2.0. The eFuse read and write sequence in rtl_nocd/efuse.py follows Realtek's halmac driver (halmac_efuse_88xx.c), which Realtek ships under GPL-2.0 in its Linux drivers.

About

Turn off the driver-free virtual CD of a Realtek RTL8821CU / RTL8811CU USB Wi-Fi dongle, permanently.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages