Hi @Iakgu.1 ,
for the gyroscope, you have no dependency of the zero rate level (G_TyOff parameter in the datasheet, p. 9) offset with the position, so you can simply acquire the gyro output in a steady condition in order to evaluate the residual post solder offset, and compensate it in post processing.
For the accelerometer, you have to take into account the gravity field: in this case it would be better to know your position, in order to understand the portion of earth gravity offset along each axis. However, you could think to place the LSM6DSO in a steady condition (regardless the actual position of the device in space), and use the high pass filter (datasheet p.58) to cut the 1g gravity from each axis. In this way the residual contribution to the output would be given by the offset.
For a general overview on the available firmware calibration libraries running on STM32, you can refer to the X-CUBE-MEMS1 package, especially the MotionAC accelerometer calibration library and the MotionGC gyroscope calibration library.
-Eleon