LSM303D tilt compensation problem

MagCal outputs the INVERSE of the matrix that you need to use for the correction.

That is why I don’t use it, and use Magneto instead.

For the norm of the magnetic field, again, I recommend to use a value that is roughly the average absolute value of all the measurements.