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

Error in std include

Hi

I have a problem concerning compiling my project in uVision4. If i use an example from ST (since I'm using STM32L-Discovery board) VirtualComport_Loopback everything compiles without a problem (and the program functions as well). But when I try to implement that function (CDC USB communication) into my existing project, I get the Error: #40: expected an identifier and error: #65: expected a ";" that refer to usb_type.h include which is a part of Standard USB FS device library of ST. It is not altered in any way from the one I use with ST example. I added all .h files that are inclued in the example into the project and I can't understand this...

Thank you

Parents
  • Still kicking :)...
    Instead of applying various project settings (Include Paths, preprocessor defines, etc.) from CDC example to my project (they seem to be the same, anyway) I simplified things by making the example my base project. I just copied the essential main.c code to example's main.c file and, of course, copied a few corresponding src and inc files into workspace map and...well, same errors come up.
    I'm pretty sure, I'm just missing something very trivial, because i'm not a very experienced programmer. But I cant figure it out...

    Hasn't any1 had a similar problem here???

Reply
  • Still kicking :)...
    Instead of applying various project settings (Include Paths, preprocessor defines, etc.) from CDC example to my project (they seem to be the same, anyway) I simplified things by making the example my base project. I just copied the essential main.c code to example's main.c file and, of course, copied a few corresponding src and inc files into workspace map and...well, same errors come up.
    I'm pretty sure, I'm just missing something very trivial, because i'm not a very experienced programmer. But I cant figure it out...

    Hasn't any1 had a similar problem here???

Children
  • Ok, I think I found a solution, but ran upon another obstacle. There was another definition of TRUE and FALSE on which the error referred to. But when I commented that, another bunch of errors, which seemingly have nothing in common with that:

    -------------------------------------------------------------------------------------------
    .\STM32L152-EVAL\STM32L152-EVAL.axf: Error: L6218E: Undefined symbol LCD_GLASS_Init (referred from main.o).
    .\STM32L152-EVAL\STM32L152-EVAL.axf: Error: L6218E: Undefined symbol PWR_RTCAccessCmd (referred from main.o).
    .\STM32L152-EVAL\STM32L152-EVAL.axf: Error: L6218E: Undefined symbol TIM_TimeBaseInit (referred from main.o).
    .\STM32L152-EVAL\STM32L152-EVAL.axf: Error: L6218E: Undefined symbol TIM_TimeBaseStructInit (referred from main.o).
    --------------------------------------------------------------------------------------------

    Theese errors weren't here before. As I was searching the internet about this I ran across a similar problem on this forum, where it was (successfully) suggested to add some .lib file to the project, but I don't know which lib file is appropriate for STM32L152 (Discovery board).
    And what is lib file actually about?

    Thanks

  • Now you got linker errors - so you got past the compile stage. The original error was from the compiler.

    So - are you supplying all libraries - or all source files - that you need to be able to successfully link your project?

  • Well, since it compiled successfully, I guess so? Usually, if a src or inc file is missing, wouldn't that - as you indirectly suggested - arise an issue already during compilation?

    That's why I was asking about .lib file which was mentioned somewhere in this forum as a solution for ERROR: L6218E Undefined symbol. I didn't include any lib files by now, because I wasn't told to and I don't have an idea what it does...

  • No, the way ST structures their projects with the CMSIS library, is that you need to drop in STM32L1xx_StdPeriph_Lib_V1.1.1\Libraries\STM32L1xx_StdPeriph_Driver\src\stm32l1xx_tim.c (or whatever your configuration is) to your project itself, to resolve the absence of the TIM_xxxx functions at link time.

    The include files, permitting compilation success, usually come in via
    STM32L1xx_StdPeriph_Lib_V1.1.1\Project\YOURPROJECT\stm32l1xx_conf.h

  • Thanks, I didnt notice I was missing a few files in StdPeriphLibDr file group of a project tree. Turns out that I also mistakebly copied one .c file into a folder with includes and that took its toll in diagnosing the problem :).

    I hope this software will function now!