
Sdcdmuxemmc
hnz1102/sdcdmux-emmc
SD CARD and eMMC Device Multiplexer with Infrared Remote Controller

SD CARD and eMMC Device Multiplexer with Infrared Remote Controller
Sdmux4 is an open-source printed circuit board by hnz1102, from the hnz1102/sdcdmux-emmc repository on GitHub, published under the MIT licence. It is a 2-layer board of 68.3 × 57.7 mm with 115 parts on 117 nets, routed with 1,088 tracks and 192 vias.
It is built around the USB2640-HZH-02, 74AHC1G14GV and AT24MAC402-STUM-T, with the FT232HL, SPX3819M5-L and 0.1UF 50V 5*11 among its other parts. Its parts include 46 capacitors, 34 resistors, 9 ICs, 8 diodes and 8 transistors.
SDCDMUX
The SDCDMUX provides a convenient and quick change of a SW image of a device that has an SD Card interface from a remote.
When I am developing by booting from an SD memory card on a device such as the Raspberry Pi, it is not easy to rewrite the SD card image and replace it by hand. Remove the SD card, insert it into the host PC, and take a dozen minutes rewriting the SW image, after that, return the SD card to the device and turn on the power... But, This tool can change the image of the eMMC directly from the host PC, and the device can be booted as an SD card with the new image.
Usually, To boot with the new SW image, the device must be reset, but this tool can learn the ON/OFF command of the infrared power controller and outputs that command to turn the device on and off.
This tool frees me from the tedious SW image rewriting and resetting process.
https://github.com/hnz1102/sdcdmux-emmc/assets/111413646/edf4297e-6da3-4eba-aacd-01ee126e1040
The Schematic is hardware/emmc-type-c-version/ directory.
Fast. SDCDMUX can write an image to the eMMC device (32GB) instead of SD Memory Card via High-Speed USB. It is 4 times faster than an SD card.
Remote Control. SDCDMUX has an infrared interface that can receive an infrared remote control command and send it to power control devices. If you want to turn on a device, you can type the command "on" on the PC console.
Use Fast Switch. When I used the prototype, Sometimes Rasbery Pi4 could not boot by read error. I tried to change faster switching devices in this tool. Then, Raspberry Pi always can boot correctly.
I have checked the following devices that can boot from this tool.
Only 3 devices because I have my own now.
The Infrared Remote Contorol Power Swtich I used is OCR-05W OHM ELECTRIC INC.. But I think other switch devices that can control by the infrared LED may be able to work too.
This software (sdcdmux) is for Linux.
The following example is for Ubuntu Linux Ubuntu 22.04.2 LTS.
$ sudo apt -y install build-essential libftdi-dev$ cd sdcdmux
$ make
$ sudo cp sdcdmux /usr/local/bin/ $ sudo su
# echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE=
"0666"' > /etc/udev/rules.d/99-ft232h.rules
# udevadm control --reload-rules
# udevadm triggerConnect to SDCDMUX via the USB cable with your PC. Power USB cable connect to the target device and USB adoptor. Please refer to the figure.

Use SDCDMUX
$ sdcdmux
Memory Device is connected to : HOST.$ sdcdmux -c on
Capture Start..
"Push ON button on your Infrared Remote Controller"
Recieve IFR data (18245B)
Captured command for on
After capture the command, you can see the 'if-on' file in the current directory.
$ sdcdmux -c off
Capture Start..
"Push OFF button on your Infrared Remote Controller"
Recieve IFR data (11449B)
Captured command for off$ sdcdmux -s host
Memory Device is connected to : HOST.You can see eMMC disk drive on your PC.
$ lsblk
:
sdb 8:16 1 29.1G 0 disk
:In my case, I can see the new disk drive as 'sdb'.
** !WARNING! ** DO NOT OVERWRITE YOUR SYSTEM DISK DRIVE! BE CAREFUL THE WRITING DISK DRIVE NAME.
$ wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf.img.xz
$ xzcat 2023-05-03-raspios-bullseye-armhf.img.xz | sudo dd of=/dev/sdb bs=1M status=progress
4125163520 bytes (4.1 GB, 3.8 GiB) copied, 94 s, 43.9 MB/s
0+491118 records in
0+491118 records out
4143972352 bytes (4.1 GB, 3.9 GiB) copied, 126.121 s, 32.9 MB/s
$ lsblk
sdb 8:16 1 29.1G 0 disk
├─sdb1 8:17 1 256M 0 part
└─sdb2 8:18 1 3.6G 0 part $ sdcdmux -s target
Memory Device is connected to : TARGET.You can see the blue LED is turn on.
$ sdcdmux -x on$ sdcdmux -x offI also use the SDCDMUX as a controller to turn ceiling lights on and off.
$ sdcdmux -c lightson
Capture Start..
"Press ON on the remote controller of the ceiling light to make it learn the command."
Recieve IFR data (8498B)
Captured command for lightson
$ sdcdmux -c lightsoff
Capture Start..
"Press OFF on the remote controller of the ceiling light to make it learn the command."
Recieve IFR data (10701B)
Captured command for lightsoff
$ sdcdmux -x lightson
"Seiling lights turn on."
$ sdcdmux -x lightsoff
"Seiling lights turn off."I created an SD card type and an eMMC type. I compared their writing times.
4.2GB Image Writing Time (Average of 3 times)
| SD card (*1) | eMMC (*2) |
|---|---|
| 482.3 sec (8.7MB/s) | 134.7 sec (31.3MB/s) |
*1 San Disk Ultla 32GB HC1 SD CARD
*2 Delkin Devices EM32VSUKN 32GB eMMC
SDCDMUX Board Schematic and a PCB layout are placed in the hardware directory. There are 2 types emmc-version and sdcard-version. This emmc-version uses an eMMC device instead of a SD memory card. Schematic data is created by KidCad 7.0.


If you order a PCB board from a PCB maker, it must be 0.8mm thick. Otherwise, it will not fit in the SD card slot.

After building the board, It has to configure EEPROMs of the USB Media Controller and USB FIFO Interface.
The USB Media Controller has an EEPROM. It is programmed with the parameters by USBDM tool.
Single Channel HiSpeed USB to Multipurpose UART/FIFO IC (FT232H) has an EEPROM too. It is programmed the parameters by FT_Prog.
I created the case for SDCDMUX type-C version by 3D printer. There are STL data in the hardware/emmc-type-c-version/case directory.

This Software is licensed under MIT. Other Hardware Schematic documents are licensed under CC-BY-SA V4.0.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 25 | 0.1uF/50v | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C101, C102, C105, C301, C303, C305, C405, C406, C407, C408, C501, C502, C503, C506, C507, C508 +9 |
| 16 | 10K | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R101, R102, R201, R204, R304, R403, R404, R502, R503, R507, R601, R602, R603, R605, R607, R608 |
| 5 | 1K | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R202, R301, R604, R606, R609 |
| 5 | 1uF/10v | tbctl:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C103, C401, C402, C409, C410 |
| 4 | 10uF/16v | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C201, C302, C304, C609 |
| 4 | 2N7002K | Package_TO_SOT_SMD:SOT-23 | Q201, Q602, Q603, Q606 |
| 4 | IRF7606PBF | Package_SO:MSOP-8_3x3mm_P0.65mm | Q601, Q604, Q605, Q607 |
| 4 | LED RED | tbctl:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder | D201, D301, D302, D401 |
| 3 | 12K 1% | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R303, R402, R501 |
| 3 | 4.7uF/50v | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C512, C513, C514 |
| 3 | 4.7uF/50v | tbctl:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C104, C411, C412 |
| 2 | 2.2uF/16v | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C605, C608 |
| 2 | 220 | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R508, R509 |
| 2 | 27R | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R504, R505 |
| 2 | 27pF/50v | Capacitor_SMD:C_0603_1608Metric | C403, C404 |
| 2 | 27pF/50v | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C504, C505 |
| 2 | BK2125HS601-T | Inductor_SMD:L_0805_2012Metric_Pad1.15x1.40mm_HandSolder | FB501, FB502 |
| 2 | TMUX1574PWR | Package_SO:TSSOP-16_4.4x5mm_P0.65mm | U602, U603 |
| 1 | 12MHz | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | Y501 |
| 1 | 1M | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R401 |
| 1 | 20K 1% | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R302 |
| 1 | 24MHz | tbctl:Crystal_SMD_2016-4Pin_2.0x1.6mm | Y401 |
| 1 | 2K | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R506 |
| 1 | 330 | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R305 |
| 1 | 330R | tbctl:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R405 |
| 1 | 33R | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R203 |
| 1 | 74AHC1G14 | Package_TO_SOT_SMD:SOT-23-5_HandSoldering | U601 |
| 1 | 93LCxxBxxOT | Package_TO_SOT_SMD:SOT-23-6 | U501 |
| 1 | AT24MAC402-STUM | Package_TO_SOT_SMD:SOT-23-5_HandSoldering | U401 |
| 1 | BK2125HS601-T | tbctl:L_0603_1608Metric_Pad1.05x0.95mm_HandSolder | FB301 |
| 1 | BLM18RK102SN1 | tbctl:L_0603_1608Metric_Pad1.05x0.95mm_HandSolder | FB401 |
| 1 | FT232HL | Package_QFP:LQFP-48_7x7mm_P0.5mm | U502 |
| 1 | IND-1 LED GRN | tbctl:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder | D501 |
| 1 | IND-2 LED GRN | tbctl:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder | D502 |
| 1 | Micro_SD_Card_Det_Hirose_DM3AT-SF-PEJM5 | Connector_Card:microSD_HC_Hirose_DM3AT-SF-PEJM5 | J103 |
| 1 | OSI5LA5113A | LED_THT:LED_D5.0mm | D202 |
| 1 | RESET SW | tbctl:WS-TASV SMT Tact Switch | SW301 |
| 1 | SPS-445 | tbctl:SPS445 3pin | U201 |
| 1 | SPX3819M5-L | Package_TO_SOT_SMD:SOT-23-5 | U301 |
| 1 | TGT SEL LED RED | tbctl:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder | D601 |
| 1 | USB2640-HZH-02 | tbctl:QFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm | U402 |
| 1 | USB_B_Mini | tbctl:usb mini B connector c2235 dim 2 | J101 |
| 1 | uSD-CARD-PAD | tbctl:uSD Card Pad | J102 |

hnz1102/sdcdmux-emmc
SD CARD and eMMC Device Multiplexer with Infrared Remote Controller

hnz1102/sdcdmux-emmc
SD CARD and eMMC Device Multiplexer with Infrared Remote Controller


hnz1102/temp-logger
Logging Thermocouple Temperature and Send Data to InfluxDB system.

hnz1102/shared-usb-memory
USB Memory with One-touch Switching Between Two Device Connections

3mdeb/sd-mux
Control application for SD Wire imported from: https://git.tizen.org/cgit/tools/testlab/sd-mux/

bitsy-ai/printnanny-sdwire
A modified version of Tizen SDWire https://wiki.tizen.org/SDWire

hnz1102/current-logger
This tool provides a logging function that gets data on voltage, current and power consumption. Voltage input range is from 0 to 85V, Maximum current input is 15A.

yosihisa/LoadCell-Logger
4ch load cell logger board using Raspberry Pi Pico and HX711. (Wakame Edition)

It measures 68.3 × 57.7 mm and has 2 copper layers, 1.6 mm thick.
115 parts, built around the USB2640-HZH-02, 74AHC1G14GV, AT24MAC402-STUM-T and FT232HL. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the hnz1102/sdcdmux-emmc repository on GitHub, at the commit this page was made from: the board is hardware/sdcard-version/sdmux4.kicad_pcb and its schematic hardware/emmc-type-c-version/power.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).