Skip to content

Firmware Build Options

robertfisk edited this page May 24, 2018 · 6 revisions

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:

Upstream/Inc/build_config.h

Downstream/Inc/build_config.h

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

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.

#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.

You can’t perform that action at this time.