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

Peripheral Files Compiling Issues

Hello everyone,

I've been trying to get started with a STM32FDiscovery (with STM32F100RB controller) board in uVision. However, when I compile my program I get the error-

L6218E "undefined symbol assert_param (referred from file stm32f10x_gpio.c)"
and a further 48 warnings-

'#223 D: function "assert_param" declared implicitly'

at various lines in the included peripheral files. The peripheral files I included were stm32f10x_gpio.c, stm32f10x_misc.c, and stm32f10x_rcc.c from the an3268 firmware package provided by ST.

I've included the same files in another project I copied from my old computer, and that project compiles just fine. Hours of scanning through the files have turned up no differences in code between the two projects and I still have the same problem when I start a new project.

Please help!

Parents Reply Children
  • stm32vldiscovery_package\Project\Examples\GPIOToggle\main.c

    #ifdef  USE_FULL_ASSERT
    /**
      * @brief  Reports the name of the source file and the source line number
      *         where the assert_param error has occurred.
      * @param  file: pointer to the source file name
      * @param  line: assert_param error line source number
      * @retval None
      */
    void assert_failed(uint8_t* file, uint32_t line)
    {
      /* User can add his own implementation to report the file name and line number,
         ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
    
      /* Infinite loop */
      while (1)
      {
      }
    }
    #endif
    

    Defines: STM32F10X_MD_VL, USE_STDPERIPH_DRIVER

  • Haha yes I did find that the "assert_param" symbol is used at different points in these peripheral files. What I meant by hours of scanning was that this same project setup worked before but on the new computer it doesn't work, so I was trying to find an anomaly. All the included files and the code are the same.

    When I copy and paste the old project folder, it runs just fine. But setting up a new project is causing the error.

  • The included files may be the same.

    But if you browse the source code containing these symbols, you may see #ifxxx code. And that might indicate to you that your projects has a different set of #define which makes the compilation behave differently. That's why it's called conditional compilation.

  • Review the DEFINES and PATHS within the metadata of the project(s) as these impact the files used and the code built. Look at the Example and Template projects.

    Check also the project specific stm32f10x_conf.h file

    stm32vldiscovery_package\Project\Examples\GPIOToggle\stm32f10x_conf.h