SDWire usage
Environment preparation
SDWire has dedicated software which is a simple tool meant to control the hardware. Source code of the tool is published on our github. This is simple to use, command-line utility software written in C and based on open-source libFTDI library.
To prepare the environment reproduce the following steps:
-
Clone the repository:
git clone https://github.com/3mdeb/sd-mux
-
Install all needed dependencies:
Ubuntu/Debian:
sudo apt-get install libftdi1-dev libpopt-dev cmake
Fedora/Red Hat:
sudo dnf install libftdi-devel popt-devel cmake gcc gcc-c++
-
Enter into sd-mux project directory and reproduce the following steps to build project:
- open directory in terminal
-
create 'build' directory by the following command:
mkdir build
-
enter into 'build' directory by the following command:
cd build
-
run the following commands one by one:
cmake .. make
-
In the above-described directory (
sd-mux/build
) run the following command to build binary:sudo make install
Note, that the above-described command installs binary into '/usr/local/bin'. If you want to install files in directory rather than the default one add an argument to cmake command:
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
Then it is obligatory to run again the following commands:
make make install
First use
The following procedure should be performed not only before the first use of the device, but also as the presale validation procedure!
Hardware requirements:
- SDWire
- SD card
- DUT (Device Under Test) bootable from SD card (for example: RPI, Orange PI etc.)
- DUT power supply
- Micro-USB --> USB cable
- TS (Test Server) - in most cases personal computer with prepared environment.
To perform first use (assuming Raspberry Pi platform as a DUT) procedure reproduce the following steps:
- Prepare environment in accordance with this section.
- Insert SD card to the SDWire.
- Put SDWire into the DUT (Device Under Test).
- Prepare a micro USB --> USB cable. It will be used to connect SDWire to TS (Test Server).
-
Check whether SDWire is configured by reproducing the following steps:
-
run in TS terminal the following command:
dmesg -w
-
connect the SDWire to your machine using micro-USB --> USB cable.
-
after connecting your
dmesg
output should looks like this:(...) [73278.307591] usb-storage 3-1.1:1.0: USB Mass Storage device detected [73278.307823] scsi host6: usb-storage 3-1.1:1.0 [73278.384925] usb 3-1.2: new full-speed USB device number 45 using xhci_hcd [73278.492025] usb 3-1.2: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00 [73278.492027] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [73278.492028] usb 3-1.2: Product: FT200X USB I2C [73278.492029] usb 3-1.2: Manufacturer: FTDI [73278.492030] usb 3-1.2: SerialNumber: DB007V7V (...)
-
open new terminal window and run the following command:
sudo sd-mux-ctrl --list
If output looks like below, it means that SDWire is configured and ready to use. Now, you can go to point 6 in this section.
Number of FTDI devices found: 1 Dev: 0, Manufacturer: SRPOL, Serial: sd-wire_11, Description: sd-wire
Otherwise, if output shows no devices (like in the example below):
Number of FTDI devices found: 0
you have to configure SDWire:
sudo sd-mux-ctrl --device-serial=DB007V7V --vendor=0x0403 --product=0x6015 --device-type=sd-wire --set-serial=sd-wire_11
where:
--device-serial=<SerialNumber> (from dmesg output) --vendor=0x<idVendor> (from dmesg output) --product=0x<idProduct> (from dmesg output) --set-serial=<New serial device>
After above-desribed procedure check again if SDWire is properly configured:
sudo sd-mux-ctrl --list
Should output:
Number of FTDI devices found: 1 Dev: 0, Manufacturer: SRPOL, Serial: sd-wire_11, Description: sd-wire
-
-
Connect SD card to the TS (Test Server):
sudo sd-mux-ctrl --device-serial=sd-wire_11 --ts
-
Flash the SD card using
bmaptool
or balenaEtcher.- download the OS image for the target DUT - link for RPi image
- to do this by
balenaEtcher
go to the producer site and follow his procedure how to download and flash SD card -
to do this by
bmaptool
reproduce the following steps:-
install bmaptool by opening terminal and typing the following command:
sudo apt install bmap-tools
-
create the bmap by typing the following command:
bmaptool create /path/to/your/image > /path/where/you/want/bmap/file/saved/bmapfilename.bmap
-
flash image to the SD card by typing the following command:
sudo bmaptool copy --bmap ~/path/where/your/bmap/file/is/located /path/where/your/image/is/located /path/to/memory/device
-
-
Connect SD card to the DUT using
sd-mux-ctrl
:sudo sd-mux-ctrl --device-serial=sd-wire_11 --dut
-
Connect power supply to the DUT and check if it boots properly from newly burned image.
Everyday use scenario
- Disconnect power supply from the DUT (Device Under Test).
- Disconnect micro SD card from the DUT.
- Connect micro SD card to the TS (Test Server) using card reader.
- Flash the SD card.
- Connect SD card to the DUT.
- Connect power supply to the DUT.
- Boot DUT from new image.
Using SDWire there is no need to disconnect SD card from DUT.
SDWire with RTE use scenario
- Insert SD card to the SDWire.
- Insert SDWire into the DUT and connect it to the TS with micro-USB --> USB cable.
- Connect RTE power control connectors to the DUT (RTE here is optional but highly recommended for remote work, because it helps with automated and remote power control of the connected device).
-
Check serial no. of SDWire:
sudo sd-mux-ctrl --list
Output:
Number of FTDI devices found: 1 Dev: 0, Manufacturer: SRPOL, Serial: sd-wire_11, Description: sd-wire
-
Disconnect power supply using RTE.
-
Connect SD card to the TS (using sd-mux-ctrl)
sudo sd-mux-ctrl --device-serial=sd-wire_11 --ts
-
Flash the SD card using
bmaptool
orbalenaEtcher
as described in the First use section -
Connect SD card to the DUT (using sd-mux-ctrl)
sudo sd-mux-ctrl --device-serial=sd-wire_11 --dut
-
Connect power supply using RTE.
-
DUT should boot from freshly burned SD card.
Command
sudo sd-mux-ctrl --device-serial=sd-wire_11 --status
returns information if SDWire is connected to DUT or TS.➜ ~ sudo sd-mux-ctrl --device-serial=sd-wire_11 --status SD connected to: TS
At the moment RTE does not support sd-mux-ctrl, so SDWire must be controlled from configured TS (Test Server).
References & Projects: