whiskers 0.4.0
RP2350 BadUSB Tool
Loading...
Searching...
No Matches
Advanced Usage

SD Passthrough & Pubdisk

The device can also function as a storage device alongside a keyboard. Both the underlying SD card can be passed through (effectively acting as SD to USB adapter) alongside a fake "pubdisk" drive which is just a file formatted as a usable filesystem.

SD Passthrough Instructions

Using SD passthrough is very simple. Before initializing USB enable SD passthrough (wlua_usb_enable_sd_passthrough(true)). Note that the parameter describes whether the disk is read-only or not, by setting it to true it becomes writable, or un-writable if set to false. This does not affect the ability to create or modify files or directories from the device itself (ie. opening files in lua).

Pubdisk Instructions

Using the pubdisk is slightly more complicated. First, the user must format the drive themselves using tools of their choosing. For example, if I wanted to set my disk to be FAT32 I can use mkfs.fat on linux, or something like drive manager for windows. The file can support all flavors of formatting as it's simply just a continous block of data on the SD card. Once the drive has been formatted the resulting "pubdisk.vdisk" file in the root directory on the SD card can be shared across devices to skip step one and or copy the exact contents of the pubdisk from device to device. Note: like SD passthrough, pubdisk must be enabled before starting USB!
Example instructions:

  • First, enable the pubdisk and set it to your desired size (must be greater than 8kb): wlua_usb_start_pubdisk(512, 524288, true). This creates a writable 256MB disk.
  • Second, plug the device into your host system. You should then see the drive as an unformatted disk. Format to your liking (typically, the most compatible is some flavor of FAT).
  • Third, now you can copy and paste the "pubdisk.vdisk" file to other devices to save time or copy contents. Note, if the device detects this file it will not try to create a new one, however you must keep the same size (in this instance, 256MB) in your initialization code for each device.