{"id":20254597,"url":"https://github.com/hnz1102/sdcdmux-emmc","last_synced_at":"2025-03-03T17:17:43.344Z","repository":{"id":180648246,"uuid":"664194177","full_name":"hnz1102/sdcdmux-emmc","owner":"hnz1102","description":"SD CARD and eMMC Device Multiplexer with Infrared Remote Controller ","archived":false,"fork":false,"pushed_at":"2024-05-09T07:34:34.000Z","size":4750,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T03:31:41.949Z","etag":null,"topics":["beaglebone","boot","card","emmc","ftdi-232h","infrared-control","multiplexer","mux","raspberry-pi","sd","sdcard","usb","usb-devices"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hnz1102.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-09T07:40:53.000Z","updated_at":"2024-12-28T12:52:55.000Z","dependencies_parsed_at":"2024-05-09T08:25:39.320Z","dependency_job_id":"ee21b497-59c8-4eeb-88de-9fc3fca3f624","html_url":"https://github.com/hnz1102/sdcdmux-emmc","commit_stats":null,"previous_names":["hnz1102/sdcdmux-emmc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnz1102%2Fsdcdmux-emmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnz1102%2Fsdcdmux-emmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnz1102%2Fsdcdmux-emmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnz1102%2Fsdcdmux-emmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hnz1102","download_url":"https://codeload.github.com/hnz1102/sdcdmux-emmc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241705908,"owners_count":20006398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beaglebone","boot","card","emmc","ftdi-232h","infrared-control","multiplexer","mux","raspberry-pi","sd","sdcard","usb","usb-devices"],"created_at":"2024-11-14T10:33:52.510Z","updated_at":"2025-03-03T17:17:43.318Z","avatar_url":"https://github.com/hnz1102.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003eSDCDMUX\u003c/code\u003e\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cimg src=\"doc/front.jpg\"/\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# SDCDMUX : SD Card and eMMC Device Multiplexsor with Infrared Remote Control\n\nThe SDCDMUX provides a convenient and quick change of a SW image of a device that has an SD Card interface from a remote. \n\nWhen 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.\n\nUsually, 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.\n\nThis tool frees me from the tedious SW image rewriting and resetting process.\n\n\nhttps://github.com/hnz1102/sdcdmux-emmc/assets/111413646/edf4297e-6da3-4eba-aacd-01ee126e1040\n\n\n### [2023.8.15] USB Type-C version Added.\n![USB Type-C](doc/typec.jpg)\nThe Schematic is hardware/emmc-type-c-version/ directory.\n\n## Features\n\n- **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. \n\n- **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.\n\n- **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.\n\n## Tested Devices\n\nI have checked the following devices that can boot from this tool.\n\n- [Raspberry Pi 4 Model B](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/)\n- [BeagleBone Black](https://beagleboard.org/black)\n- [BeagleBone Blue](https://beagleboard.org/blue)\n\nOnly 3 devices because I have my own now.\n\n## Infrared Remote Power Switch\n\nThe Infrared Remote Contorol Power Swtich I used is [OCR-05W OHM ELECTRIC INC.](https://www.ohm-electric.co.jp/product/c23/c2313/19582/). But I think other switch devices that can control by the infrared LED may be able to work too. \n\n## How to build the control SW.\n\nThis software (sdcdmux) is for Linux. \n\nThe following example is for Ubuntu Linux Ubuntu 22.04.2 LTS.\n\n1. Install build tools\n```\n$ sudo apt -y install build-essential libftdi-dev\n```\n\n2. Build the software.\n```\n$ cd sdcdmux\n$ make\n$ sudo cp sdcdmux /usr/local/bin/ \n```\n3. Add a udev rule.\n/etc/udev/rules.d/99-ft232h.rules\n```\n$ sudo su\n# echo 'SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6014\",  MODE=\n\"0666\"' \u003e /etc/udev/rules.d/99-ft232h.rules\n# udevadm control --reload-rules\n# udevadm trigger\n```\n\n## How to use SDCDMUX.\n\n1. Connect 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. \n![cable connect](doc/connect-board.jpg)\n![fig1](doc/fig1.png)\n\n2. Use SDCDMUX\n\n- Display current status.\n```\n$ sdcdmux\nMemory Device is connected to : HOST.\n```\n\n- Capture infrared ON command.\n```\n$ sdcdmux -c on\nCapture Start.. \n\"Push ON button on your Infrared Remote Controller\"\nRecieve IFR data (18245B)\nCaptured command for on\n```\n![capture command](doc/caputring-cmd.jpg)\n\nAfter capture the command, you can see the 'if-on' file in the current directory.\n\n- Capture infrared OFF command.\n```\n$ sdcdmux -c off\nCapture Start.. \n\"Push OFF button on your Infrared Remote Controller\"\nRecieve IFR data (11449B)\nCaptured command for off\n```\n\n- Select eMMC memory to host PC side.\n```\n$ sdcdmux -s host\nMemory Device is connected to : HOST.\n```\nYou can see eMMC disk drive on your PC.\n```\n$ lsblk\n:\nsdb           8:16   1  29.1G  0 disk \n:\n```\nIn my case, I can see the new disk drive as 'sdb'.\n\n- Download the Raspberry Pi boot image and Write it to eMMC.\n\n** !WARNING! ** DO NOT OVERWRITE YOUR SYSTEM DISK DRIVE! BE CAREFUL THE WRITING DISK DRIVE NAME.\n\n```\n$ wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf.img.xz\n$ xzcat 2023-05-03-raspios-bullseye-armhf.img.xz | sudo dd of=/dev/sdb bs=1M status=progress\n4125163520 bytes (4.1 GB, 3.8 GiB) copied, 94 s, 43.9 MB/s\n0+491118 records in\n0+491118 records out\n4143972352 bytes (4.1 GB, 3.9 GiB) copied, 126.121 s, 32.9 MB/s\n$ lsblk\nsdb           8:16   1  29.1G  0 disk \n├─sdb1        8:17   1   256M  0 part \n└─sdb2        8:18   1   3.6G  0 part \n```\n\n- Select eMMC memory to target (Raspberry Pi) device.\n```\n$ sdcdmux -s target\nMemory Device is connected to : TARGET.\n```\nYou can see the blue LED is turn on.\n\n- Turn on the device using infrared on command.\n```\n$ sdcdmux -x on\n```\n\n- Turn off the device using infrared on command.\n```\n$ sdcdmux -x off\n```\n\n- Another devices control.\n\nI also use the SDCDMUX as a controller to turn ceiling lights on and off.\n```\n$ sdcdmux -c lightson\nCapture Start.. \n\"Press ON on the remote controller of the ceiling light to make it learn the command.\"\nRecieve IFR data (8498B)\nCaptured command for lightson\n\n$ sdcdmux -c lightsoff\nCapture Start.. \n\"Press OFF on the remote controller of the ceiling light to make it learn the command.\"\nRecieve IFR data (10701B)\nCaptured command for lightsoff\n\n$ sdcdmux -x lightson\n\"Seiling lights turn on.\"\n\n$ sdcdmux -x lightsoff\n\"Seiling lights turn off.\"\n```\n\n## Performance\n\nI created an SD card type and an eMMC type. I compared their writing times.\n\n4.2GB Image Writing Time (Average of 3 times)\n|SD card (*1)|eMMC (*2)|\n|----|----|\n|482.3 sec (8.7MB/s)|134.7 sec (31.3MB/s)|\n\n*1 San Disk Ultla 32GB HC1 SD CARD\n\n*2 Delkin Devices EM32VSUKN 32GB eMMC\n\n## SDCDMUX Board\n\nSDCDMUX 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.\nSchematic data is created by KidCad 7.0.\n\n![Block Diagram](doc/fig2.png)\n\n\n![PCB Layout](doc/pcb-layout.png)\n\nIf 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.\n\n![PCB](doc/PCB.jpg)\n\nAfter building the board, It has to configure EEPROMs of the USB Media Controller and USB FIFO Interface.\n\nThe USB Media Controller has an EEPROM. It is programmed with the parameters by [USBDM tool](https://www.microchip.com/en-us/software-library/usbdm-tool).\n\n- Manufacture String\n- Serial Number String\n\nSingle Channel HiSpeed USB to Multipurpose UART/FIFO IC (FT232H) has an EEPROM too. It is programmed the parameters by [FT_Prog](https://ftdichip.com/wp-content/uploads/2023/06/FT_Prog_v3.12.32.640-Installer.zip).\n\n- FT EEPROM - HARDWARE Specific IO Controls - C5, C6, C8 and C9 ports are I/O Mode set.\n\n# CASE\n\nI created the case for SDCDMUX type-C version by 3D printer. There are STL data in the hardware/emmc-type-c-version/case directory.\n\n![case](doc/case.jpg)\n\n\n## LICENSE\nThis Software is licensed under MIT. Other Hardware Schematic documents are licensed under CC-BY-SA V4.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhnz1102%2Fsdcdmux-emmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhnz1102%2Fsdcdmux-emmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhnz1102%2Fsdcdmux-emmc/lists"}