Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also enjoying https://github.com/japaric/svd2rust - Generates simple uniform register mappings for various cortex-m and msp430 micros.


I 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.


I 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.


I 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.


I 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/STM32F103...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: