Allow to use ST-Link uploader for mbed-based projects

This commit is contained in:
Ivan Kravets
2015-09-10 16:43:09 +03:00
parent 0405ba3f31
commit 61ef27c345
4 changed files with 23 additions and 71 deletions

View File

@@ -7,6 +7,7 @@ PlatformIO 2.0
2.3.2 (2015-09-??) 2.3.2 (2015-09-??)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
* Allowed to use ST-Link uploader for mbed-based projects
* Fixed `SConsNotInstalled` error for Linux Debian-based distributives * Fixed `SConsNotInstalled` error for Linux Debian-based distributives
2.3.1 (2015-09-06) 2.3.1 (2015-09-06)

View File

@@ -475,39 +475,7 @@ Examples
targets = upload targets = upload
2. :ref:`platform_atmelavr`: Microduino Core (ATmega168P, 3.3V) board with 2. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with
auto pre-configured ``board_*`` and ``upload_*`` options (use only
``board`` option) and Arduino Wiring-based Framework
.. code-block:: ini
[env:atmelavr_microduino_core_board]
platform = atmelavr
framework = arduino
board = 168pa8m
# enable auto-uploading
targets = upload
3. :ref:`platform_atmelavr`: Raspduino board with
auto pre-configured ``board_*`` and ``upload_*`` options (use only
``board`` option) and Arduino Wiring-based Framework
.. code-block:: ini
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyS0
# enable auto-uploading
targets = upload
4. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with
"arduino" bootloader "arduino" bootloader
.. code-block:: ini .. code-block:: ini
@@ -527,7 +495,7 @@ Examples
targets = upload targets = upload
5. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr` 3. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr`
microcontrollers microcontrollers
.. code-block:: ini .. code-block:: ini
@@ -536,44 +504,25 @@ Examples
platform = atmelavr platform = atmelavr
framework = arduino framework = arduino
board = pro8MHzatmega328 board = pro8MHzatmega328
upload_protocol = usbasp -B5 upload_protocol = usbasp - B5
6. :ref:`platform_timsp430`: TI MSP430G2553 LaunchPad with auto pre-configured 4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``,
``board_*`` and ``upload_*`` options (use only ``board`` option) and Energia `issue #175 <https://github.com/platformio/platformio/issues/175>`_
Wiring-based Framework
.. code-block:: ini .. code-block:: ini
[env:timsp430_g2553_launchpad] [env:st_via_gdb]
platform = timsp430 platform = ststm32
framework = energia board = armstrap_eagle512
board = lpmsp430g2553 upload_protocol = gdb
5. :ref:`platform_ststm32`: Upload firmware using ST-Link instead mbed's media
7. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU disk
.. code-block:: ini .. code-block:: ini
[env:timsp430_g2553_board] [env:stlink_for_mbed]
platform = timsp430 platform = ststm32
board_mcu = msp430g2553 board = disco_f100rb
board_f_cpu = 16000000L upload_protocol = stlink
upload_protocol = rf2500
# enable auto-uploading
targets = upload
8. :ref:`platform_titiva`: TI Tiva C ARM Series TM4C123G LaunchPad with auto
pre-configured ``board_*`` and ``upload_*`` options (use only ``board``
option) and Energia Wiring-based Framework
.. code-block:: ini
[env:titiva_tm4c1230c3pm_launchpad]
platform = titiva
framework = energia
board = lptm4c1230c3pm

View File

@@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com> # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details. # See LICENSE for details.
VERSION = (2, 3, "2.dev1") VERSION = (2, 3, "2.dev2")
__version__ = ".".join([str(s) for s in VERSION]) __version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio" __title__ = "platformio"

View File

@@ -15,7 +15,7 @@ env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
if env['UPLOAD_PROTOCOL'] == "gdb": if env.get("UPLOAD_PROTOCOL") == "gdb":
if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")): if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")):
Exit( Exit(
"You are using GDB as firmware uploader. " "You are using GDB as firmware uploader. "
@@ -50,7 +50,8 @@ else:
env.Append( env.Append(
CPPDEFINES=[ CPPDEFINES=[
"${BOARD_OPTIONS['build']['variant'].upper()}" env.get("BOARD_OPTIONS", {}).get(
"build", {}).get("variant", "").upper()
], ],
LIBS=["stdc++", "nosys"], LIBS=["stdc++", "nosys"],
@@ -87,8 +88,9 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file # Target: Upload by default .bin file
# #
disable_msd = (platform.system() == "Darwin" and disable_msd = (
platform.release().startswith("14.")) (platform.system() == "Darwin" and platform.release().startswith("14.")) or
"UPLOAD_PROTOCOL" in env)
if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: if "mbed" in env.subst("$FRAMEWORK") and not disable_msd:
upload = env.Alias(["upload", "uploadlazy"], upload = env.Alias(["upload", "uploadlazy"],
target_firm, env.UploadToDisk) target_firm, env.UploadToDisk)