mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Fix firmware uploading for "nordicrf51" development platform // Resolve #316
This commit is contained in:
@ -18,7 +18,9 @@ PlatformIO 2.0
|
|||||||
* 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>`_)
|
||||||
|
* Fixed firmware uploading for `nordicrf51 <http://docs.platformio.org/en/latest/platforms/nordicnrf51.html>`__
|
||||||
|
development platform
|
||||||
|
(`issue #316 <https://github.com/platformio/platformio/issues/316>`_)
|
||||||
|
|
||||||
2.3.4 (2015-10-13)
|
2.3.4 (2015-10-13)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -25,9 +25,9 @@ target_elf = env.BuildProgram()
|
|||||||
#
|
#
|
||||||
|
|
||||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
target_firm = join("$BUILD_DIR", "firmware.hex")
|
||||||
else:
|
else:
|
||||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Target: Print binary size
|
# Target: Print binary size
|
||||||
|
@ -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.
|
||||||
|
|
||||||
from os.path import join
|
from os.path import join, isfile
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
@ -95,8 +95,11 @@ def AutodetectUploadPort(env):
|
|||||||
|
|
||||||
def UploadToDisk(_, target, source, env): # pylint: disable=W0613,W0621
|
def UploadToDisk(_, target, source, env): # pylint: disable=W0613,W0621
|
||||||
env.AutodetectUploadPort()
|
env.AutodetectUploadPort()
|
||||||
copyfile(join(env.subst("$BUILD_DIR"), "firmware.bin"),
|
for ext in ("bin", "hex"):
|
||||||
join(env.subst("$UPLOAD_PORT"), "firmware.bin"))
|
fpath = join(env.subst("$BUILD_DIR"), "firmware.%s" % ext)
|
||||||
|
if not isfile(fpath):
|
||||||
|
continue
|
||||||
|
copyfile(fpath, join(env.subst("$UPLOAD_PORT"), "firmware.%s" % ext))
|
||||||
print ("Firmware has been successfully uploaded.\n"
|
print ("Firmware has been successfully uploaded.\n"
|
||||||
"Please restart your board.")
|
"Please restart your board.")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user