Building for STM32F4 target fails on lvgl-sys #50
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: rafaelcaricio/lvgl-rs#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This might be a very basic issue as I am not too familiar with C toolchain cross-compilation. The Rust side of thing should be ok as I have a working project deploying to STM32F4 (blackpill).
I'm on Linux (Arch), with the latest
arm-none-eabi-gcc
andarm-none-eabi-newlib
installed. I've created a sample Cargo project as a subfolder of lvgl-rs, where I've set thethumbv7m-none-eabi
target.My cargo command-line is
DEP_LV_CONFIG_PATH=
pwdcargo build -Zfeatures=build_dep
, the -Z part of which I picked from a closed issue similar to what I was experiencing.The error message is
It's a fact that there is no
string.h
file in my/usr/lib/gcc/arm-none-eabi/11.1.0/include
dir, and I have no idea where I should get it from or how I could provide it to the lvgl-sys build process.As a general observation, it would be nice to have some examples targeting embeded targets (code & build) - unless I couldn't find them? If I fix my sample, I'd be happy to make into a PR for others to follow.
Hi @fralalonde ,
I do have one old example here: https://github.com/rafaelcaricio/pinetime-rs (it is using the branch of the PR https://github.com/rafaelcaricio/lvgl-rs/pull/27) I was testing the input device API in an actual device at the time.
The error you are getting seems familiar. What I can say is that I do embed a Rust version of the
string.h
ABI implementation in thelvgl-sys
crate. So you can really copy astring.h
header file from somewhere and drop it in the same dir you have pointed theDEP_LV_CONFIG_PATH
env variable and at linking time it should match with thestring_impl.rs
.Please try that and let me know if that works for you.
Also FYI, I'm actively working on an upgrade of the LVGL-rs bindings API. I realized that the existence of the
UI
struct is cumbersome and makes the usage of the library less flexible, so I'm removing it. So I believe it will simplify and make the usage of LVGL in Rust projects more expressive. Since you seem to be actively trying the library, I think you would be glad to know. :)Fixed it by adding
/usr/arm-none-eabi/include
to theC_INCLUDE_PATH
:Maybe it's an Arch thing [sigh] or some quirk of my station. I didn't get anything to display yet but the build completes successfully which is always a good sign with cargo.
Thanks for the heads up on the upcoming upgrade!
This fixed it for me as well except the correct include path is
/usr/lib/arm-none-eabi/include/
(notice the/lib
). Would be good to have this in the readme along with the requirement to installgcc-arm-none-eabi
on linux.