mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Upload firmware using external programmer via "platformio run –target program" // Resolve #311
This commit is contained in:
@ -12,6 +12,9 @@ PlatformIO 2.0
|
|||||||
(`issue #309 <https://github.com/platformio/platformio/issues/309>`_)
|
(`issue #309 <https://github.com/platformio/platformio/issues/309>`_)
|
||||||
* Added support for Espressif ESP8266 ESP-12E board (NodeMCU)
|
* Added support for Espressif ESP8266 ESP-12E board (NodeMCU)
|
||||||
(`issue #310 <https://github.com/platformio/platformio/issues/310>`_)
|
(`issue #310 <https://github.com/platformio/platformio/issues/310>`_)
|
||||||
|
* Upload firmware using external programmer via `platformio run --target program <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption-platformio-run-t>`__
|
||||||
|
target
|
||||||
|
(`issue #311 <https://github.com/platformio/platformio/issues/311>`_)
|
||||||
* Fixed handling of upload port when ``board`` option is not specified in
|
* Fixed handling of upload port when ``board`` option is not specified in
|
||||||
`platformio.ini <http://docs.platformio.org/en/latest/projectconf.html>`__
|
`platformio.ini <http://docs.platformio.org/en/latest/projectconf.html>`__
|
||||||
(`issue #313 <https://github.com/platformio/platformio/issues/313>`_)
|
(`issue #313 <https://github.com/platformio/platformio/issues/313>`_)
|
||||||
|
@ -504,7 +504,9 @@ Examples
|
|||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = pro8MHzatmega328
|
board = pro8MHzatmega328
|
||||||
upload_protocol = usbasp - B5
|
upload_protocol = usbasp -B5
|
||||||
|
|
||||||
|
Then upload firmware using :option:`platformio run --target program`
|
||||||
|
|
||||||
|
|
||||||
4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``,
|
4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``,
|
||||||
|
@ -38,8 +38,9 @@ Process specified targets.
|
|||||||
Pre-built targets:
|
Pre-built targets:
|
||||||
|
|
||||||
* ``clean`` delete compiled object files, libraries and firmware/program binaries
|
* ``clean`` delete compiled object files, libraries and firmware/program binaries
|
||||||
* ``upload`` enable "auto-uploading" for embedded platforms after building
|
* ``upload`` firmware "auto-uploading" for embedded platforms
|
||||||
operation
|
* ``program`` firmware "auto-uploading" for embedded platforms using external
|
||||||
|
programmer (available only for :ref:`platform_atmelavr`)
|
||||||
* ``uploadlazy`` upload existing firmware without project rebuilding
|
* ``uploadlazy`` upload existing firmware without project rebuilding
|
||||||
* ``envdump`` dump current build environment
|
* ``envdump`` dump current build environment
|
||||||
* ``size`` print the size of the sections in a firmware/program
|
* ``size`` print the size of the sections in a firmware/program
|
||||||
|
@ -26,10 +26,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
env.Replace(UPLOAD_SPEED=None)
|
env.Replace(UPLOAD_SPEED=None)
|
||||||
|
|
||||||
if env.subst("$UPLOAD_SPEED"):
|
if env.subst("$UPLOAD_SPEED"):
|
||||||
env.Append(UPLOADERFLAGS=[
|
env.Append(UPLOADERFLAGS=["-b", "$UPLOAD_SPEED"])
|
||||||
"-b", "$UPLOAD_SPEED",
|
|
||||||
"-D"
|
|
||||||
])
|
|
||||||
|
|
||||||
if upload_options and not upload_options.get("require_upload_port", False):
|
if upload_options and not upload_options.get("require_upload_port", False):
|
||||||
return
|
return
|
||||||
@ -87,9 +84,9 @@ else:
|
|||||||
'"%s"' % join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude.conf"),
|
'"%s"' % join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude.conf"),
|
||||||
"-c", "$UPLOAD_PROTOCOL"
|
"-c", "$UPLOAD_PROTOCOL"
|
||||||
],
|
],
|
||||||
|
UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS -D -U flash:w:$SOURCES:i',
|
||||||
UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i',
|
UPLOADEEPCMD='"$UPLOADER" $UPLOADERFLAGS -U eeprom:w:$SOURCES:i',
|
||||||
UPLOADEEPCMD='"$UPLOADER" $UPLOADERFLAGS -U eeprom:w:$SOURCES:i'
|
PROGRAMHEXCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i'
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -133,10 +130,16 @@ AlwaysBuild(upload)
|
|||||||
# Target: Upload .eep file
|
# Target: Upload .eep file
|
||||||
#
|
#
|
||||||
|
|
||||||
uploadeep = env.Alias("uploadeep", target_eep, [
|
uploadeep = env.Alias("uploadeep", target_eep, [BeforeUpload, "$UPLOADEEPCMD"])
|
||||||
BeforeUpload, "$UPLOADEEPCMD"])
|
|
||||||
AlwaysBuild(uploadeep)
|
AlwaysBuild(uploadeep)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Target: Upload firmware using external programmer
|
||||||
|
#
|
||||||
|
|
||||||
|
program = env.Alias("program", target_firm, [BeforeUpload, "$PROGRAMHEXCMD"])
|
||||||
|
AlwaysBuild(program)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup default targets
|
# Setup default targets
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user