You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
&& echo 'if [ -d /mnt/USBvalve-sdk ]; then cd /mnt/USBvalve-sdk; elif [ -f /mnt/src/main.c ]; then cd /mnt; else echo "Error: mount the repo root or USBvalve-sdk dir to /mnt"; exit 1; fi' >> /app/entrypoint.sh \
Copy file name to clipboardExpand all lines: README.md
+63-25Lines changed: 63 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
<h1><imgwidth="300"alt="logo, landscape, dark text, transparent background"src="https://github.com/cecio/USBvalve/blob/main/pictures/USBvalve_logo_scaled.png"></a></h1>
2
2
3
+
> [!NOTE]
4
+
> **USBvalve Version 1.0.0**
5
+
> A complete rewrite of the application has been done:
6
+
> - moved away from Arduino IDE environment, now the code is written for the [Pi Pico SDK](https://github.com/raspberrypi/pico-sdk)
7
+
> - dependencies on external libraries has been reduced a lot
8
+
> - USB host support for Low Speed devices is now more robust (ATTiny85, EvilCrow, etc)
9
+
> - hardware and functionalities are almost unchanged, see the [notes](https://github.com/cecio/USBvalve#notes-about-bootsel-and-version--100) below for details
10
+
3
11
### *Expose USB activity on the fly*
4
12
5
13
<pfloat="left">
@@ -42,11 +50,11 @@ This is also fully compatible with the [Waveshare RP2040-LCD-1.28](https://www.w
42
50
43
51
`docs`: documentation about the project, with a presentation where you can have a look to all the features
44
52
45
-
`firmware`: pre-built firmware for the Raspberry Pi Pico. You can just use these and flash them on the board. I prepared the two versions for 32 and 64 OLED versions
53
+
`firmware`: pre-built firmwares for the Raspberry Pi Pico. You can just use these and flash them on the board. We have several different versions, for 32 or 64 lines OLEDs, for Pico 1 or Pico2, Pi Pico Watch, etc
46
54
47
55
`PCB`: Gerber file if you want to print the custom PCB . It's not mandatory, you can use your own or build it on a breadboard
48
56
49
-
`USBvalve`: sources, if you want to modify and build the firmware by yourself
57
+
`src` and `data`: sources, if you want to modify and build the firmware yourself
50
58
51
59
`utils`: some utilities you may use to build a custom FS
52
60
@@ -60,11 +68,25 @@ This is also fully compatible with the [Waveshare RP2040-LCD-1.28](https://www.w
60
68
61
69
If you want to build your own, you need:
62
70
63
-
- A Raspberry Pi Pico 1 or 2 (or another RP2040 based board, like Arduino Nano RP2040)
64
-
- an I2C OLED screen 128x64 or 128x32 (SSD1306)
71
+
- A Raspberry Pi Pico 1 or 2 (or another RP2040 based board)
72
+
- an I2C OLED screen 128x64 or 128x32 (**SSD1306**)
65
73
- (optional) a **USBvalve** PCB or a breadboard
66
74
- (optional) a 3D printed spacer to isolate the screen from the board (https://www.thingiverse.com/thing:4748043), but you can use a piece of electrical tape instead
67
75
76
+
### Notes about BOOTSEL and version >= 1.0.0
77
+
78
+
In the `0.x.x` versions, BOOTSEL was used to reset the device or print the number of HID events (press > 2s).
79
+
The polling of BOOTSEL was creating some issues to the *BADUSB* detection so this was removed from version `1.0.0` and replaced with the following two options:
80
+
- solder a button between `GP0` and `GND` (pads 1 and 3, see pic below to see an example) to have the same functions
81
+
- use the commands `r` (reset) and `h` (HID events) from the serial monitor
~~In `PCB` you'll find also a version `1.3` of the board, with some holes on pads 1 and 3 to facilitate the mount of the button. But as you can see, you can also use your old version~~. (still waiting the new printed PCB to test it before publishing)
86
+
87
+
If you are not using the *BADUSB* functions or if you prefer to have less coverage on detection but keep BOOTSEL usage, I'm also providing a firmware created with *bootsel* enabled (see folder and releases).
88
+
89
+
68
90
### Building instructions
69
91
70
92
> Thanks to [Tz1rf](https://github.com/Tz1rf) we also have two great videos: one explaining the [building](https://youtu.be/7ymk8hD7-Hc) process step-by-step, and another showing how to [upload firmware](https://youtu.be/Tp8xvrlqxUY) and use the tool.
@@ -165,10 +187,10 @@ It's done!
165
187
166
188
I don't know if it will ever be the case, but you may want to customize the firmware in order to avoid detection done by *USBvalve-aware* malware :-)
167
189
168
-
I grouped most of the variables you may want to modify in this section ([see Dockerfile below for rebuilding](https://github.com/cecio/USBvalve#dockerfile))
190
+
I grouped most of the variables you may want to modify in this section of `usb_config.h`([see Dockerfile below for rebuilding](https://github.com/cecio/USBvalve#dockerfile))
169
191
170
192
```C
171
-
//Anti-Detection settings.
193
+
//USB anti-detection settings
172
194
//
173
195
// Set USB IDs strings and numbers, to avoid possible detections.
174
196
// Remember that you can cusotmize FAKE_DISK_BLOCK_NUM as well
@@ -179,39 +201,55 @@ I grouped most of the variables you may want to modify in this section ([see Doc
#defineUSB_VENDORID 0x0951 // This override the Pi Pico default 0x2E8A
183
-
#define USB_PRODUCTID 0x16D5 // This override the Pi Pico default 0x000A
184
-
#define USB_DESCRIPTOR "DataTraveler" // This override the Pi Pico default "Pico"
185
-
#define USB_MANUF "Kingston" // This override the Pi Pico default "Raspberry Pi"
186
-
#define USB_SERIAL "123456789A" // This override the Pi Pico default. Disabled by default. \
187
-
// See "setSerialDescriptor" in setup() if needed
188
-
#define USB_VENDORID_STR "Kingston" // Up to 8 chars
189
-
#define USB_PRODUCTID_STR "DataTraveler" // Up to 16 chars
190
-
#define USB_VERSION_STR "1.0" // Up to 4 chars
204
+
#defineUSB_VENDORID 0x0951
205
+
#defineUSB_PRODUCTID 0x16D5
206
+
#defineUSB_DESCRIPTOR "DataTraveler"
207
+
#defineUSB_MANUF "Kingston"
208
+
#defineUSB_SERIAL "123456789A"
209
+
#defineUSB_VENDORID_STR "Kingston" // Up to 8 chars
210
+
#define USB_PRODUCTID_STR "DataTraveler" // Up to 16 chars
211
+
#define USB_VERSION_STR "1.0" // Up to 4 chars
191
212
```
192
213
193
214
194
215
### Building your firmware
195
216
196
-
Obviously you can also build your own firmware. To build the *standard* one I used:
197
-
198
-
- Arduino IDE `2.3.4`
199
-
- `Adafruit TinyUSB Library` version `3.6.0`, `Pico-PIO-USB` version `0.7.2`, Board `Raspberry Pi RP2040 (4.5.4)` setting Tools=>CPU Speed at `133MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
200
-
- `Adafruit_SSD1306` OLED library version `2.5.14`
217
+
Obviously you can also build your own firmware. To build you need the *Raspberry Pi Pico SDK* and this repoository.
201
218
202
-
Remember to add `https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json` in the `Additional Board Manager URLs` to install the proper board. Also, starting from `TinyUSB` version `3.4.2` is necessary to force the following macro setting `DCFG_TUD_CDC=1`. I strongly suggest you to use the provided *Dockerfiles* (see below).
219
+
Basic recompile instructions:
220
+
```
221
+
export PICO_SDK_PATH=</path/to/pico-sdk>
222
+
mkdir build && cd build
223
+
cmake -DPICO_BOARD=pico .. # or pico2 for standard build
224
+
make -j$(nproc)
225
+
# Output: build/src/USBvalve.uf2
226
+
```
203
227
204
228
If you want to re-create a new fake filesystem, you may want to have a look to the `utils` folder, where I placed some utilities to build a new one.
205
229
206
230
#### Dockerfile
207
231
208
-
If you want to build your own firmware, after you customized it, I provide a `Dockerfile` which builds a complete **Arduino** environment and compile the firmware. I added them for both `Pico` version 1 and 2.
232
+
If you want to build your own firmware, after you customized it, I provide a `Dockerfile` which builds a complete building environment and compile the firmware.
209
233
210
-
Enter the following commands in the main `USBvalve` folder to build for Pico `v1`:
234
+
Enter the following commands in the main `USBvalve` folder to build:
0 commit comments