Skip to main content
cyril2399
Associate III
May 27, 2011
Question

error in stm32f10x

  • May 27, 2011
  • 5 replies
  • 2685 views
Posted on May 27, 2011 at 15:53

hello,

I have this error:

'' #error ''Please select first the target STM32F10x device used in your application (in stm32f10x.h file)''

and in the file I don't know what I must do...

I have put in attached file the stm32f10x.h.

thanks to all
    This topic has been closed for replies.

    5 replies

    sami
    Associate III
    May 27, 2011
    Posted on May 27, 2011 at 21:23

    Which compiler do you use ?

    however; you need to choose the target device from your compiler too.

    lowpowermcu
    Associate III
    May 29, 2011
    Posted on May 29, 2011 at 13:37

    Hi,

    As it is mentioned, you should check your device:

    - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Low-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. - Medium-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. - High-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. - High-density value line devices are STM32F100xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 512 and 1024 Kbytes. - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.

    Tesla DeLorean
    Guru
    May 29, 2011
    Posted on May 29, 2011 at 14:38

    Well no idea about your part or toolchain from your question, but I'll suspect you have failed to define the part family passed to the compiler.

    To specify a Medium Density part (for example), and to use the standard peripheral library, you'd typically have the IDE/makefile pass some #defines on the compiler command line.

    -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER

    I might go further and assume you don't have the scatter file or linker script set up correctly for your part either, which you will need to convey to the linker the size/location of the memory (FLASH/RAM).

    You'll have to work this out for the specific part and tool chain you have chosen.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    cyril2399
    cyril2399Author
    Associate III
    May 30, 2011
    Posted on May 30, 2011 at 10:21

    I have a stm32f107 and I'm programing on IAR embedded workbench.

    vikas_sinha75
    Visitor II
    July 6, 2011
    Posted on July 06, 2011 at 10:10

    Hi,

    Choose ''ST STM32F10xxC'' under General option -> Target -> Device. It will make adjustments accordingly.