2025-08-13 7:23 AM - last edited on 2025-08-13 7:56 AM by TDK
Look at this beauty.
In touchgfx\framework\include\touchgfx\hal\Types.hpp:
static const float PI = 3.14159265358979323846f; ///< PI
In CMSIS-DSP\Include\dsp\fast_math_functions.h
#ifndef PI
#define PI 3.14159265358979f
#endif
Fortunately, the conflict is caught at compile time.
It’s an exceptionally rare situation when you might need something from TouchGFX (e.g., instrumentation) and CMSIS-DSP at the same time — but when it happens, you get this delightful collision.
Just in case anyone is compiling a list of tricky interview questions.
Solved! Go to Solution.
2025-08-18 5:10 AM
Hello @ERROR.,
Thanks for your input, unfortunately this can't be fixed and there's no workaround due to backward compatibility. The problem occurs with line like this :
#include <dsp/fast_math_functions.h>
...
touchgfx::PI; // CRASH
...
PI; // OK, but its only and always the DSP's PI
...
We will add this, to the known issues.
BR,
2025-08-18 5:10 AM
Hello @ERROR.,
Thanks for your input, unfortunately this can't be fixed and there's no workaround due to backward compatibility. The problem occurs with line like this :
#include <dsp/fast_math_functions.h>
...
touchgfx::PI; // CRASH
...
PI; // OK, but its only and always the DSP's PI
...
We will add this, to the known issues.
BR,