2024-08-20 09:17 AM - edited 2024-08-21 12:29 AM
Hello,
I have a custom board with STM32F407 CPU, LSM6DSV16XTR accelerometer+gyroscope and LIS2MDLTR magnetometer.
I aim to get board inclination and the position of the north using the magnetometer for a telescope.
Using CubeMX, I have enabled the LSM6DSV16B and the LIS2MDLTR in the Middleware package.
When generating, CubeMX removes the I2C1 initialization from main. But I need the I2C1 peripheral for other devices in the board, not only for MEMS. What is the correct way to manage this?
Thank you.
Solved! Go to Solution.
2024-08-21 02:26 AM
OK, fixed by adding the following lines in the provided USE_CODE areas in main.c:
extern I2C_HandleTypeDef hi2c1;
BSP_I2C1_Init();
Now it is not completely clear to me how to get the most accurate inclination an eCompass information since there are a lot of possibilities. Is the MotionFx the definitive solution or it is better to use MotionTL and MotionEc or maybe a combination of these?
Thank you.
2024-08-21 02:26 AM
OK, fixed by adding the following lines in the provided USE_CODE areas in main.c:
extern I2C_HandleTypeDef hi2c1;
BSP_I2C1_Init();
Now it is not completely clear to me how to get the most accurate inclination an eCompass information since there are a lot of possibilities. Is the MotionFx the definitive solution or it is better to use MotionTL and MotionEc or maybe a combination of these?
Thank you.
2024-08-21 02:32 AM
@MRaff.1 wrote:OK, fixed by adding the following lines in the provided USE_CODE areas in main.c.
Good - please mark that as the solution:
https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256
@MRaff.1 wrote:Now it is not completely clear to me how to get the most accurate inclination an eCompass information since there are a lot of possibilities. Is the MotionFx the definitive solution or it is better to use MotionTL and MotionEc or maybe a combination of these?.
I think that's a new question - so better in a new thread.
Please give a link here so people can find it.
2024-08-21 07:17 AM
Thank you Andrew you are right, here the link.