2 Firmware Build Options
Jeff Moe edited this page 3 years ago

Fork Sand fork

Fork Sand fork cloned from:

Upstream Wiki

The USG firmware supports mass storage devices, keyboards and mice, as well as different options for each device type. You can customize your firmware build using the options below. Because the v1.0 hardware has no user-controllable switches, this configuration must be done at compile-time. This means you will need to have a firmware development environment set up.

The build configuration is stored in these files:

Remember to set the same options in both Upstream and Downstream. See this comment for the reasons why.

Device Support Options

Comment out any devices you don't want to support.

#define CONFIG_MASS_STORAGE_ENABLED
#define CONFIG_KEYBOARD_ENABLED
#define CONFIG_MOUSE_ENABLED

Read-Only Mode

Comment out this option if you want to disable writes to mass storage devices.

#define CONFIG_MASS_STORAGE_WRITES_PERMITTED

Read/Write indication on LEDs

Comment out this option if you don't want the fault LEDs to rapid-blink during reads and writes to mass storage. Or change the length of time they blink after a read or write event. The default is 3 seconds (3000 ms).

Downstream blinks for reads, and Upstream blinks for writes.

#define CONFIG_READ_FLASH_TIME_MS                           3000

#define CONFIG_WRITE_FLASH_TIME_MS                          3000

HID Bot Detection

This option is a defense against type 3 bad USB attacks. It measures the randomness of inputs arriving from keyboards and mice to determine whether the user is a genuine human or a bot.

Bot detection is performed in the Upstream processor, so make these changes in Upstream's build_config.h.

#define CONFIG_KEYBOARD_BOT_DETECT_ENABLED
#define CONFIG_MOUSE_BOT_DETECT_ENABLED

The bot detection algorithms can be tuned by adjusting KEYBOARD_BOTDETECT_ and MOUSE_BOTDETECT_ parameters if required.