Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit e4c55cd

Browse files
committed
Update boards.txt and platform.txt
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 28fff3d commit e4c55cd

File tree

2 files changed

+51
-37
lines changed

2 files changed

+51
-37
lines changed

boards.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
menu.upload_method=Upload method
3+
24
##############################################################
35
star_otto.name=Arduino Star OTTO
46

@@ -10,7 +12,7 @@ star_otto.upload.protocol=dfuse
1012

1113
star_otto.upload.use_1200bps_touch=true
1214
star_otto.upload.file_type=bin
13-
star_otto.upload.ram.maximum_size=323584
15+
star_otto.upload.ram.maximum_size=262144
1416
star_otto.upload.flash.maximum_size=2097152
1517
star_otto.upload.maximum_size=2097152
1618
star_otto.upload.mem_start=0x08000000
@@ -21,13 +23,22 @@ star_otto.upload.altID=0
2123
star_otto.build.mcu=cortex-m4
2224
star_otto.build.board=STM32_STAR_OTTO
2325
star_otto.build.f_cpu=180000000L
26+
star_otto.build.vid=0x2A03
27+
star_otto.build.pid=0x0058
2428
star_otto.build.core=arduino
2529
star_otto.build.esp_ch_uart_br=460800
26-
star_otto.build.extra_flags=-DSTM32F469xx -DMCU_STM32F469NI -mthumb -DSTM32_HIGH_DENSITY -DESP_CH_UART -DESP_CH_UART_BR={build.esp_ch_uart_br}
27-
star_otto.build.ldscript=link-tools/jtag.ld
30+
star_otto.build.series=STM32F4xx
2831
star_otto.build.variant=otto
29-
star_otto.build.variant_system_lib=libstm32f4_otto_gcc_rel.a
30-
star_otto.build.vect=VECT_TAB_BASE
31-
star_otto.build.density=STM32_HIGH_DENSITY
32+
star_otto.build.cmsis_lib_gcc=arm_cortexM4l_math
33+
#To enable USB add '-DUSBCON'
34+
#To enable CDC add also '-DUSBD_USE_CDC'
35+
star_otto.build.extra_flags=-DSTM32F469xx -DUSE_USB_FS -DUSBCON -DUSBD_USE_CDC {build.usb_flags} -DESP_CH_UART -DESP_CH_UART_BR={build.esp_ch_uart_br}
36+
37+
star_otto.menu.upload_method.dfuMethod=arduinoSTM32load
38+
star_otto.menu.upload_method.dfuMethod.upload.protocol=dfuse
39+
star_otto.menu.upload_method.dfuMethod.upload.tool=arduinoSTM32load
3240

41+
star_otto.menu.upload_method.STLinkMethod=STLink
42+
star_otto.menu.upload_method.STLinkMethod.upload.protocol=STLink
43+
star_otto.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
3344
##############################################################

platform.txt

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# ------------------------------
33
#
44
# 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
66

77
name=Arduino STM32F4 (32-bits ARM Cortex-M4) Boards
88
version=1.0.1
@@ -12,13 +12,13 @@ version=1.0.1
1212

1313
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
1414
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}
1616
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
1818
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}
2020
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}
2222

2323
compiler.ar.cmd=arm-none-eabi-ar
2424
compiler.ar.flags=rcs
@@ -36,40 +36,53 @@ build.cpu_flags=
3636
build.hs_flag=
3737
build.common_flags=
3838
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}
39+
build.ldscript=ldscript.ld
3940

4041
# These can be overridden in platform.local.txt
4142
compiler.c.extra_flags=
42-
compiler.c.elf.extra_flags="-L{build.variant.path}/link-tools"
43+
compiler.c.elf.extra_flags=
4344
compiler.cpp.extra_flags=
4445
compiler.S.extra_flags=
4546
compiler.ar.extra_flags=
4647
compiler.elf2hex.extra_flags=
4748

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}
4953

5054
compiler.warning_flags=-w
5155
compiler.warning_flags.none=-w
5256
compiler.warning_flags.default=
5357
compiler.warning_flags.more=-Wall
5458
compiler.warning_flags.all=-Wall -Wextra
5559

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+
5669
# STM32 compile patterns
5770
# -----------------------
5871

5972
## 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}"
6174

6275
## 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}"
6477

6578
## 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}"
6780

6881
## Create archives
6982
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
7083

7184
## 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
7386

7487
## Create eeprom
7588
recipe.objcopy.eep.pattern=
@@ -85,18 +98,6 @@ recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build
8598
recipe.size.regex=^(?:\.text|\.rodata|\.ARM.exidx)\s+([0-9]+).*
8699
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
87100

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-
100101
#
101102
# arduinoSTM32load
102103
# ----------------
@@ -108,11 +109,13 @@ tools.arduinoSTM32load.upload.pattern="{path}/{cmd}" -dfu "{runtime.tools.dfu-ut
108109

109110
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}"
110111

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

Comments
 (0)