-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can dynamically sized Vec<T> be using on STM32? #335
Comments
@therealprof Thanks, yeah I had seen |
You can use alloc-cortex-m to create a heap and combine it with heapless. |
@johnthagen what @therealprof said. The quickstart template has an example: https://github.com/rust-embedded/cortex-m-quickstart/blob/master/examples/allocator.rs |
(you don't need to specifically use alloc-cortex-m; any global_allocator will do) |
@japaric Is this mentioned in the Discovery Book? And if not, would you accept a PR to add it? I think this would be a really great addition! |
(For anyone else finding this issue in the future, the embedded book has some discussion on this as well.) |
I think this would be more appropriate for the book and/or the embeddonomicon with a reference in the discovery book. Any contributions in that directions would certainly be welcome. |
I think we should also note (last time I checked) that |
Correct, this RFC is currently being discussed to potentially stabilize |
|
So:
I think that no action is required here anymore and this issue could be closed. |
Yup, closing then. Thanks! |
Cross post from rust-lang/rfcs#2480 (comment)
When evaluating using Rust for an embedded project at work, not having dynamic containers was a big drawback at the time compared with C++11/14 where the
gcc-arm-embedded
toolchain had versions ofstd::string
andstd::vector<T>
. (C++ has it's own set of drawbacks, like exception-based error handling APIs, but in this one, fundamental case, it had a leg up).Is there a way (even it's nightly) to use
Vec<T>
on something like the STM32F3DISCOVERY? It was a hard sell to recommend Rust over C++ without being able to safely use the heap.Edit: We used
heapless
in some tutorials but we wanted to have true heap access available like is available for C++11/14 and thegcc-arm-embedded
toolchain.The text was updated successfully, but these errors were encountered: