3 ms·
I've been using japaric's awesome work on Xargo (for cross compiling the std lib) to target a variety of ARM Cortex'es. Sometimes doing all work in Rust, someti
by th0br0 9y ago
I've been using japaric's awesome work on Xargo (for cross compiling the std lib) to target a variety of ARM Cortex'es. Sometimes doing all work in Rust, sometimes just for linking against Rust crates in a C program. It's a breeze and super fun.
This is, in my opinion, where Rust really shines: using one codebase - without installing any new tools - I can target pretty much all platforms from embedded to browser to mobile.
- samlittlewood 9y agoAlso enjoying https://github.com/japaric/svd2rust https://github.com/japaric/svd2rust - Generates simple uniform register mappings for various cortex-m and msp430 micros.
- yammajr 9y agoI was disappointed when I tried to use svd2rust for the atmel-provided svd's. They unfortunately do not provide reset values for some registers, which causes svd2rust to panic.
- doctor_stopsign 9y agoI was able to make a hacky fix for that. If you get the `svd2rust` source code and modify `generate.rs` on line 756 you can get it to generate a library file and not panic. There are still a ton of warnings that pop up, and I haven't yet tested it on an MCU but in theory it should work.
- yammajr 9y agoI did exactly the same thing, but I'm not totally happy with it. Good for fooling around with, but not convinced I'd want to push something using it into production without a bit of further investigation.
- ehntoo 9y agoI think the standard approach for crates to work around problems like this is to patch the vendor's XML. Terrible that it's necessary, but workable. The "STM32F103xx.patch" in japaric's stm32f103 support crate [1] seems a decent example of the sort of hacks that are standard. [1] https://github.com/japaric/stm32f103xx/blob/master/STM32F103xx.patch https://github.com/japaric/stm32f103xx/blob/master/STM32F103...