compilation errors with C++ Library by gcc/gnu

Question/Issue:
I encountered a compilation error while deploying C++ libraries to my device, which is similar to STM32 with CORTEX-M4 kernel, and I found that the cause of the error is due to the fact that main.cpp contains conflicting files, which are: none.h and cmsis_gcc.h.
Both of these files are from C++ libraries downloaded from the platform.

Project ID:
643211

Here are some of the bug reports:

In file included from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h:33,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h:33,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h:34,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h:34,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/dsp/numpy.hpp:77,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk\classifier\ei_model_types.h:42,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk\classifier\ei_run_classifier.h:38,
from project/src/main.cpp:31:
middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h:120:31: error: redefinition of ‘uint32_t __ROR(uint32_t, uint32_t)’
__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
^~~~~
In file included from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/cmsis_compiler.h:54,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h:162,
from libraries/cmsis/cm4/device_support/at32f403a_407.h:354,
from project/inc/at32f403a_407_board.h:34,
from project/src/main.cpp:25:
middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h:346:31: note: ‘uint32_t __ROR(uint32_t, uint32_t)’ previously defined here
__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
^~~~~
In file included from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h:33,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h:33,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h:34,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h:34,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/dsp/numpy.hpp:77,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk\classifier\ei_model_types.h:42,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk\classifier\ei_run_classifier.h:38,
from project/src/main.cpp:31:
middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h:223:33: error: redefinition of ‘uint32_t __SADD16(uint32_t, uint32_t)’
__STATIC_FORCEINLINE uint32_t __SADD16(
^~~~~~~~
In file included from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/cmsis_compiler.h:54,
from middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h:162,
from libraries/cmsis/cm4/device_support/at32f403a_407.h:354,
from project/inc/at32f403a_407_board.h:34,
from project/src/main.cpp:25:
middlewares/at32_motion_detection-v5/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h:1747:31: note: ‘uint32_t __SADD16(uint32_t, uint32_t)’ previously defined here
__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)

As shown in the above report, the redefinition is caused by the fact that none.h and cmsis_gcc.h have the same function definitions, which are referenced from ei_run_classifier.h and at32f403a_407_board.h, respectively, in main.cpp.
The at32f403a_407_board.h is the file required for my device.

Has anyone had a similar problem please? How should I fix the redefinition of these two files?
Please let me know if you need any other information, thanks a lot!