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 fails with stm32h7xx_hal #6

Closed
Flydroid opened this issue Jan 25, 2024 · 3 comments
Closed

build fails with stm32h7xx_hal #6

Flydroid opened this issue Jan 25, 2024 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Flydroid
Copy link

Flydroid commented Jan 25, 2024

Hi @marius-meissner ,

I was happy to find that there is already a create implementing the LTC681x family.
I'm working on a BMS based on the Portenta H7 development board
and cell sensor board with two LTC6812 ICs.

I have a working simple test code with spi in this commit: 1e2885d

When I add the LTC681x create like this commit b954de7 the build fails with the message:

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

This shouldn't happen as the LTC681x crate is not using any alloc(), right?
I tried to check the heapless create, but except in its tests it also not using the std allocator.
Then maybe an interaction with the STM32H7xx_hal create?

Any hints or suggestions on how to fix this issue would be very appreciated!

@Flydroid Flydroid changed the title build fails on STM32H747 build fails with stm32h7xx_hal Jan 25, 2024
@Flydroid
Copy link
Author

I managed to get unstuck, by removing extern crate alloc from the lib.rs source.

After that of course the tests don't compile anymore.
In my project I must be missing something that suppresses that the test code gets compiled

@marius-meissner
Copy link
Member

@Flydroid Thanks a lot for brining this up.
Shouldn't be a big deal for fixing this.
Could you please check if #7 viable solution?

@marius-meissner marius-meissner added bug Something isn't working enhancement New feature or request labels Feb 1, 2024
@Flydroid
Copy link
Author

Flydroid commented Feb 3, 2024

@marius-meissner Thanks for the quick fix!
Yes it solves the build issue!

@Flydroid Flydroid closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants