Skip to main content
ybenharim10
Associate III
December 28, 2008
Question

Interrupts with C++

  • December 28, 2008
  • 6 replies
  • 1098 views
Posted on December 28, 2008 at 04:48

Interrupts with C++

    This topic has been closed for replies.

    6 replies

    ybenharim10
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    I generated the UART interrupt example and it worked OK.

    Since I want to write C++ code, I changed the project's language to Extended C++.

    Now I have the following problems:

    1. when building the project, the compiler produces in file stm32f10x_vetor.c:

    warning: variable ''__vector_table'' was declared but never referenced.

    2. when linking, the map file does not link the stm32f10x_vector.o and the stm3210x_it.o.

    The .intvec section is mapped to cstartup_M.o ...

    ybenharim10
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    I am using IAR5 IDE.

    16-32micros
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    Hi,

    What is your compiler/Linker ?

    Cheers,

    STOne-32.

    picguy
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    I was unable to create C++ mangled symbols in IAR's assembler. Thus you are forced to use C++ to generate the vector table. Or better, simply make your C++ ISR entry point “C� style. That's what I did in a similar situation.

    16-32micros
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    Hi,

    refer to this link :

    http://www.st.com/mcu/forums-cat-6124-23.html

    This may be helpful. The best is to contact your IAR local support.

    Cheers,

    STOne-32.

    ybenharim10
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:57

    Thanks, it seems that adding the extern ''C'' to the definitions in stm32f10x_vector.c solves the link problem