- STM32F446RE or anything compatible with Cortex-M4 and ARMv7-M architecture.
- MPU6050 6-axis IMU.
Type make compile upload
. But before doing this change STLink directory.
I'm using Cortex-Debug extension for VS Code to use GDB debugger. There is svd file provided for registers lookup.
- UART interface DONE
- I2C interface DONE
- IMU algorithm In progress
Because I couldn't use build-in trigonometric functions (they don't exist in ARM Thumb, or DSP and FPU extensions of Cortex-M4), I could use CORDIC algorithm or Taylor series but I found some approximation functions in this article: Fast computation of arctangent functions for embedded applications: A comparative analysis. Arctan function is necessary for complementary function. I wanted to avoid lookup table techniques and interpolation.
The x should be between -1 and 1 Radians but the second solution gets quite good results between -1.5 and 1.5 Radians. (1.5 Radians = 85.94 degrees).
Then we have to compute atan2.
- I didn't noticed that DSP extension of Cortex-M4 doesn't support trigonometric function instructions like AARCH64 therefore I need to look for different filter function or write from scratch these functions (arctan, atan2 etc.).
- Improve the efficiency and final refactor.
- Write a clear restart for MPU6050 from freeze which occurs for example when debugging.