Replies: 5 comments 2 replies
-
I have also had quite a few people suggest to me that I should start learning and using Rust. I have not made any steps to add support to the Artemis. I think a big hurdle would be that the HAL that we use that is provided by ambiq is written in C++ and it may be painful to recreate for Rust. I wonder how many people would be interested in this. |
Beta Was this translation helpful? Give feedback.
-
Looks like the rust embedded book has some example with precisely a Cortex-M4F: https://docs.rust-embedded.org/book/start/hardware.html I wonder if there may be a way at first to just have "a bit of user rust" running on the board that is controlled by the C++ core we have now. |
Beta Was this translation helpful? Give feedback.
-
Hi. I have started programming the Artemis Redboard in Rust, and it is now blinking! I have basically started two approaches:
So far I've only implemented Delay, but that works just fine as well. Mixing both works, but you loose out on the guarantees you otherwise get through the PAC + HAL crate. It is also possible to hack up the embedded-hal traits so using the C hal to just get going quickly, but this won't enforce any of the guarantees either. In other words, you can write rust but regarding the ambiq hal you don't have any more safety than in C. Depending on how much time I want to spend on this I will extend the rust-native traits or just rely on the C hal. Anyway; it is running rust now! The actual crate that can be flashed onto the redboard is: or the one that is using partially a rust native HAL: see https://github.com/gauteh/ambiq-rs/tree/main/boards/sparkfun-redboard-artemis-halc for how to build and flash the blink example.
Regards, Gaute |
Beta Was this translation helpful? Give feedback.
-
This is very cool! I'll have to see if I can get things blinking with your first approach as well. Perhaps this will be my motivation to finally get into Rust. |
Beta Was this translation helpful? Give feedback.
-
I've now also implemented UART (for the USB-serial port) and I2C. |
Beta Was this translation helpful? Give feedback.
-
from jerabaul29 in #408:
Beta Was this translation helpful? Give feedback.
All reactions