mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Initial support for Arduino M0/Tian boards // Issue #472
This commit is contained in:
@@ -986,5 +986,71 @@
|
|||||||
},
|
},
|
||||||
"url": "http://www.arduino.org/products/boards/arduino-m0-pro",
|
"url": "http://www.arduino.org/products/boards/arduino-m0-pro",
|
||||||
"vendor": "Arduino"
|
"vendor": "Arduino"
|
||||||
|
},
|
||||||
|
"mzeroUSB": {
|
||||||
|
"build": {
|
||||||
|
"core": "arduino_zero",
|
||||||
|
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
|
||||||
|
"f_cpu": "48000000L",
|
||||||
|
"mcu": "samd21g18a",
|
||||||
|
"cpu": "cortex-m0plus",
|
||||||
|
"usb_product": "Arduino M0/Pro",
|
||||||
|
"variant": "arduino_zero",
|
||||||
|
"ldscript": "samd21g18a_bootloader_org.ld",
|
||||||
|
"hwids": [
|
||||||
|
["0x2A03", "0x004D"],
|
||||||
|
["0x2A03", "0x804D"],
|
||||||
|
["0x2A03", "0x004F"],
|
||||||
|
["0x2A03", "0x804F"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "Arduino M0 Pro (Native USB Port)",
|
||||||
|
"platform": "atmelsam",
|
||||||
|
"upload": {
|
||||||
|
"disable_flushing": true,
|
||||||
|
"maximum_ram_size": 32768,
|
||||||
|
"maximum_size": 262144,
|
||||||
|
"protocol": "stk500v2",
|
||||||
|
"require_upload_port" : true,
|
||||||
|
"speed": 57600,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"section_start": "0x4000"
|
||||||
|
},
|
||||||
|
"url": "http://www.arduino.org/products/boards/arduino-m0-pro",
|
||||||
|
"vendor": "Arduino"
|
||||||
|
},
|
||||||
|
"tian": {
|
||||||
|
"build": {
|
||||||
|
"core": "arduino_zero",
|
||||||
|
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
|
||||||
|
"f_cpu": "48000000L",
|
||||||
|
"mcu": "samd21g18a",
|
||||||
|
"cpu": "cortex-m0plus",
|
||||||
|
"usb_product": "Arduino Tian",
|
||||||
|
"variant": "arduino_zero",
|
||||||
|
"ldscript": "samd21g18a_bootloader_org.ld",
|
||||||
|
"hwids": [
|
||||||
|
["0x10C4", "0xEA70"],
|
||||||
|
["0x2A03", "0x8052"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "Arduino Tian",
|
||||||
|
"platform": "atmelsam",
|
||||||
|
"upload": {
|
||||||
|
"disable_flushing": true,
|
||||||
|
"maximum_ram_size": 32768,
|
||||||
|
"maximum_size": 262144,
|
||||||
|
"protocol": "stk500v2",
|
||||||
|
"require_upload_port" : true,
|
||||||
|
"speed": 57600,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"section_start": "0x4000"
|
||||||
|
},
|
||||||
|
"url": "http://www.arduino.org/products/boards/arduino-tian",
|
||||||
|
"vendor": "Arduino"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
from os.path import basename, join
|
from os.path import basename, join
|
||||||
|
|
||||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
|
||||||
DefaultEnvironment, SConscript)
|
DefaultEnvironment, SConscript)
|
||||||
|
|
||||||
from platformio.util import get_serialports
|
from platformio.util import get_serialports
|
||||||
@@ -173,6 +173,38 @@ elif upload_protocol == "sam-ba":
|
|||||||
if "sam3x8e" in BOARD_OPTIONS.get("build", {}).get("mcu", ""):
|
if "sam3x8e" in BOARD_OPTIONS.get("build", {}).get("mcu", ""):
|
||||||
env.Append(UPLOADERFLAGS=["--boot"])
|
env.Append(UPLOADERFLAGS=["--boot"])
|
||||||
|
|
||||||
|
elif upload_protocol == "stk500v2":
|
||||||
|
env.Append(
|
||||||
|
BUILDERS=dict(
|
||||||
|
ElfToHex=Builder(
|
||||||
|
action=" ".join([
|
||||||
|
"$OBJCOPY",
|
||||||
|
"-O",
|
||||||
|
"ihex",
|
||||||
|
"-R",
|
||||||
|
".eeprom",
|
||||||
|
"$SOURCES",
|
||||||
|
"$TARGET"]),
|
||||||
|
suffix=".hex"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
env.Replace(
|
||||||
|
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
|
||||||
|
UPLOADERFLAGS=[
|
||||||
|
"-C", '"%s"' % join("$PIOPACKAGES_DIR",
|
||||||
|
"tool-avrdude", "avrdude.conf"),
|
||||||
|
"-v",
|
||||||
|
"-p", "atmega2560", # Arduino M0/Tian upload hook
|
||||||
|
"-c", "$UPLOAD_PROTOCOL",
|
||||||
|
"-P", '"$UPLOAD_PORT"',
|
||||||
|
"-b", "$UPLOAD_SPEED"
|
||||||
|
],
|
||||||
|
|
||||||
|
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i'
|
||||||
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Target: Build executable and linkable firmware
|
# Target: Build executable and linkable firmware
|
||||||
#
|
#
|
||||||
@@ -185,6 +217,8 @@ 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.bin")
|
||||||
|
elif upload_protocol == "stk500v2":
|
||||||
|
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
|
||||||
else:
|
else:
|
||||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user