AnsweredAssumed Answered

Problem with arm_math.h in the newest mxCube

Question asked by Lukasz Przenioslo on Jul 15, 2016
Latest reply on Aug 25, 2016 by Clive One
Hello there,
I have just updated mxCube to version 4.16.0. I am genereting startup code for SW4STM32. I am using arm_math libarry. Since this version, I am getting warning I should not be getting... For example:

M:/10.10.10.5/Software/trunk/Embedded/eclipse_embedded_projects/SmartServo2/Drivers/CMSIS/Include/arm_math.h: In function 'arm_pid_q15':
M:/10.10.10.5/Software/trunk/Embedded/eclipse_embedded_projects/SmartServo2/Drivers/CMSIS/Include/arm_math.h:4889:19: warning: implicit declaration of function '__SMUAD' [-Wimplicit-function-declaration]
     acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);

And the thing is, I am not even using this __SMUAD macro, because my MCU is cortex M4 and I have the define ARM_MATH_CM4 set properly. So the preprocessor should not even consider this part of code and for some reason he is doing that and giving me a lot of warnings. Is there a way to suppress this somehow?

This is the part of code in arm_math.h:
#ifndef ARM_MATH_CM0_FAMILY
    __SIMD32_TYPE *vstate;
 
    /* Implementation of PID controller */
 
    /* acc = A0 * x[n]  */
    acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);
 
    /* acc += A1 * x[n-1] + A2 * x[n-2]  */
    vstate = __SIMD32_CONST(S->state);
    acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc);
#else
    /* acc = A0 * x[n]  */
    acc = ((q31_t) S->A0) * in;
 
    /* acc += A1 * x[n-1] + A2 * x[n-2]  */
    acc += (q31_t) S->A1 * S->state[0];
    acc += (q31_t) S->A2 * S->state[1];
#endif

ARM_MATH_CM0_FAMILY is not defined in my project, so why does he give the warning? I would appreciate all help.

Outcomes