5 ms·
TinyUSB: Open-source cross-platform USB Host/Device stack for embedded systems
- ComputerGuru 4y agoThis seems like a really great project; it's well-designed and supports quite a variety of different MCUs (although host mode seems to be "not implemented" in anything except the rPi). I wonder how much work it would be to create a no_std sys crate to use this from a rust context. (I see some interest from Tock users in the GitHub issue discussions.) The github repo for the TinyUSB project: https://github.com/hathach/tinyusb https://github.com/hathach/tinyusb EDIT: I spoke too soon, there's already a tinyusb-sys crate here [0]! [0]: https://lib.rs/crates/tinyusb-sys https://lib.rs/crates/tinyusb-sys
- khimaros 4y agorelated: https://github.com/abcminiuser/lufa https://github.com/abcminiuser/lufa
- jrmg 4y agoAlso: https://www.obdev.at/products/vusb/index.html https://www.obdev.at/products/vusb/index.html which works on AVR devices without hardware USB support.
- arcticbull 4y agoAlso related is V-USB from obev for AVR devices which don't have built-in USB transceivers. Impressively, they bit bang low speed USB (1.1) using two regular GPIO pins. [1] [1] https://www.obdev.at/products/vusb/index.html https://www.obdev.at/products/vusb/index.html
- girvo 4y ago> Impressively, they bit bang low speed USB (1.1) You're not kidding, that is very impressive. I always find it fascinating what some people manage to achieve with bit-banging. This is one I remember being quite impressed with back in the day: https://hackaday.com/2011/05/10/bit-banging-vga-from-an-sd-card-slot/ https://hackaday.com/2011/05/10/bit-banging-vga-from-an-sd-c...
- linker3000 4y agoThere's also the library for the 'Digispark' project (ATTINY85-based). This seems derived from AVR USB code and can be used via the Arduino IDE: http://digistump.com/products/1 http://digistump.com/products/1 https://github.com/digistump/DigisparkArduinoIntegration/tree/master/libraries/DigisparkKeyboard https://github.com/digistump/DigisparkArduinoIntegration/tre... https://github.com/linker3000/Digiprank https://github.com/linker3000/Digiprank
- redprince 4y agoIt will not work when plugged into an USB3 port. It is marginal for USB ports following older standards and may occasionally not work. Putting an old USB hub between the computer and the AVR device can help with the connection. It's a neat hack though: https://www.obdev.at/articles/implementing-usb-1.1-in-firmware.html https://www.obdev.at/articles/implementing-usb-1.1-in-firmwa... The utility of it diminished with the availability of AVR devices with integrated USB peripherals. There's LUFA to help with their use: http://www.fourwalledcubicle.com/LUFA.php http://www.fourwalledcubicle.com/LUFA.php
- kevin_thibedeau 4y agoOne of the more annoying aspects of vendor supplied USB stacks is they are frequently only designed to work in a mainloop and have a monolithic interrupt handler that runs too much code to work well in an RTOS.
- skybrian 4y agoI'm using arduino-pico [1], which has support for the Adafruit fork [2] of this project. I haven't used anything other than the serial port and MIDI out, but it's nice so far. [1] https://github.com/earlephilhower/arduino-pico https://github.com/earlephilhower/arduino-pico [2] https://github.com/adafruit/Adafruit_TinyUSB_Arduino https://github.com/adafruit/Adafruit_TinyUSB_Arduino
- peterburkimsher 4y agoIntro for those who aren't familiar: TinyUSB allows a programmable chip (e.g. ESP32, SAM, STM32) to read USB flash drives, or behave as a keyboard and mouse. A similar library for Arduino is V-USB. https://hackaday.com/tag/tinyusb/ https://hackaday.com/tag/tinyusb/ Question for the experts: is it possible to do USB pass-through monitoring? Specifically, I have an Apple Magic Keyboard connected to the Dell work PC. I'd like to capture the F7-F12 keys, and use them to control the music on my iPod. Currently I use an AutoHotKey script to send serial commands from the PC, but having 2 FTDI cables plugged in sometimes causes issues. Yes, I'm effectively suggesting a keylogger, but without trying to record the keystrokes, just use them to trigger another UART. It could also be really nice to remap the Command key to Ctrl (again, I work around this with AutoHotKey, but it's imperfect).
- zamadatix 4y agoI swear there was a HN post about someone who made a KVM alternative on this principal (pass KB/M through a microcontroller or something and have it act as downstream KB/M to multiple devices) but for the life of me I can't find it. That or I dreamed the whole thing up.
- masaha 4y agoAre you thinking of the display-switch[0] script? Achieves K/V/M-switching with only a cheap USB-switch for hardware K/M-switching, and then this script detects such peripheral switching and emits DDC-commands for monitors to switch accordingly. I saw it posted here on HN[1], and have been using it since then with great success. [0] https://github.com/haimgel/display-switch https://github.com/haimgel/display-switch [1] https://news.ycombinator.com/item?id=29608967 https://news.ycombinator.com/item?id=29608967
- vbezhenar 4y agohttps://pikvm.org https://pikvm.org may be? Not exactly microcontroller though.
- nbernard 4y ago> is it possible to do USB pass-through monitoring? I fear it would need something a little bit more complex than just an Arduino on the hardware side. For some options, you could take a look at some recent versions of Facedancer [0] and their HW requirements. [0]: https://github.com/greatscottgadgets/Facedancer https://github.com/greatscottgadgets/Facedancer
- nickcw 4y agoI've used TinyUSB to turn a Raspberry Pi 2040 (the very cheap microcontroller) into a USB keyboard that you plug your morse key into and send morse which the RPI 2040 converts into key presses and sends to the computer. TinyUSB was very easy to use. It was my first foray into USB devices and adapting the example code was straight forward. I wrote the code in C but I could have done it in python also but I didn't as you need ms accuracy for decoding morse code and I wasn't sure it would be fast enough. There are examples for pretty much any usb peripheral you can think of here: https://github.com/hathach/tinyusb/tree/master/examples/device https://github.com/hathach/tinyusb/tree/master/examples/devi...
- deleted 4y ago[deleted]
- vbezhenar 4y ago85 kLoC of C and 95 kLoC of headers. Is it hard to implement necessary part of USB from the scratch? Like if I only need USB Serial.
- squarefoot 4y agoAnyone used it for MIDI? I'm mainly interested in drum triggering, so it'd have to be really low latency and reliable while the uC is also reading values from piezo sensors during fast rolls. ps. I'm aware of megadrum (.info) and Mios (ucapps.de), just wanted to see if I could make something similar, albeit much smaller, by myself.