mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix uploading for atmelsam development platform
This commit is contained in:
@ -22,10 +22,12 @@ Release History
|
|||||||
page in documentation and added to `PlatformIO Web Site <http://platformio.org>`_
|
page in documentation and added to `PlatformIO Web Site <http://platformio.org>`_
|
||||||
(`issue #115 <https://github.com/ivankravets/platformio/issues/115>`_)
|
(`issue #115 <https://github.com/ivankravets/platformio/issues/115>`_)
|
||||||
* Introduced online `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
* Introduced online `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||||
* Automatically append define ``-DPLATFORMIO=%version%`` to builder
|
* Automatically append define ``-DPLATFORMIO=%version%`` to
|
||||||
(`issue #105 <https://github.com/ivankravets/platformio/issues/105>`_)
|
builder (`issue #105 <https://github.com/ivankravets/platformio/issues/105>`_)
|
||||||
* Renamed ``stm32`` development platform to
|
* Renamed ``stm32`` development platform to
|
||||||
`ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__
|
`ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__
|
||||||
|
* Fixed uploading for `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`__
|
||||||
|
development platform
|
||||||
|
|
||||||
1.1.0 (2015-03-05)
|
1.1.0 (2015-03-05)
|
||||||
------------------
|
------------------
|
||||||
@ -54,7 +56,7 @@ Release History
|
|||||||
* Added support for *ARM*-based credit-card sized computers:
|
* Added support for *ARM*-based credit-card sized computers:
|
||||||
`Raspberry Pi <http://www.raspberrypi.org>`_,
|
`Raspberry Pi <http://www.raspberrypi.org>`_,
|
||||||
`BeagleBone <http://beagleboard.org>`_ and `CubieBoard <http://cubieboard.org>`_
|
`BeagleBone <http://beagleboard.org>`_ and `CubieBoard <http://cubieboard.org>`_
|
||||||
* Added `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`_
|
* Added `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`__
|
||||||
development platform with supported boards: *Arduino Due and Digistump DigiX*
|
development platform with supported boards: *Arduino Due and Digistump DigiX*
|
||||||
(`issue #71 <https://github.com/ivankravets/platformio/issues/71>`_)
|
(`issue #71 <https://github.com/ivankravets/platformio/issues/71>`_)
|
||||||
* Added `ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__
|
* Added `ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__
|
||||||
|
@ -676,7 +676,7 @@
|
|||||||
"protocol": "sam-ba",
|
"protocol": "sam-ba",
|
||||||
"require_upload_port" : true,
|
"require_upload_port" : true,
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": false
|
||||||
},
|
},
|
||||||
"url": "http://arduino.cc/en/Main/arduinoBoardDue",
|
"url": "http://arduino.cc/en/Main/arduinoBoardDue",
|
||||||
"vendor": "Arduino"
|
"vendor": "Arduino"
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
"protocol": "sam-ba",
|
"protocol": "sam-ba",
|
||||||
"require_upload_port" : true,
|
"require_upload_port" : true,
|
||||||
"use_1200bps_touch": true,
|
"use_1200bps_touch": true,
|
||||||
"wait_for_upload_port": true
|
"wait_for_upload_port": false
|
||||||
},
|
},
|
||||||
"url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html",
|
"url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html",
|
||||||
"vendor": "SainSmart"
|
"vendor": "SainSmart"
|
||||||
@ -115,4 +115,4 @@
|
|||||||
"url": "http://www.panstamp.com/product/197/",
|
"url": "http://www.panstamp.com/product/197/",
|
||||||
"vendor": "PanStamp"
|
"vendor": "PanStamp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
Builder for Atmel SAM series of microcontrollers
|
Builder for Atmel SAM series of microcontrollers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from os.path import join
|
from os.path import basename, join
|
||||||
|
|
||||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
||||||
DefaultEnvironment, SConscript)
|
DefaultEnvironment, SConscript)
|
||||||
@ -20,8 +20,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
env.Append(
|
env.Append(
|
||||||
UPLOADERFLAGS=[
|
UPLOADERFLAGS=[
|
||||||
"-U",
|
"-U",
|
||||||
"true" if "usb" in board_type.lower(
|
"true" if ("usb" in board_type.lower(
|
||||||
) or board_type == "digix" else "false"
|
) or board_type == "digix") else "false"
|
||||||
])
|
])
|
||||||
|
|
||||||
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
|
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
|
||||||
@ -37,6 +37,10 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
|||||||
if upload_options.get("wait_for_upload_port", False):
|
if upload_options.get("wait_for_upload_port", False):
|
||||||
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
|
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
|
||||||
|
|
||||||
|
# use only port name for BOSSA
|
||||||
|
if "/" in env.subst("$UPLOAD_PORT"):
|
||||||
|
env.Replace(UPLOAD_PORT=basename(env.subst("$UPLOAD_PORT")))
|
||||||
|
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
env = DefaultEnvironment()
|
||||||
|
|
||||||
@ -46,7 +50,6 @@ env.Replace(
|
|||||||
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
|
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
|
||||||
UPLOADERFLAGS=[
|
UPLOADERFLAGS=[
|
||||||
"--info",
|
"--info",
|
||||||
"--debug",
|
|
||||||
"--port", "$UPLOAD_PORT",
|
"--port", "$UPLOAD_PORT",
|
||||||
"--erase",
|
"--erase",
|
||||||
"--write",
|
"--write",
|
||||||
@ -59,7 +62,9 @@ env.Replace(
|
|||||||
|
|
||||||
env.Append(
|
env.Append(
|
||||||
CPPDEFINES=[
|
CPPDEFINES=[
|
||||||
"printf=iprintf"
|
"printf=iprintf",
|
||||||
|
"USBCON",
|
||||||
|
'USB_MANUFACTURER="PlatformIO"'
|
||||||
],
|
],
|
||||||
|
|
||||||
LINKFLAGS=[
|
LINKFLAGS=[
|
||||||
|
@ -97,7 +97,7 @@ if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
|||||||
|
|
||||||
env.VariantDir(
|
env.VariantDir(
|
||||||
join("$BUILD_DIR", "FrameworkArduinoInc"),
|
join("$BUILD_DIR", "FrameworkArduinoInc"),
|
||||||
join("$PLATFORMFW_DIR", "cores", "digix")
|
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||||
)
|
)
|
||||||
env.Append(
|
env.Append(
|
||||||
CPPPATH=[
|
CPPPATH=[
|
||||||
@ -178,14 +178,19 @@ libs.append(envsafe.BuildLibrary(
|
|||||||
))
|
))
|
||||||
|
|
||||||
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||||
|
|
||||||
|
env.Append(
|
||||||
|
LIBPATH=[
|
||||||
|
join("$PLATFORMFW_DIR", "variants",
|
||||||
|
"${BOARD_OPTIONS['build']['variant']}")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
envsafe.Append(
|
envsafe.Append(
|
||||||
CFLAGS=[
|
CFLAGS=[
|
||||||
"-std=gnu99"
|
"-std=gnu99"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
libs.append(envsafe.BuildLibrary(
|
libs.append("sam_sam3x8e_gcc_rel")
|
||||||
join("$BUILD_DIR", "SamLib"),
|
|
||||||
join("$PLATFORMFW_DIR", "system", "libsam", "source")
|
|
||||||
))
|
|
||||||
|
|
||||||
env.Append(LIBS=libs)
|
env.Append(LIBS=libs)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
import platform
|
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from time import sleep
|
from time import sleep
|
||||||
@ -25,9 +24,9 @@ def FlushSerialBuffer(env, port):
|
|||||||
|
|
||||||
def TouchSerialPort(env, port, baudrate):
|
def TouchSerialPort(env, port, baudrate):
|
||||||
s = Serial(port=env.subst(port), baudrate=baudrate)
|
s = Serial(port=env.subst(port), baudrate=baudrate)
|
||||||
|
s.setDTR(False)
|
||||||
s.close()
|
s.close()
|
||||||
if platform.system() != "Darwin":
|
sleep(0.4)
|
||||||
sleep(0.3)
|
|
||||||
|
|
||||||
|
|
||||||
def WaitForNewSerialPort(_, before):
|
def WaitForNewSerialPort(_, before):
|
||||||
|
Reference in New Issue
Block a user