Create Custom USB Devices with the esp32s2Stick

Electronics tutorial writer and video creator Luca Dentella created a microcontroller board that might, at first, look like every other ESP32-based board. However, the esp32s2Stick's USB port has a creative secret! Using the ESP32-S2's OTG capability, this stick enumerates itself as various USB devices! The well-known ESP32 continues to surprise us. The S2 and, presumably, the S3 modules contain support for USB On-The-Go (OTG). With the TinyUSB library, Arduino code can use the USB OTG feature to a wide variety of USB devices. The TinyUSB library is an open-source, cross-platform USB stack that supports both the host and device roles. In addition to the ESP32-S2, the library supports a wide variety of popular microcontrollers. Dentella's YouTube tutorial walks you through setting up the Arduino IDE with an ESP32-S2 based-board and the TinyUSB library. You can see how to create a USB-serial, USB mass storage, and USB HID device using it. The esp32s2Stick builds on that tutorial, creating a slick compact package. On the PCB, there is a microSD socket, RGB LED, voltage regulator, and ESP32-S2 ROVER module. The board design is open source. You can either get the EAGLE design files from the esp32s2Stick Github repository or order a board directly from PCBWay . The Github repo also contains example code to operate the on-board LED and microSD. As noted in the blog post, this implementation does not use the pseudo-standard pins for SD card access that Arduino-supported boards typically use. So if you are using Dentella's board, check the SD card code example to make sure the correct pins are selected. Since esp32s2Stick's USB port plugs into a USB host to act as another USB-device, there is a 4-pin serial interface for debugging. However, programming the device with new firmware can still be done over USB by placing the stick into DFU mode. For a detailed tutorial on USB OTG support on the ESP32-S2, check out the video above from Dentella's YouTube Channel. This esp32s2Stick blog post has more information about the board.

Read more here: https://www.hackster.io/news/create-custom-usb-devices-with-the-esp32s2stick-458bf370a522

Content Attribution

This content was originally published by James Lewis at Hackster News - Hackster.io, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: