My apologies, but I still believe you are not understanding the problem. I am describing a software bug in your library, not a particular issue I am experiencing. To re-iterate: If for ANY reason (does not matter why) rstl is not BMI160_OK on line 6271, the function we are in (get_foc_status()) will return WITHOUT doing anything to foc_status. Therefore, on line 6327, foc_status will be used without having been initialized, and the library risk crashing the microcontroller (reading uninitialized variables are undefined behavior). I would also recommend reviewing my previous post which I believe lays it out the clearest.
... View more