Hi there,
And welcome here,
So you more than likely are using the wrong BSP for the objective your trying to achieve. The BSP is probably the most frustrating for new users and non programmers. Check out the Demo’s on here with code I have posted You can copy and paste one of those and it will work.
The LIB and the BSP are what your working with here.
try this one, Note the comments in the header. Use the Board manager TAB to find the BSP and Roll it back to an older Version that is better matched and works with the IMU.
HTH
GL PJ
stay at it , you’ll get it.