Lsm6dsv16x connection with magnetometer for 9 axis SFLP

I am using lsm6dsv16x 6 axis and its a great sensor. However its yaw drifts over time. The data sheets and application notes of finite state machine do mention that adding and magnetometer to sdx and scx pin can make the sensor 9 axis and the SFLP will do 9 axis sensor fusion. How every there isn’t any example code for that in library, espically for lis2mdl as it is supported easily. I want to do 9 axis sensor fusion and can provide hard and soft iron offsets as required. All i want is to get lis2mdl to connect to lsm6dsv16x and should share its values with it. Thanks

This is the code i found for stm boards and cube ide. It didn’t work for me when i tried to convert it for arduino.
I didn’t have luck on that, it will be great if someone can help. The reference code is this.

I found it on ST community, not sure weather it works.