Port C project to Rust 🚗

Hello everyone,

I am still learning Rust intensively so my questions might be irrelevant. I am also very inexperienced with embedded even though it's probably the funniest thing I have done :heart_eyes:.

One of the things I would love to do is to port a project (the classical obstacle avoiding robot) I wrote for PIC32 in C to Rust.
I redid (of course!) this project with Arduino together with kids in my neighborhood - simpler version, without interrupts though.
That is to say I am open to try on any micro-controller, preferably GPIO to start smoothly.

I found discussions about embedded-hal as well as the awesome resource.

Questions:

  1. Dear Resources Team, when we are talking about Arduino board support crates, are we also talking about Chinese clones as well?

  2. What would be the friendliest micro-controller that I could use (easiest board, most documented crate)?

If you have the patience, please explain like you would to an 11 years old. Firstly I am not experienced enough, secondly, I might do the project with the kiddies in my neighborhood (we have a programming hang-out), so several people might benefit from your efforts :smile: :smiling_face_with_three_hearts:.

Thank you!

4 Likes

Hi and welcome to embedded Rust!

They should generally work with compatible clones. The quality of those can be a bit questionable from time to time though, so I tend to recommend using official hardware.

I can recommend the STM32F3 series, which is used on the F3 discovery board, used in the Discovery book, an excellent introduction into embedded Rust.

A lot of people get started with the "Blue Pill", which uses an STM32F103. You can get these boards for very cheap, though the quality varies.

The nRF52 series is also pretty good, it has its own set of HAL crates here that are also fairly nice to use. You can get the nRF52840-DK board to get started. The cool thing about these is that they have a 2.4 GHz radio that can speak various protocols.

5 Likes

Thanks for the advice!

Yes, you're right, one need to buy proper hardware, in that case we needed to make sure everyone had access to material.

I remember I would also need PWM (or basic servo functions) for my robot little head so let me explore your links and come back to you :slightly_smiling_face:

As far as HALs and boards go, I can also recommend LPC8xx HAL with the LPC845-BRK.

The HAL is reasonably complete and well-documented (I've put a huge amount of work into it this year), and the LPC845-BRK is a decent board (with an on-board programmer, which I believe the Blue Pill doesn't have) that costs around 6€ at places like Farnell and Mouser.

2 Likes

Opened it and I already love the docs. I am trying something with avr-hal right now that does not compile on my board. (Let me open another post for it...)

I have this (stm32f334 nucleo)

Any easy resources to work with this?

The Discovery book I linked above should also work with that board (but some of the external peripherals might be missing, so not every exercise will work).

1 Like

After a dramatic failure this morning with reading my sensors output, I am ordering the F3 to learn from the book. Sadly it is not available right now. Can I order any STM32F3 series (this one has camera surveillance interface :laughing:). Looks like it has every external peripheral one can wish, but inside.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.