USB — Maple v0.0.9 Documentation

### Navigation

- next
- previous |
- LeafLabs |
- Docs Home |
- Index »

# USB

The Maple STM32 microprocessor includes a dedicated USB peripheral which can be configured to act as a general USB slave device with transfer rates up to 12Mbps (it unfortunately can’t be configured as a host or on-the-go device). By default, the peripheral is configured for two uses: first, to receive sketch/program uploads from the IDE, and second, to emulate a regular serial port for use as a terminal (text read/write).

The emulated terminal is relatively slow and inefficient; it is best for transferring data at regular serial speeds (kilobaud). Library support for accessing the emulated terminal is available at the SerialUSB reference.

The SerialUSB channel is used as part of the auto-reset feature of the IDE to program the board on Maple Rev 3 and Rev 5: a magic sequence of control line toggles and transmitted data causes the Maple to reset itself and enter bootloader mode. As an unfortunate consequence, the auto-reset will not work if the IDE can not access the serial port, either due to a conflict with another program (serial monitor) or because the interface has been disabled from the Maple side (through SerialUSB.end()). A solution to the second problem is the use of perpetual bootloader mode.

## Recommended Reading

- USB in a NutShell overview from Beyond Logic

- Wikipedia article on Universal Serial Bus (USB)

- Linux Kernel documentation for USB ACM and USB Serial

- STMicro documentation for STM32F103RB microcontroller:

  > - Datasheet (pdf)
  > - Reference Manual (pdf)
  > - Programming Manual (pdf; assembly language and register reference)

### Navigation

- next
- previous |
- LeafLabs |
- Docs Home |
- Index »