Skip to content

The Stick Multi Drive makes it possible to host multiple bootable USB images in one device.

Notifications You must be signed in to change notification settings

daniel-starke/stimud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STIMUD

The Stick Multi Drive makes it possible to host multiple bootable USB images in one device.

Features

  • small and cheap design
  • up to 16 different USB images in one device
  • flexible storage capacity options by using standard microSD cards as backbone
  • moderate speed: 6.36 MByte/s write, 17.2 MByte/s read (tested with SanDisk Ultra 16GB)
  • fast USB startup time of ~3 seconds
  • as little as 0.7W energy consumption
  • status and activity LED
  • supported backbone file systems: FAT32, exFAT, NTFS, ext3 and ext4

Hardware Assembly

STIMUD was made in three revisions. A, B and C. Each required a different level of soldering skills.
Simple through-hole soldering skill is needed for revision A and C whereas C can be seen as improved version of A.
Advanced SMD and through-hole soldering skills are needed to assemble revision B. Especially when using a USB-C connector.

Required Tools

  • soldering iron and lead
  • 3D printer
  • rasp
  • glue
  • microSD card reader/writer

Revision A and C

Needed parts:

The rotary switch and flat pin headers are soldered to the STIMUD PCB. See KiCAD project for rev. A or rev. C.
Gerber files for manufacturing at JLCPCB are provided here for rev. A and here for rev. C.
Be sure to select 1.6mm PCB thickness or adjust the case dimensions.
Also solder the flat pin sockets to the LicheePi Zero.
The housing can be 3D printed via a FDM 3D printer. The needed STL files are found here for both revisions.
Adjust the tolerance parameters in the FreeCAD project to match the used 3D printer performance.
This step requires re-creation of the STL files for 3D printing. It is recommended to use the Mesh Design workspace in FreeCAD to adjust the quality settings before STL export.
Be sure to print CaseB.stl and ConA.stl with support material. Some parts may need to be rasped for a proper fit afterwards.

Assembly example:


Add some glue between ConA part and USB cable for pull relief.
It may needs a little hole for the LED light in CaseB if the used case material transparency is insufficient.
Revision C fixes the issue in revision A, that the LED shared the same pins as the rotary switch and also adds a serial console pin header.

It is highly recommended to use rev. C instead of rev. A.

Note that the serial console function for rev. C is not yet implemented.

Revision B

Needed parts:

The rotary switch, pin headers, microSD card socket, USB connector, SMD resistors and capacitors are soldered to the STIMUD PCB. The 5.1kOhm resistors are only needed for the variant with the USB-C receptacle. See KiCAD project for rev. B.
Gerber files for manufacturing at JLCPCB are provided here.
Be sure to select 1.2mm PCB thickness or adjust the case dimensions.
The LicheePi Zero is soldered directly to the pin headers previously soldered to the STIMUD PCB. Be sure to finish soldering the capacitors before attaching the LicheePi Zero.
The housing can be 3D printed via a FDM 3D printer. The needed STL files are found here for the USB-A variant.
Adjust the tolerance parameters in the FreeCAD project to match the used 3D printer performance.
This step requires re-creation of the STL files for 3D printing. It is recommended to use the Mesh Design workspace in FreeCAD to adjust the quality settings before STL export.
Everything can be printed without support material.

Assembly example:

Attach the self adhesive foam pad on the microSD card socket to avoid unaligned insertions of microSD cards.

Note that there exists no housing for the USB-C receptacle variant yet.

Important: Never operate the STIMUD REV B with two microSD cards at the same time! This will damage the cards and the LicheePi Zero board.

Software Setup

Build Pre-requirements

The initial boot image can be build in Linux using the provided build.sh script.
For the pre-requirements see https://buildroot.org/downloads/manual/manual.html#requirement

Build Boot Image

Execute build.sh. The resulting image can be found in build/output/images/. Additional flags can be passed to build.sh to control the build output.
Use dd on Linux or Rufus on Windows to flash the microSD card.
The partition for the sub images will be created automatically by STIMUD according to stimud.cfg after first start, which may take a bit longer.
A pre-compiled image is also provided.

Configuration

Set the rotary switch to position F and adjust stimud.cfg.
You can change the properties of the rotary switch coding, preferred backbone filesystem and image configurations here.
Note that the backbone filesystem option is only used for initial format. Any of the supported filesystems can be used.
Images can be copied as image files or created for example with the following Linux command:

for i in 0 1 2 3 4 5 6 7 8 9 A B C D E; do dd if=/dev/zero of=$i.img bs=1048576 count=1008; mkfs -t vfat -n $i $i.img; done

This creates the images 0.img, 1.img, 2.img, 3.img, 4.img, 5.img, 6.img, 7.img, 8.img, 9.img, A.img, B.img, C.img, D.img and E.img in the current directory with a size of 1018MB each formatted with FAT32.
Note that the configuration file stimud.cfg can be located in three locations:

  1. secondary partition on the microSD card (which also includes the images)
  2. primary partition on the microSD card
  3. Linux kernel initfs

The priority is handled in the order given above. A missing file is replaced by the next location in the list.

Usage

After successful configuration, set the rotary switch to the desired position before plugging it to the host.
The current image can be changed at any time and will be effective on next connection to the host.
Each image file represents a full USB storage drive image.
Usually one position remains reserved to access the STIMUD configuration. This is position F by default.

Access to the internal command-line console is provided in STIMUD rev. B and C via a 3.3V TTL UART connection with 115200 Baud, 8 data bits, no parity and 1 stop bit. The STIMUD related files are stored there in /root. Such an FT232R adapter module can be used for example, to connect a PC to it.

Important: Never operate the STIMUD REV B with two microSD cards at the same time! This will damage the cards and the LicheePi Zero board.

LED States

LED State Meaning
ES green blinking starting
E0 blue blinking disk activity after successful startup
E2 red blinking script error (check stimud.sh)
E1 red/blue alternating configuration error (check stimud.cfg)
Ex red always on unknown error

Note that the LEDs in revision A are also connected to the rotary switch. Set it to position 0 or F depending on whether the switch uses real or complementary code to see all LEDs. Other positions may disable all or some LEDs. Revision C fixes this issue by using different pins for the rotary switch.

Files

Name Meaning
build.sh Shell script to build the STIMUD SD card images.
board/boot.cmd U-Boot boot script.
board/genimage.cfg Linux kernel specific image generation configuration.
board/stimud.dts U-Boot specific device tree reference.
configs/buildroot.config Buildroot specific build configuration.
configs/busybox-fragments.config Busybox specific build configuration fragments.
configs/linux.config Linux kernel specific build configuration.
configs/uboot.config U-Boot specific build configuration.
src/start.sh Script loaded at STIMUD start-up.
src/stimud.cfg STIMUD configuration template.
src/stimud.sh Script with the actual STIMUD function.
src/stimud-gpio.c Application to control the Allwinner V3s GPIOs.

License

See copying file.

Contributions

No content contributions are accepted. Please file a bug report or feature request instead.
This decision was made in consideration of the used license.

About

The Stick Multi Drive makes it possible to host multiple bootable USB images in one device.

Resources

Stars

Watchers

Forks

Packages

No packages published