Skip to content
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

Build for STM32 (no_std, thumbv7m-none-eabi) - no global memory allocator #245

Open
hanusek opened this issue Sep 19, 2023 · 1 comment
Open

Comments

@hanusek
Copy link

hanusek commented Sep 19, 2023

Hello!
I try to build my project with bitvec for stm32f103.

I added this for my cargo.toml:

[dependencies.bitvec]
version = "1"
default-features = false
features = ["atomic", "alloc"]

Error:

error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait

error: could not compile `my-project` (bin "my-project`) due to previous error

How to fix it?

@dscso
Copy link

dscso commented Jun 23, 2024

do you have an allocator enabled? Since you are no_std in an embedded context you need to add an allocator like https://github.com/rust-embedded/embedded-alloc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants