BMI270 Component for ESP IDF
Posted: Mon Dec 30, 2024 12:47 pm
I have added the bmi270 component using the component manager in esp-idf (vscode extension) and the buidl works , but when I add any program from the expamples, in the main.c , it doesnt build and gives error.
Probably becuse of how I am setting the CMake file.
Please help to add this component to my project and build it.
[This is the link for the component](https://components.espressif.com/compon ... ions/1.1.0)
And here is the picture of my directory:
Also her is my CMake file:
I went through the test app in the bmi270 for cmake reffernce but didnt understand how to make it work.
Also for reference, the errors I get:
Probably becuse of how I am setting the CMake file.
Please help to add this component to my project and build it.
[This is the link for the component](https://components.espressif.com/compon ... ions/1.1.0)
And here is the picture of my directory:
Also her is my CMake file:
Code: Select all
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
)
Also for reference, the errors I get:
Code: Select all
C:/Users/ashfa/ESP-COP-A/main/main.c: In function 'main':
C:/Users/ashfa/ESP-COP-A/main/main.c:63:12: warning: missing initializer for field 'gyr' of 'struct bmi2_sens_data' [-Wmissing-field-initializers]
63 | struct bmi2_sens_data sens_data = { { 0 } };
| ^~~~~~~~~~~~~~
In file included from C:/Users/ashfa/ESP-COP-A/managed_components/espressif2022__bmi270/bmi2.h:61,
from C:/Users/ashfa/ESP-COP-A/managed_components/espressif2022__bmi270/bmi270_legacy.h:59,
from C:/Users/ashfa/ESP-COP-A/main/main.c:10:
C:/Users/ashfa/ESP-COP-A/managed_components/espressif2022__bmi270/bmi2_defs.h:1865:32: note: 'gyr' declared here
1865 | struct bmi2_sens_axes_data gyr;
| ^~~
C:/Users/ashfa/ESP-COP-A/main/main.c:73:12: error: implicit declaration of function 'bmi2_interface_init' [-Werror=implicit-function-declaration]
73 | rslt = bmi2_interface_init(&bmi, BMI2_SPI_INTF);
| ^~~~~~~~~~~~~~~~~~~
C:/Users/ashfa/ESP-COP-A/main/main.c:74:5: error: implicit declaration of function 'bmi2_error_codes_print_result' [-Werror=implicit-function-declaration]
74 | bmi2_error_codes_print_result(rslt);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/ashfa/ESP-COP-A/main/main.c:133:5: error: implicit declaration of function 'bmi2_coines_deinit' [-Werror=implicit-function-declaration]
133 | bmi2_coines_deinit();
| ^~~~~~~~~~~~~~~~~~
cc1.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.