Rust Running On The Realtek RTL8710: ESP8266 Alternative?

For simply getting your project connected to WiFi, a least among hacker circles, nothing beats the ESP8266. But it’s not the only player out there, and we love to see diversity in the parts and languages that we use. One of the big shortcomings of the ESP8266 is the slightly-oddball Xtensa CPU. It’s just not as widely supported by various toolchains as its ARM-based brethren.

And so, when [Zach] wanted to do some embedded work in Rust, the ESP8266 was out of the picture. He turned to the RTL8710, a very similar WiFi module made by Realtek. Documentation for the RTL8710 is, at the moment, crappy, much as the ESP8266 documentation was before the hacker community had at it. But in trade for this shortcoming, [Zach] got to use the LLVM compiler, which supports the ARM architecture, and that means he can code in Rust.

In the end, the setup that [Zach] describes is a mix of FreeRTOS and some of the mbed libraries, which should be more than enough to get you up and running fairly painlessly on the chip. We’ve actually ordered a couple of these modules ourselves, and were looking to get started in straight C, but having Rust examples working doesn’t hurt, and doesn’t look all that different.

Is anyone else using the RTL8710? An ARM-based, cheap WiFi chip should be interesting.

26 thoughts on “Rust Running On The Realtek RTL8710: ESP8266 Alternative?

  1. Slightly OT but i love the curved traces on that breakout board. I’m a Kicad user, but have often been tempted to move to geda to use toporouter. I think if it was still being worked on i would.
    I tried porting toporouter to a plugin at one point, but debugging it when the routing want working was being me..

      1. Eagle Cad is great. I am concerned that this Cadsoft product was acquired recently by Autodesk. I haven’t upgraded to their new version yet, but I hope things won’t go south since I am a Linux user with relatively few options. It really has been an excellent product over the years. I’ve designed up to 8 layer boards with 800 MHz DDR3 (with trace length matching) and RF boards up to 6Ghz no problem.

          1. I can only agree to this.
            As someone who used professional tools like Mentor graphics before (now in this company something different), I found it looked very clumsy when I watching a friend doing his project in Eagle. But it was his private project were I helped him with HW design and it was important for him not to use something else with a “questionable” license :-) Doing this with the Lenovo “red mouse-nipple” of the laptop nearly hurt just by looking at him. :-) But after I convinced him to use a real mouse he admitted, that this improved the working speed. In fact he is much more used to coding than HW design.

          2. Eagle users are successful in spite of the UI, not because of it.

            This program has one of the worst UI’s I’ve ever had the misfortune to use, but if you put in the investment to learn it, it does pay off, I have to begrudgingly admit. Go through the tutorials; they do a good job of teaching the UI.

  2. It seems like an odd statement to say the ESP8266 is not supported by various toolchains. It is not an ARM processor, so of course it is not supported by the ARM toolchains. But it does have a perfectly good toolchain that is no particular trouble to install. So maybe it would be better to just say “the ESP8266 ain’t an ARM”. If that matters to you. Not that I don’t like ARM processors.

    But all that aside, it is indeed always good to see new and different parts and approaches. My big question would be price given that the ESP8266 is dirt cheap. The other consideration with controllers is the advice I give people. Namely the best controller for your next project is the one you used for your last project — because you are up the curve with it. I find that this rule applies in more cases than you might imagine. And you could even give Zach a gold star for choosing his hardware based on a familiar development environment.

    1. ++ to using what you know. My main reason for picking the 8710 was simply because I could run Rust on it, which I know a lot better than C :)

      Re: price. The cheapest ESP8266 I can find on Aliexpress is $1.60 (an ESP-01S model). The cheapest RTL8710 on Aliexpress is $2.70, and Pine64 has them for $1.99 (although a flat $6.99 shipping, which makes it less cheap for one-off purchases). So a bit more expensive, but still relatively cheap.

      1. You know rust better than c?

        It’s like the future where children learn QM with only a touch of newtons work.

        I always felt that rust was clunky without a good founding in CS which pretty much meant you knew C/C++

        1. :P

          At least for me, I know just enough C to be very dangerous to myself. I don’t trust anything I do in C, and have never worked in it for long enough stretches to gain the intuition about right vs wrong approaches.

          My path followed a CS-to-webdev path: first C/C++, then some Java. Then I switched careers to bio, and when I eventually switched back I went the web-dev route (PHP, ugh, JS, etc). I’m back to working in high-performance Java and dabble in Rust on the side.

          What I like about Rust is that it gives me greater confidence in my code. The compiler has my back, so I can code less fearfully and resolve problems at compile time instead of runtime. Sure, it took some work to understand how move semantics work in Rust, but once over the learning curve it’s really pleasant to work in.

          In contrast, it terrifies me when my C code compiles, because I know that’s not really a strong guarantee that it’ll work.

    2. I think the point was just that the Xtensa isn’t supported by *more than one* toolchain, in particular not by LLVM, unlike ARM/AVR/X86/etc. Not that the one toolchain that exists for it is a bad one, just that lacking Xtensa support in LLVM, it’s not possible to compile rust to it.

  3. Looks interesting. And thanks much for not writing “ESP8266 -killer” in the headline.

    Now if you’ll excuse me, I have 10 Sonoff (ESP8266-based) wifi switches to reprogram. Because I can.

  4. It is true that in the past 4 years, the ESP8266 is the most popular Wifi solution for Makers, the good spec and cheap price make the competitors, such as RTL8710, hard to grow up.
    But sometimes plan B is indeed needed. Recently the W600 Arm SoC Wifi solution, released by Winner Micro, I think would be an evenly matched competitor for ESP8266.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.