Skip to content

Commit

Permalink
Merge branch 'release/v4.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Mar 2, 2018
2 parents f66dd09 + 5702141 commit ac05bf5
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 44 deletions.
3 changes: 2 additions & 1 deletion boards/bluepill_f103c8.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"jlink",
"stlink",
"blackmagic",
"mbed"
"mbed",
"dfu"
]
},
"url": "http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f1-series/stm32f103/stm32f103c8.html",
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103C8.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103CB.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103R8.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103RB.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103RC.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103RE.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103VC.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
3 changes: 2 additions & 1 deletion boards/genericSTM32F103VE.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jlink",
"stlink",
"blackmagic",
"serial"
"serial",
"dfu"
],
"require_upload_port": true,
"use_1200bps_touch": false,
Expand Down
46 changes: 21 additions & 25 deletions builder/frameworks/arduino/maple/stm32f1.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
assert isdir(FRAMEWORK_DIR)

# default configuration values
vector = 0x8000000
vector = int(board.get("build.vec_tab_addr", "0x8000000"), 16)
error_led_port = "GPIOB"
error_led_pin = 1

Expand Down Expand Up @@ -66,38 +66,32 @@
"GENERIC_BOOTLOADER"
])

if "generic" in board.id:
if upload_protocol == "dfu":
vector = 0x8002000
env.Append(CPPDEFINES=["SERIAL_USB", "GENERIC_BOOTLOADER"])

if "f103c" in mcu_type:
ldscript = "bootloader_20.ld"
elif "f103r" in mcu_type:
ldscript = "bootloader.ld"
elif "f103v" in mcu_type:
ldscript = "stm32f103veDFU.ld"

elif board.get("build.vec_tab_addr", ""):
vector = int(board.get("build.vec_tab_addr"), 16)

# maple board related configuration remap
elif "maple" in board.id:
if "maple" in board.id:
env.Append(CPPDEFINES=[("SERIAL_USB")])
variant = "maple_mini" if "maple_mini" in board.id else "maple"
vector = 0x8002000
ldscript = "bootloader_20"

if "maple_mini_origin" in board.id or "maple" in board.id:
vector = 0x8005000
ldscript = "flash.ld"
vector = 0x8005000
ldscript = "flash.ld"
if board.id == "maple_mini_b20":
vector = 0x8002000
ldscript = "bootloader_20"

# for nucleo f103rb board
elif "nucleo_f103rb" in board.id:
variant = "nucleo_f103rb"
ldscript = "jtag.ld"
env.Append(CPPDEFINES=["NUCLEO_HSE_CRYSTAL"])

elif upload_protocol == "dfu":
env.Append(CPPDEFINES=["SERIAL_USB", "GENERIC_BOOTLOADER"])
vector = 0x8002000
if "f103c" in mcu_type:
ldscript = "bootloader_20.ld"
elif "f103r" in mcu_type:
ldscript = "bootloader.ld"
elif "f103v" in mcu_type:
ldscript = "stm32f103veDFU.ld"


env.Append(
CFLAGS=["-std=gnu11"],
Expand Down Expand Up @@ -132,7 +126,9 @@
join(FRAMEWORK_DIR, "system", "libmaple", "usb", "usb_lib")
],

LIBPATH=[join(FRAMEWORK_DIR, "variants", variant, "ld")]
LIBPATH=[join(FRAMEWORK_DIR, "variants", variant, "ld")],

LIBS=["c"]
)

# remap ldscript
Expand All @@ -144,7 +140,7 @@
env['LINKFLAGS'].remove(item)

# remove unused libraries
for item in ("c", "stdc++", "nosys"):
for item in ("stdc++", "nosys"):
if item in env['LIBS']:
env['LIBS'].remove(item)

Expand Down
2 changes: 1 addition & 1 deletion platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-ststm32.git"
},
"version": "4.0.1",
"version": "4.0.2",
"packageRepositories": [
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http://dl.platformio.org/packages/manifest.json"
Expand Down
15 changes: 6 additions & 9 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def configure_default_packages(self, variables, targets):
'package'] = "framework-arduinostm32mxchip"
self.frameworks['arduino'][
'script'] = "builder/frameworks/arduino/mxchip.py"

self.packages['tool-openocd']['type'] = "uploader"

self.packages['toolchain-gccarmnoneeabi']['version'] = "~1.60301.0"

return PlatformBase.configure_default_packages(self, variables,
Expand Down Expand Up @@ -73,14 +70,14 @@ def _add_default_debug_tools(self, board):
assert debug.get("openocd_target"), (
"Missed target configuration for %s" % board.id)

server_args = ["-f", "scripts/interface/%s.cfg" % link]
if link == "stlink":
server_args.extend(["-c", "transport select hla_swd"])

server_args.extend([
server_args = [
"-f",
"scripts/interface/%s.cfg" % link, "-c",
"transport select %s" % ("hla_swd"
if link == "stlink" else "swd"),
"-f",
"scripts/target/%s.cfg" % debug.get("openocd_target")
])
]

debug['tools'][link] = {
"server": {
Expand Down

0 comments on commit ac05bf5

Please sign in to comment.