Home > On-Demand Archives > Q&A Sessions >

Live Q&A - Rust for Embedded Developers: The Peripheral Access Crate

Jacob Beningo - Watch Now - EOC 2024 - Duration: 23:47

Live Q&A - Rust for Embedded Developers: The Peripheral Access Crate
Jacob Beningo
Live Q&A with Jacob Beningo for the talk titled Rust for Embedded Developers: The Peripheral Access Crate
M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

michaelHouse
Score: 0 | 1 month ago | 1 reply

While I enjoy coding in Rust, from this video my impression is Rust support for microcontrollers is really only prime for STM32. My quick search for Rust on PIC16 and Arduino leads me to believe it wouldn't be worth the effort.

Jacob_BeningoSpeaker
Score: 0 | 1 month ago | no reply

Thanks for the comment. I've honestly not tried on anything other than Arm Cortex-M microcontrollers. The example I've used is for STM32, but other Cortex-M parts are supported as well.

MarkBremer
Score: 0 | 2 months ago | 1 reply

I think your explanation of a crate isn't quite right. A crate can contain multiple .rs files and is more similar to a library. Crates can contain multiple modules, which is closer to what you're explaining, where each .rs file is, by default, a single module (you can also define multiple modules in a single file if you'd like).

Jacob_BeningoSpeaker
Score: 0 | 2 months ago | 1 reply

Thanks for the comment. I think the language is a bit ambiguous.
A quick search I found this:

In Rust, a crate is a compilation unit, which can be thought of as a package or a library. It is the fundamental building block of a Rust project, similar to a package in other programming languages.

So an individual .rs file can be considered a crate. However, if you a project that will be used as a library or package, that could also be considered a crate.

So in my example, we had many .rs files in that we compiled into a single library crate for the L475. Then we used that single crate in a project that had a single .rs file.

I agree I could have been more clear on the definition!

MarkBremer
Score: 0 | 2 months ago | no reply

Fair enough. Great talk though!

15:04:51 From Mark Bremer to Everyone:
	Have you looked at any OSes like tock, RTIC, or hubris? There are also FreeRTOS hooks I think.
15:06:43 From Lyden Smith to Everyone:
	Hi Jacob, you mentioned in your talk about cases where you might want to modify the output of the svd2rust tool. I was wondering what cases you can think of where you might want to do that (other than the formatting cleanups)?
15:08:17 From Mark Bremer to Everyone:
	Do you have any opinions on using PAC directly, or using a community-driven (or vendor-driven) HAL that are built on-top of the HAL?
15:09:12 From Manoj to Everyone:
	Hi Jacob, Go blue!
	What does the memory usage look like for a typical ST MCU when we compare some application like Blinky? (Running bare metal vs Rust)
15:09:23 From Lyden Smith to Everyone:
	Replying to "Hi Jacob, you mentio..."
	
	Thank you!
15:14:10 From Brandon to Everyone:
	You predict Rust will be the major language in 10 years or less. What will the transition to Rust look like? Will people get there with some kicking and screaming? Will there be a lot of growing pains? Will more people want to use Rust the more they use Rust?
15:17:19 From Mark Bremer to Everyone:
	embedded-hal is pretty cool. It's not the HAL itself, but provides traits that MCU HALs can implement. Allows you to write drivers that only depend on embedded-hal that can be used on different MCUs. It standardizes the abstraction layer which makes it easy to use community-written drivers on different MCUs.
15:18:02 From Mark Bremer to Everyone:
	Replying to "embedded-hal is pret..."
	
	not a question, but something I found was really nice
15:21:02 From Andrew MacIsaac to Everyone:
	Replying to "embedded-hal is pr..."
	
	I agree, I've started dipping my toes in it recently, and found that trait mechanism to be a really nice aspect of the language.
15:23:06 From John S. to Everyone:
	This question relates more to your Tuesday talk. If you're currently using IAR-EWARM, and want to try to add some DevOps tools, is it necessary/helpful to first move to a VSCode environment?
15:24:55 From John S. to Everyone:
	Cool, thank you!
15:26:23 From Mark Bremer to Everyone:
	Thanks Jacob!!
15:26:41 From Lyden Smith to Everyone:
	Thank you Jacob!
15:26:56 From Andrew MacIsaac to Everyone:
	Thank you!
15:27:00 From Gabriel to Everyone:
	Thanks Jacob

OUR SPONSORS

OUR PARTNERS