pino-rs

Public

@timblakely

Download board files

Files for version 1. Pick what you came for.

Share pino-rs

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading 3D model… large boards can take a moment.

README

Pino controller

Bare-metal BLDC controller for Pino the robot, written in Rust!


Disclaimer: I'm quite new at Rust, so please bear with me

This repository is currently a continuously changing, seething mess as I flail around learning Rust. You're welcome to browse around the code, but please don't expect proper, idiomatic Rust code just yet. For that I'd suggest the following resources:

  • The Rust Book - Seriously, read it "cover to cover" as it were. Coming from >15 years of C++ I debated whether it was worth reading the absolute basics, but I ended up going through it all and don't regret it one bit.
  • Embedded Rust Book - I know, I know, another book. But it's quite a bit shorter and more of a getting-started guide to getting Rust up and running in an embedded context.
  • m4vga-rs - Not only is it a downright amazing implementation - 800x600@60FPS VGA on an STM32F4 (!) - the code is entirely in Rust and spectacularly well commented to boot! Definitely the place where I'm learning the most about Rust.

Why rust?

I originally started the controller in C++, but found myself spending more and more time thinking about the language implementation, template metaprogramming, and wrestling with the inability to constexpr a raw address (can't reinterpret_cast<Foo> an address in a constexpr, but don't take my word for it...), and less time on the actual controller itself. That's when I stumbled on Cliff Biffle's post with the contentious title "Prefer Rust to C/++ for new code". He posits that Rust was ready to replace C++ in most-if-not-all situations, and that was back in 2019. That post single-handedly convinced me to try out Rust, and I haven't looked back since.

Building it

Don't bother trying right now; it doesn't really do anything :stuck_out_tongue_winking_eye:

But if you really want to:

  1. cargo build
  2. Connect your NUCLEO-G474RE, and follow the Embedded Rust steps for adding the proper udev rules
  3. In VSCode, select cortex-debug launch configuraiton
  4. Hit F5
Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.