forked from platformio/platformio-core
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>`_)
|
||||
* Added support for Espressif ESP8266 ESP-12E board (NodeMCU)
|
||||
(`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
|
||||
`platformio.ini <http://docs.platformio.org/en/latest/projectconf.html>`__
|
||||
(`issue #313 <https://github.com/platformio/platformio/issues/313>`_)
|
||||
|
@ -504,7 +504,9 @@ Examples
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
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``,
|
||||
|
@ -38,8 +38,9 @@ Process specified targets.
|
||||
Pre-built targets:
|
||||
|
||||
* ``clean`` delete compiled object files, libraries and firmware/program binaries
|
||||
* ``upload`` enable "auto-uploading" for embedded platforms after building
|
||||
operation
|
||||
* ``upload`` firmware "auto-uploading" for embedded platforms
|
||||
* ``program`` firmware "auto-uploading" for embedded platforms using external
|
||||
programmer (available only for :ref:`platform_atmelavr`)
|
||||
* ``uploadlazy`` upload existing firmware without project rebuilding
|
||||
* ``envdump`` dump current build environment
|
||||
* ``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)
|
||||
|
||||
if env.subst("$UPLOAD_SPEED"):
|
||||
env.Append(UPLOADERFLAGS=[
|
||||
"-b", "$UPLOAD_SPEED",
|
||||
"-D"
|
||||
])
|
||||
env.Append(UPLOADERFLAGS=["-b", "$UPLOAD_SPEED"])
|
||||
|
||||
if upload_options and not upload_options.get("require_upload_port", False):
|
||||
return
|
||||
@ -87,9 +84,9 @@ else:
|
||||
'"%s"' % join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude.conf"),
|
||||
"-c", "$UPLOAD_PROTOCOL"
|
||||
],
|
||||
|
||||
UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i',
|
||||
UPLOADEEPCMD='"$UPLOADER" $UPLOADERFLAGS -U eeprom:w:$SOURCES:i'
|
||||
UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS -D -U flash: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
|
||||
#
|
||||
|
||||
uploadeep = env.Alias("uploadeep", target_eep, [
|
||||
BeforeUpload, "$UPLOADEEPCMD"])
|
||||
uploadeep = env.Alias("uploadeep", target_eep, [BeforeUpload, "$UPLOADEEPCMD"])
|
||||
AlwaysBuild(uploadeep)
|
||||
|
||||
#
|
||||
# Target: Upload firmware using external programmer
|
||||
#
|
||||
|
||||
program = env.Alias("program", target_firm, [BeforeUpload, "$PROGRAMHEXCMD"])
|
||||
AlwaysBuild(program)
|
||||
|
||||
#
|
||||
# Setup default targets
|
||||
#
|
||||
|
Reference in New Issue
Block a user