.. highlight:: cpp .. _usb: USB === The STM32 microprocessors include 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 :ref:`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 :ref:`SerialUSB ` reference. The SerialUSB channel is used with the :ref:`Maple bootloader ` to reprogram the board: a :ref:`magic sequence of control line toggles and transmitted data ` causes a 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 :ref:`SerialUSB.end() `). A solution to the second problem is the use of :ref:`perpetual bootloader mode `. Recommended Reading ------------------- * `USB in a Nutshell `_, an overview from Beyond Logic * `USB made simple `_, an illustrated series of articles on USB * The `USB 2.0 Specification `_ (`direct link `_) * `Embedded USB - a brief tutorial `_ * `Wikipedia article on Universal Serial Bus (USB) `_ * Linux Kernel documentation for `USB ACM `_ and `USB Serial `_ * `USB Glossary of Terms `_ * ST documentation: * Reference Manual `RM0008 `_ (PDF), Chapter 23, "Universal serial bus full-speed device interface" * Programming Manual `PM0056 `_ (PDF; assembly language and register reference)