2
2
# ------------------------------
3
3
#
4
4
# For more info:
5
- # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5--- 3rd-party-Hardware-specification
5
+ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
6
6
7
7
name=Arduino STM32F4 (32-bits ARM Cortex-M4) Boards
8
8
version=1.0.1
@@ -12,13 +12,13 @@ version=1.0.1
12
12
13
13
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
14
14
compiler.c.cmd=arm-none-eabi-gcc
15
- compiler.c.flags=-c -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -D{build.vect} -Dprintf=iprintf -MMD {compiler.libs.c.flags}
15
+ compiler.c.flags=-mthumb - c -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD {compiler.libs.c.flags}
16
16
compiler.c.elf.cmd=arm-none-eabi-gcc
17
- compiler.c.elf.flags=-Os -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align
17
+ compiler.c.elf.flags=-mthumb - Os -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align
18
18
compiler.S.cmd=arm-none-eabi-gcc
19
- compiler.S.flags=-c -x assembler-with-cpp {compiler.libs.c.flags}
19
+ compiler.S.flags=-mthumb - c -x assembler-with-cpp {compiler.libs.c.flags}
20
20
compiler.cpp.cmd=arm-none-eabi-g++
21
- compiler.cpp.flags=-c -Os {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -D{build.vect} -Dprintf=iprintf -MMD {compiler.libs.c.flags}
21
+ compiler.cpp.flags=-mthumb - c -Os {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD {compiler.libs.c.flags}
22
22
23
23
compiler.ar.cmd=arm-none-eabi-ar
24
24
compiler.ar.flags=rcs
@@ -36,40 +36,53 @@ build.cpu_flags=
36
36
build.hs_flag=
37
37
build.common_flags=
38
38
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}
39
+ build.ldscript=ldscript.ld
39
40
40
41
# These can be overridden in platform.local.txt
41
42
compiler.c.extra_flags=
42
- compiler.c.elf.extra_flags="-L{build.variant.path}/link-tools"
43
+ compiler.c.elf.extra_flags=
43
44
compiler.cpp.extra_flags=
44
45
compiler.S.extra_flags=
45
46
compiler.ar.extra_flags=
46
47
compiler.elf2hex.extra_flags=
47
48
48
- compiler.libs.c.flags="-I{build.system.path}/libstm32f4" "-I{build.system.path}/libstm32f4/include" "-I{build.system.path}/Drivers/STM32F4xx_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/STM32F4xx/Include" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.variant.path}/usb" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/" "-I{build.system.path}/Drivers/BSP/Components" "-I{build.system.path}/Middlewares/Third_Party/FatFs/src"
49
+ compiler.libs.c.flags="-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src/" "-I{build.system.path}/{build.series}/" "-I{build.variant.path}/usb" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src"
50
+
51
+ compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/"
52
+ compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -l{build.cmsis_lib_gcc}
49
53
50
54
compiler.warning_flags=-w
51
55
compiler.warning_flags.none=-w
52
56
compiler.warning_flags.default=
53
57
compiler.warning_flags.more=-Wall
54
58
compiler.warning_flags.all=-Wall -Wextra
55
59
60
+ #
61
+ # USB Flags
62
+ # ---------
63
+ build.usb_flags=-DUSBD_VID={build.vid} -DUSBD_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
64
+
65
+ # Default usb manufacturer will be replaced at compile time using
66
+ # numeric vendor ID if available or by board's specific value.
67
+ build.usb_manufacturer="Unknown"
68
+
56
69
# STM32 compile patterns
57
70
# -----------------------
58
71
59
72
## Compile c files
60
- recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.libs .c.flags} {includes} "{source_file}" -o "{object_file}"
73
+ recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{build.series} - DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.arm.cmsis .c.flags} {includes} "{source_file}" -o "{object_file}"
61
74
62
75
## Compile c++ files
63
- recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} { compiler.libs .c.flags} {includes} "{source_file}" -o "{object_file}"
76
+ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{build.series} - DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.arm.cmsis .c.flags} {includes} "{source_file}" -o "{object_file}"
64
77
65
78
## Compile S files
66
- recipe.S.o.pattern="{compiler.path}{compiler.c .cmd}" {compiler.S.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} { compiler.libs .c.flags} {includes} "{source_file}" -o "{object_file}"
79
+ recipe.S.o.pattern="{compiler.path}{compiler.S .cmd}" {compiler.S.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{build.series} - DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {compiler.arm.cmsis .c.flags} {includes} "{source_file}" -o "{object_file}"
67
80
68
81
## Create archives
69
82
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
70
83
71
84
## Combine gc-sections, archives, and objects
72
- recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb - Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,-- start-group {object_files} -Wl,--whole-archive "{build.variant. path}/{build.variant_system_lib }" -Wl,--no-whole-archive "{build.path}/{archive_file}" -Wl,--end-group -lm -lgcc
85
+ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} {compiler.arm.cmsis.ldflags} -Wl,--whole-archive "{build.path}/{archive_file }" -Wl,--no-whole-archive -lc -Wl,--end-group -lm -lgcc --specs=nano.specs
73
86
74
87
## Create eeprom
75
88
recipe.objcopy.eep.pattern=
@@ -85,18 +98,6 @@ recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build
85
98
recipe.size.regex=^(?:\.text|\.rodata|\.ARM.exidx)\s+([0-9]+).*
86
99
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
87
100
88
- #
89
- # DFU Util
90
- # --------
91
-
92
- #tools.dfu-util.path={runtime.tools.dfu-util-0.9.0-arduino1.path}
93
- #tools.dfu-util.cmd=dfu-util
94
- #tools.dfu-util.cmd.windows=dfu-util.cmd
95
-
96
- #tools.dfu-util.upload.params.verbose=-v
97
- #tools.dfu-util.upload.params.quiet=
98
- #tools.dfu-util.upload.pattern="{path}/{cmd}" "{path}" {upload.usbID} {upload.altID} {upload.mem_start} "{build.path}/{build.project_name}.bin" "{serial.port}"
99
-
100
101
#
101
102
# arduinoSTM32load
102
103
# ----------------
@@ -108,11 +109,13 @@ tools.arduinoSTM32load.upload.pattern="{path}/{cmd}" -dfu "{runtime.tools.dfu-ut
108
109
109
110
tools.arduinoSTM32load.upload.network_pattern="{runtime.tools.wifilink_mcuota-1.0.0.path}/wifilink_mcuota" -f "{build.path}/{build.project_name}.hex" -i "{serial.port}"
110
111
111
-
112
- #
113
- # USB Flags
114
- # ---------
115
-
116
- # Default usb manufacturer will be replaced at compile time using
117
- # numeric vendor ID if available or by board's specific value.
118
- build.usb_manufacturer="Unknown"
112
+ # stlink upload
113
+ tools.stlink_upload.cmd=stlink_upload
114
+ tools.stlink_upload.cmd.windows=stlink_upload.bat
115
+ tools.stlink_upload.path.windows={runtime.hardware.path}/tools/win
116
+ tools.stlink_upload.path.macosx={runtime.hardware.path}/tools/macosx
117
+ tools.stlink_upload.path.linux={runtime.hardware.path}/tools/linux
118
+ tools.stlink_upload.path.linux64={runtime.hardware.path}/tools/linux64
119
+ tools.stlink_upload.upload.params.verbose=-d
120
+ tools.stlink_upload.upload.params.quiet=
121
+ tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
0 commit comments