This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undefined symbol

I cannot compile project where arm_math.h included:

Added"Options for Target" > "C/C++" > "Defines":

                         C/C++ :- ARM_MATH_CM4
                        - __FPU_PRESENT = 1

But cannot compile

Error: L6218E: Undefined symbol arm_pid_init_f32 (referred from main.o).

Parents Reply Children
  • Thank you for answer.
    I`ve added following to main.c and compiled successfully and PID starts to work:

    void arm_pid_init_f32(
      arm_pid_instance_f32 * S,
      int32_t resetStateFlag)
    {
    
      /* Derived coefficient A0 */
      S->A0 = S->Kp + S->Ki + S->Kd;
    
      /* Derived coefficient A1 */
      S->A1 = (-S->Kp) - ((float32_t) 2.0 * S->Kd);
    
      /* Derived coefficient A2 */
      S->A2 = S->Kd;
    
      /* Check whether state needs reset or not */
      if(resetStateFlag)
      {
        /* Clear the state buffer.  The size will be always 3 samples */
        memset(S->state, 0, 3u * sizeof(float32_t));
      }
    
    }