mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47: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>`_
|
||||
(`issue #115 <https://github.com/ivankravets/platformio/issues/115>`_)
|
||||
* Introduced online `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* Automatically append define ``-DPLATFORMIO=%version%`` to builder
|
||||
(`issue #105 <https://github.com/ivankravets/platformio/issues/105>`_)
|
||||
* Automatically append define ``-DPLATFORMIO=%version%`` to
|
||||
builder (`issue #105 <https://github.com/ivankravets/platformio/issues/105>`_)
|
||||
* Renamed ``stm32`` development platform to
|
||||
`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)
|
||||
------------------
|
||||
@ -54,7 +56,7 @@ Release History
|
||||
* Added support for *ARM*-based credit-card sized computers:
|
||||
`Raspberry Pi <http://www.raspberrypi.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*
|
||||
(`issue #71 <https://github.com/ivankravets/platformio/issues/71>`_)
|
||||
* Added `ststm32 <http://docs.platformio.org/en/latest/platforms/ststm32.html>`__
|
||||
|
@ -676,7 +676,7 @@
|
||||
"protocol": "sam-ba",
|
||||
"require_upload_port" : true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
"wait_for_upload_port": false
|
||||
},
|
||||
"url": "http://arduino.cc/en/Main/arduinoBoardDue",
|
||||
"vendor": "Arduino"
|
||||
|
@ -43,7 +43,7 @@
|
||||
"protocol": "sam-ba",
|
||||
"require_upload_port" : 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",
|
||||
"vendor": "SainSmart"
|
||||
@ -115,4 +115,4 @@
|
||||
"url": "http://www.panstamp.com/product/197/",
|
||||
"vendor": "PanStamp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
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,
|
||||
DefaultEnvironment, SConscript)
|
||||
@ -20,8 +20,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
||||
env.Append(
|
||||
UPLOADERFLAGS=[
|
||||
"-U",
|
||||
"true" if "usb" in board_type.lower(
|
||||
) or board_type == "digix" else "false"
|
||||
"true" if ("usb" in board_type.lower(
|
||||
) or board_type == "digix") else "false"
|
||||
])
|
||||
|
||||
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):
|
||||
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()
|
||||
|
||||
@ -46,7 +50,6 @@ env.Replace(
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
|
||||
UPLOADERFLAGS=[
|
||||
"--info",
|
||||
"--debug",
|
||||
"--port", "$UPLOAD_PORT",
|
||||
"--erase",
|
||||
"--write",
|
||||
@ -59,7 +62,9 @@ env.Replace(
|
||||
|
||||
env.Append(
|
||||
CPPDEFINES=[
|
||||
"printf=iprintf"
|
||||
"printf=iprintf",
|
||||
"USBCON",
|
||||
'USB_MANUFACTURER="PlatformIO"'
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
|
@ -97,7 +97,7 @@ if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||
|
||||
env.VariantDir(
|
||||
join("$BUILD_DIR", "FrameworkArduinoInc"),
|
||||
join("$PLATFORMFW_DIR", "cores", "digix")
|
||||
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||
)
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
@ -178,14 +178,19 @@ libs.append(envsafe.BuildLibrary(
|
||||
))
|
||||
|
||||
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||
|
||||
env.Append(
|
||||
LIBPATH=[
|
||||
join("$PLATFORMFW_DIR", "variants",
|
||||
"${BOARD_OPTIONS['build']['variant']}")
|
||||
]
|
||||
)
|
||||
|
||||
envsafe.Append(
|
||||
CFLAGS=[
|
||||
"-std=gnu99"
|
||||
]
|
||||
)
|
||||
libs.append(envsafe.BuildLibrary(
|
||||
join("$BUILD_DIR", "SamLib"),
|
||||
join("$PLATFORMFW_DIR", "system", "libsam", "source")
|
||||
))
|
||||
libs.append("sam_sam3x8e_gcc_rel")
|
||||
|
||||
env.Append(LIBS=libs)
|
||||
|
@ -1,7 +1,6 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import platform
|
||||
from os.path import join
|
||||
from shutil import copyfile
|
||||
from time import sleep
|
||||
@ -25,9 +24,9 @@ def FlushSerialBuffer(env, port):
|
||||
|
||||
def TouchSerialPort(env, port, baudrate):
|
||||
s = Serial(port=env.subst(port), baudrate=baudrate)
|
||||
s.setDTR(False)
|
||||
s.close()
|
||||
if platform.system() != "Darwin":
|
||||
sleep(0.3)
|
||||
sleep(0.4)
|
||||
|
||||
|
||||
def WaitForNewSerialPort(_, before):
|
||||
|
Reference in New Issue
Block a user