Hacker News new | past | comments | ask | show | jobs | submit login
Teensy 3.1 bare metal: Writing a USB driver (2014) (kevincuzner.com)
106 points by kersny on Dec 3, 2018 | hide | past | favorite | 15 comments



For anyone that might be interested, there were some efforts some time back to get Rust running on the Teensy[1][2][3][4], and although there have been no recent updates, the code is available to use and should still be relevant although there have been changes[5][6][7] in the meantime.

[1]: https://github.com/jamesmunns/teensy3-rs

[2]: https://branan.github.io/teensy/

[3]: https://disconnected.systems/blog/bare-metal-rust-on-the-tee...

[4]: https://github.com/SimonSapin/teensy-clock

[5]: https://rust-embedded.github.io/book/

[6]: https://josh.robsonchase.com/embedded-bootstrapping/

[7]: https://github.com/rust-embedded/wg/issues/40


Hey,

Author of the first link above. The Teensy3 crate was some of my first embedded work, I was working with SimonSapin (author of the 4th link) at RustFest to get something working. That library wraps some of the Teensyduino code using bindgen, which gives you the ability to write application code using Rust.

Overall, the Teensy 3.1/3.2 family wasn't great for developing Rust, as they don't have debugger (SWD, similar to JTAG) lines available, meaning you have to use the serial bootloader, and rely on a serial port for all debugging. I believe the newer version of the board expose SWD lines now, so it's not a problem.

Let me know if you have any questions :)

Definitely check out the embedded WG[1], and the new Rust homepage[2]

[1]: https://github.com/rust-embedded/wg [2]: http://beta.rust-lang.org/what/embedded


Slightly off topic: I highly recommend this micro controller for projects big and small. It packs quite a punch in terms of ram/cpu per dollar, lots of pins, great community and Paul was really cool online and at maker’s faire. Thank you Paul, Robin, and the rest of the community for a great product!

Off-off topic, as a web developer I love their super functional site. It even has an about page with pictures of Paul windsurfing haha.


It doesn't seem terribly good value for money. You can get a Nucleo-32 or Nucleo-64 for $10-15. For $23 you can get a Nucleo-144.


Dev board prices are basically random. Disregarding these parts in particular, microcontrollers are a good option because they keep the process of actually bringing something to market simple and cheap, especially for a hobbyist. To go beyond an STM32 or similar (Kinetis, ATSAM, etc.) to an MPU, you end up having to use BGA parts which means board prototyping/manufacture is harder, you have lots of extra PCB design work and you'll probably be putting yocto or some other linux flavor on it which sounds nice but can be a pain. A microcontroller is one part, usually with exposed pins that are easy to hand solder, that you can stick on a PCB with a voltage regulator and maybe a crystal and have a fully functional design. You don't need to worry about board feature sizes/tolerances, high frequency/controlled impedance traces, and the mess of support circuitry that a basic MPU will require.

I know people like to write them off because it's so easy to get devboards with 1GHz+ MPUs and gigabytes of memory/flash on them but if you want to sell stuff, eventually you need to package the design and if you don't NEED linux, you can make your life so much easier and in most cases, have a much smaller product with way lower power consumption.


You don't pay for just the IC and PCB, you are also paying for the in my opinion, fantastic API and documentation that comes with the teensy. Plus, access to a platform that is fairly popular and its users seem to be more, well, advanced, than most arduino folks. Because of this, the forums tend to skew towards less noise and more technical matters.

They are expensive, yes, but I am comfortable buying a board from them every few years to use as my main chip.


I guess I am comparing them more to arduino / adafruit replacements, rather than more direct manufacturer prices. I have no experience with Nucleo boards but many other boards I tried out just hadn’t no community or body of libraries to draw from, whereas the teensy is pretty popular in the makers community. In my case I happened to need to drive 1,000’s of LEDs in real-time for an art piece and not only is there good software support, there is even dedicated hardware made for the teensy for this in the Octo Ws2812 board. I was so impressed with the quality and the size that I generally just use a teensy LC even when a $3 trinket would probably work. YMMV


I hear you. Check out the EPS32 [1][2]. It's faster, has more mem and has built in wifi, so you can access a webpage[3] on it via an ip and your browser and remote control it via your phone. FastLed runs on it, and there are level shifters similar to the Octo for it [4]. You can actually run 16 channels I believe (vs 8 on the Octo). It uses the same level shifter (x2) as the Octo. There is also an 8 channel available if you check the other products on Jason's store on that Tindie site[4]. It's arduino compat- so you probably wouldn't have to rewrite much at all.

[1] https://wiki.wemos.cc/products:d32:d32

[2] https://www.adafruit.com/product/3405

[3] https://github.com/jasoncoon/esp32-fastled-webserver

[4] https://www.tindie.com/products/jasoncoon/16-output-wemos-d3...


There's an online IDE (which is similar in many ways to Arduino) with a whole ton of libraries, accessible from a, well, library, rather than having to hunt them down.


Do you get Paul's incredible support and dedication?


The article links to a web site that has excellent information on the low-level electrical and bit details of the USB protocol: http://www.usbmadesimple.co.uk/



Thanks for using us as a mirror! In case anyone who runs a CMS (HN admins?) is wondering, we would be happy for people to hit our Save Page Now functionality at the time of link submission, so a copy _as it was when posted_ is archived. This is good for both having a copy of the page in case traffic takes it offline (though in general, I think the link should go to the original since then people get their traffic), but also in case the endpoint changes their page or content after it's posted.

You can cause us to save a page by hitting https:// web.archive.org/save/your-url-here with a GET request, and there are more details about the ways to use the interface with browser plugins/etc here: https://blog.archive.org/2017/01/25/see-something-save-somet...


Looks like HN hug of death - perhaps the server is running on a Teensy?


Maybe an ESP8266 with built in wifi ;)




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: