Improve support for SAMD21 based boards

This commit is contained in:
Valeriy Koval
2016-07-11 19:12:10 +03:00
parent 581fd356cd
commit 3984f80bae
3 changed files with 32 additions and 31 deletions

View File

@ -958,17 +958,17 @@
},
"mzeropro": {
"build": {
"core": "arduino_zero",
"core": "arduino_zero_org",
"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",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x03EB", "0x2111"],
["0x2A03", "0x804F"]
["0x2A03", "0x804F"],
["0x03EB", "0x2111"]
]
},
"frameworks": ["arduino"],
@ -989,19 +989,17 @@
},
"mzeroproUSB": {
"build": {
"core": "arduino_zero",
"core": "arduino_zero_org",
"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",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x004D"],
["0x2A03", "0x804D"],
["0x2A03", "0x004F"],
["0x2A03", "0x804F"]
["0x2A03", "0x804F"],
["0x2A03", "0x004F"]
]
},
"frameworks": ["arduino"],
@ -1023,19 +1021,17 @@
},
"mzeroUSB": {
"build": {
"core": "arduino_zero",
"core": "arduino_zero_org",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino M0",
"variant": "arduino_zero",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x004D"],
["0x2A03", "0x804D"],
["0x2A03", "0x004E"],
["0x2A03", "0x804E"]
["0x2A03", "0x804E"],
["0x2A03", "0x004E"]
]
},
"frameworks": ["arduino"],
@ -1057,17 +1053,17 @@
},
"tian": {
"build": {
"core": "arduino_zero",
"core": "arduino_zero_org",
"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",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x10C4", "0xEA70"],
["0x2A03", "0x8052"]
["0x2A03", "0x8052"],
["0x10C4", "0xEA70"]
]
},
"frameworks": ["arduino"],

View File

@ -216,11 +216,19 @@ env.Append(
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkCMSISInc"),
join("$PLATFORMFW_DIR", "system", "CMSIS", "CMSIS", "Include")
join(
"$PLATFORMFW_DIR", "system",
"CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""),
"CMSIS", "Include"
)
)
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkDeviceInc"),
join("$PLATFORMFW_DIR", "system", "CMSIS", "Device", "ATMEL")
join(
"$PLATFORMFW_DIR", "system",
"CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""),
"Device", "ATMEL"
)
)
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkLibSam"),

View File

@ -39,15 +39,12 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
port = env.subst(port)
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
if system() != "Windows":
try:
s = Serial(port)
s.close()
except: # pylint: disable=W0702
pass
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
try:
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
except: # pylint: disable=W0702
pass
sleep(0.4)