1

they seems like startup and standard files of stm32 ,but i can not find them in "GCC offical refeence PDF" .

why can they be used directly

this is the flags of arm-none-eabi-gcc in makefile:

# specify compiler flags
CFLAGS  = -g -O2 -Wall
CFLAGS += -T$(STD_PERIPH_LIBS)/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210B-EVAL/stm32_flash.ld
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
CFLAGS += -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER
CFLAGS += -Wl,--gc-sections
CFLAGS += -I.
CFLAGS += -I$(STD_PERIPH_LIBS)/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/
CFLAGS += -I$(STD_PERIPH_LIBS)/Libraries/CMSIS/CM3/CoreSupport
CFLAGS += -I$(STD_PERIPH_LIBS)/Libraries/STM32F10x_StdPeriph_Driver/inc
CHIPPY
  • 97
  • 1
  • 7

3 Answers3

0

it's library specific flags (in this case STM32F10x Standard Peripherals Library)

documentation link

or look for official documentation

Jonas Kibildis
  • 151
  • 1
  • 7
0

-D is a preprocessor flag passed to GCC to define something before compilation. It can be used to enable certain functions of libraries or even debugging.

STM32F10X_MD and USE_STDPERIPH_DRIVER enable parts of the included library. It being the STM32F10 part of the library for medium density devices and enabling the usage of standard peripheral library.

Please note that the SPL isn't supported anymore and that you should upgrade to the HAL or HAL LL.

Tarick Welling
  • 3,119
  • 3
  • 19
  • 44
0

-Dsomething is the same as #define something in the source code.

0___________
  • 60,014
  • 4
  • 34
  • 74