LSM303AGRTR are used for compass calibration bearings, but are very susceptible to interference
Edit by ST Moderator: This post has been translated from Chinese to comply with the ST Community Terms and Conditions (§10.2).
LSM303AGRTR
The chip is used to calibrate the orientation of the compass, but it is very easy to be interfered with and has the following two problems
1 Calibration is very difficult to calibrate, you need to shake the sensor many times
2. After calibration is done it is very susceptible to interference, resulting in inaccurate compass data
Below is the circuit diagram, if you have a mature circuit please send me to see if there are other solutions to the problem.

