Merge pull request #346 from adafruit/ide2-debug
Arduino IDE v2 debuging suport
This commit is contained in:
commit
164decde3b
12 changed files with 829 additions and 381 deletions
2
.github/workflows/githubci.yml
vendored
2
.github/workflows/githubci.yml
vendored
|
|
@ -62,4 +62,4 @@ jobs:
|
|||
arduino-cli lib install "Adafruit NeoPixel" "Adafruit seesaw Library" "Adafruit SPIFlash" "FlashStorage" "MIDI Library" "SD" "SdFat - Adafruit Fork"
|
||||
|
||||
- name: Build examples
|
||||
run: python3 extras/build_all.py ${{ matrix.board }}
|
||||
run: python3 tools/build_all.py ${{ matrix.board }}
|
||||
|
|
|
|||
346
boards.txt
346
boards.txt
File diff suppressed because it is too large
Load diff
|
|
@ -1,303 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
print('''# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
''')
|
||||
|
||||
mcu_dict = {
|
||||
'SAMD21': {
|
||||
'flash_size': 262144,
|
||||
'data_size': 0,
|
||||
'offset': '0x2000',
|
||||
'build_mcu': 'cortex-m0plus',
|
||||
'f_cpu': '48000000L',
|
||||
'extra_flags': '-DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS'
|
||||
},
|
||||
|
||||
'SAMD51': {
|
||||
'flash_size': 507904, # SAMD51P20A and SAMD51J20A has 1032192
|
||||
'data_size': 0,
|
||||
'offset': '0x4000',
|
||||
'build_mcu': 'cortex-m4',
|
||||
'f_cpu': '120000000L',
|
||||
'extra_flags': '-D__SAMD51__ -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16'
|
||||
},
|
||||
|
||||
'SAME51': {
|
||||
'flash_size': 507904,
|
||||
'data_size': 0,
|
||||
'offset': '0x4000',
|
||||
'build_mcu': 'cortex-m4',
|
||||
'f_cpu': '120000000L',
|
||||
'extra_flags': '-D__SAMD51__ -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16'
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def build_header(mcu, name, vendor, product, vid, pid_list):
|
||||
prettyname = vendor + " " + product + " ({})".format(mcu)
|
||||
print()
|
||||
print("# -----------------------------------")
|
||||
print("# {}".format(prettyname))
|
||||
print("# -----------------------------------")
|
||||
print("{}.name={}".format(name, prettyname))
|
||||
print()
|
||||
|
||||
print("# VID/PID for Bootloader, Arduino & CircuitPython")
|
||||
for i in range(len(pid_list)):
|
||||
print("{}.vid.{}={}".format(name, i, vid))
|
||||
print("{}.pid.{}={}".format(name, i, pid_list[i]))
|
||||
print()
|
||||
|
||||
def build_upload(mcu, name, extra_flags):
|
||||
print("# Upload")
|
||||
print("{}.upload.tool=bossac18".format(name))
|
||||
print("{}.upload.protocol=sam-ba".format(name))
|
||||
|
||||
if ('SAMD51P20A' in extra_flags) or ('SAMD51J20A' in extra_flags):
|
||||
flash_size = 1032192
|
||||
else:
|
||||
flash_size = mcu_dict[mcu]['flash_size']
|
||||
print("{}.upload.maximum_size={}".format(name, flash_size))
|
||||
#print("{}.upload.maximum_data_size=%d".format((name, mcu_dict[mcu]['data_size']))
|
||||
|
||||
print("{}.upload.offset={}".format(name, mcu_dict[mcu]['offset']))
|
||||
print("{}.upload.use_1200bps_touch=true".format(name))
|
||||
print("{}.upload.wait_for_upload_port=true".format(name))
|
||||
print("{}.upload.native_usb=true".format(name))
|
||||
print()
|
||||
|
||||
def build_build(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader):
|
||||
print("# Build")
|
||||
print("{}.build.mcu={}".format(name, mcu_dict[mcu]['build_mcu']))
|
||||
print("{}.build.f_cpu={}".format(name, mcu_dict[mcu]['f_cpu']))
|
||||
print('{}.build.usb_product="{}"'.format(name, product))
|
||||
print('{}.build.usb_manufacturer="{}"'.format(name, vendor))
|
||||
print("{}.build.board={}".format(name, boarddefine))
|
||||
print("{}.build.core=arduino".format(name))
|
||||
|
||||
# Due to fastLed issue https://github.com/FastLED/FastLED/issues/1363
|
||||
# although there is a simple fix already https://github.com/FastLED/FastLED/pull/1424
|
||||
# fastLED is not well maintained, and we need to skip ARDUINO_SAMD_ZERO for affected boards
|
||||
# in the long run we should move all of our libraries away from ARDUINO_SAMD_ZERO
|
||||
if variant in [ 'gemma_m0', 'trinket_m0', 'qtpy_m0', 'itsybitsy_m0' ]:
|
||||
print("{}.build.extra_flags={} -DARM_MATH_CM0PLUS {{build.usb_flags}}".format(name, extra_flags))
|
||||
else:
|
||||
print("{}.build.extra_flags={} {} {{build.usb_flags}}".format(name, extra_flags, mcu_dict[mcu]['extra_flags']))
|
||||
|
||||
print("{}.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld".format(name))
|
||||
print("{}.build.openocdscript=openocd_scripts/{}.cfg".format(name, variant))
|
||||
print("{}.build.variant={}".format(name, variant))
|
||||
print("{}.build.variant_system_lib=".format(name))
|
||||
print("{}.build.vid={}".format(name, vid))
|
||||
print("{}.build.pid={}".format(name, pid_list[0]))
|
||||
print("{}.bootloader.tool=openocd".format(name))
|
||||
print("{}.bootloader.file={}".format(name, bootloader))
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print('{}.compiler.arm.cmsis.ldflags="-L{{runtime.tools.CMSIS-5.4.0.path}}/CMSIS/Lib/GCC/" "-L{{build.variant.path}}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16'.format(name))
|
||||
print()
|
||||
|
||||
|
||||
def build_menu(mcu, name):
|
||||
print("# Menu")
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print("{}.menu.cache.on=Enabled".format(name))
|
||||
print("{}.menu.cache.on.build.cache_flags=-DENABLE_CACHE".format(name))
|
||||
print("{}.menu.cache.off=Disabled".format(name))
|
||||
print("{}.menu.cache.off.build.cache_flags=".format(name))
|
||||
|
||||
print("{}.menu.speed.120=120 MHz (standard)".format(name))
|
||||
print("{}.menu.speed.120.build.f_cpu=120000000L".format(name))
|
||||
print("{}.menu.speed.150=150 MHz (overclock)".format(name))
|
||||
print("{}.menu.speed.150.build.f_cpu=150000000L".format(name))
|
||||
print("{}.menu.speed.180=180 MHz (overclock)".format(name))
|
||||
print("{}.menu.speed.180.build.f_cpu=180000000L".format(name))
|
||||
print("{}.menu.speed.200=200 MHz (overclock)".format(name))
|
||||
print("{}.menu.speed.200.build.f_cpu=200000000L".format(name))
|
||||
|
||||
print("{}.menu.opt.small=Small (-Os) (standard)".format(name))
|
||||
print("{}.menu.opt.small.build.flags.optimize=-Os".format(name))
|
||||
print("{}.menu.opt.fast=Fast (-O2)".format(name))
|
||||
print("{}.menu.opt.fast.build.flags.optimize=-O2".format(name))
|
||||
print("{}.menu.opt.faster=Faster (-O3)".format(name))
|
||||
print("{}.menu.opt.faster.build.flags.optimize=-O3".format(name))
|
||||
print("{}.menu.opt.fastest=Fastest (-Ofast)".format(name))
|
||||
print("{}.menu.opt.fastest.build.flags.optimize=-Ofast".format(name))
|
||||
print("{}.menu.opt.dragons=Here be dragons (-Ofast -funroll-loops)".format(name))
|
||||
print("{}.menu.opt.dragons.build.flags.optimize=-Ofast -funroll-loops".format(name))
|
||||
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print("{}.menu.maxqspi.50=50 MHz (standard)".format(name))
|
||||
print("{}.menu.maxqspi.50.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=50000000".format(name))
|
||||
print("{}.menu.maxqspi.fcpu=CPU Speed / 2".format(name))
|
||||
print("{}.menu.maxqspi.fcpu.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=({{build.f_cpu}})".format(name))
|
||||
|
||||
print("{}.menu.usbstack.arduino=Arduino".format(name))
|
||||
print("{}.menu.usbstack.tinyusb=TinyUSB".format(name))
|
||||
print("{}.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB".format(name))
|
||||
|
||||
print("{}.menu.debug.off=Off".format(name))
|
||||
print("{}.menu.debug.on=On".format(name))
|
||||
print("{}.menu.debug.on.build.flags.debug=-g".format(name))
|
||||
print()
|
||||
|
||||
def build_global_menu():
|
||||
print("menu.cache=Cache")
|
||||
print("menu.speed=CPU Speed")
|
||||
print("menu.opt=Optimize")
|
||||
print("menu.maxqspi=Max QSPI")
|
||||
print("menu.usbstack=USB Stack")
|
||||
print("menu.debug=Debug")
|
||||
|
||||
def make_board(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader):
|
||||
build_header(mcu, name, vendor, product, vid, pid_list)
|
||||
build_upload(mcu, name, extra_flags)
|
||||
build_build(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader)
|
||||
build_menu(mcu, name)
|
||||
|
||||
build_global_menu()
|
||||
|
||||
######################## SAMD21
|
||||
|
||||
make_board("SAMD21", "adafruit_feather_m0", "feather_m0",
|
||||
"Adafruit", "Feather M0", "0x239A", ["0x800B", "0x000B", "0x0015"],
|
||||
"SAMD_ZERO", "-D__SAMD21G18A__ -DADAFRUIT_FEATHER_M0", "featherM0/bootloader-feather_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_feather_m0_express", "feather_m0_express",
|
||||
"Adafruit", "Feather M0 Express", "0x239A", ["0x801B", "0x001B"],
|
||||
"SAMD_FEATHER_M0_EXPRESS", "-D__SAMD21G18A__ -DARDUINO_SAMD_FEATHER_M0 -DADAFRUIT_FEATHER_M0_EXPRESS", "featherM0/bootloader-feather_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_metro_m0", "metro_m0",
|
||||
"Adafruit", "Metro M0 Express", "0x239A", ["0x8013", "0x0013"],
|
||||
"SAMD_ZERO", "-D__SAMD21G18A__ -DADAFRUIT_METRO_M0_EXPRESS", "metroM0/bootloader-metro_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_circuitplayground_m0", "circuitplay",
|
||||
"Adafruit", "Circuit Playground Express", "0x239A", ["0x8018", "0x0019"],
|
||||
"SAMD_CIRCUITPLAYGROUND_EXPRESS", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_CIRCUITPLAYGROUND_M0", "circuitplayM0/bootloader-circuitplay_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_gemma_m0", "gemma_m0",
|
||||
"Adafruit", "Gemma M0", "0x239A", ["0x801C", "0x001C"],
|
||||
"GEMMA_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_GEMMA_M0", "gemmaM0/bootloader-gemma_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_trinket_m0", "trinket_m0",
|
||||
"Adafruit", "Trinket M0", "0x239A", ["0x801E", "0x001E"],
|
||||
"TRINKET_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_TRINKET_M0", "trinketm0/bootloader-trinket_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_qtpy_m0", "qtpy_m0",
|
||||
"Adafruit", "QT Py M0", "0x239A", ["0x80CB", "0x00CB", "0x00CC"],
|
||||
"QTPY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_QTPY_M0", "qtpyM0/bootloader-qtpy_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_neotrinkey_m0", "neotrinkey_m0",
|
||||
"Adafruit", "NeoPixel Trinkey M0", "0x239A", ["0x80EF", "0x00EF", "0x80F0"],
|
||||
"NEOTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOTRINKEY_M0", "neotrinkey_m0/bootloader-neotrinkey_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_rotarytrinkey_m0", "rotarytrinkey_m0",
|
||||
"Adafruit", "Rotary Trinkey M0", "0x239A", ["0x80FB", "0x00FB", "0x80FC"],
|
||||
"ROTARYTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_ROTARYTRINKEY_M0", "rotarytrinkey_m0/bootloader-rotarytrinkey_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_neokeytrinkey_m0", "neokeytrinkey_m0",
|
||||
"Adafruit", "NeoKey Trinkey M0", "0x239A", ["0x80FF", "0x00FF", "0x8100"],
|
||||
"NEOKEYTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOKEYTRINKEY_M0", "neokeytrinkey_m0/bootloader-neokeytrinkey_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_slidetrinkey_m0", "slidetrinkey_m0",
|
||||
"Adafruit", "Slide Trinkey M0", "0x239A", ["0x8101", "0x0101", "0x8102"],
|
||||
"SLIDETRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_SLIDETRINKEY_M0", "slidetrinkey_m0/bootloader-slidetrinkey_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_proxlighttrinkey_m0", "proxlighttrinkey_m0",
|
||||
"Adafruit", "ProxLight Trinkey M0", "0x239A", ["0x8103", "0x0103", "0x8104"],
|
||||
"PROXLIGHTTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_PROXLIGHTTRINKEY_M0", "proxlighttrinkey_m0/bootloader-proxlighttrinkey_m0.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_itsybitsy_m0", "itsybitsy_m0",
|
||||
"Adafruit", "ItsyBitsy M0 Express", "0x239A", ["0x800F", "0x000F", "0x8012"],
|
||||
"ITSYBITSY_M0", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M0", "itsybitsyM0/bootloader-itsybitsy_m0-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_pirkey", "pirkey",
|
||||
"Adafruit", "pIRKey", "0x239A", ["0x8027", "0x0027", "0x8028"],
|
||||
"PIRKEY", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_PIRKEY", "pirkey/bootloader-pirkey-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_hallowing", "hallowing_m0_express",
|
||||
"Adafruit", "Hallowing M0", "0x239A", ["0xDEAD", "0xD1ED", "0xB000"],
|
||||
"SAMD_HALLOWING", "-D__SAMD21G18A__ -DCRYSTALLESS -DARDUINO_SAMD_HALLOWING_M0 -DADAFRUIT_HALLOWING", "hallowingM0/bootloader-hallowing_m0-v2.0.0-adafruit.0-21-g887cc30.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_crickit_m0", "crickit_m0",
|
||||
"Adafruit", "Crickit M0", "0x239A", ["0x802D", "0x002D", "0x802D"],
|
||||
"CRICKIT_M0", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_CRICKIT_M0", "crickit/samd21_sam_ba.bin")
|
||||
|
||||
make_board("SAMD21", "adafruit_blm_badge", "blm_badge",
|
||||
"Adafruit", "BLM Badge", "0x239A", ["0x80BF", "0x00BF", "0x80C0"],
|
||||
"BLM_BADGE_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_BLM_BADGE", "blmbadge/bootloader-blm_badge.bin")
|
||||
|
||||
######################## SAMD51
|
||||
|
||||
make_board("SAMD51", "adafruit_metro_m4", "metro_m4",
|
||||
"Adafruit", "Metro M4", "0x239A", ["0x8020", "0x0020", "0x8021", "0x0021"],
|
||||
"METRO_M4", "-D__SAMD51J19A__ -DADAFRUIT_METRO_M4_EXPRESS", "metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_grandcentral_m4", "grand_central_m4",
|
||||
"Adafruit", "Grand Central M4", "0x239A", ["0x8031", "0x0031", "0x0032"],
|
||||
"GRAND_CENTRAL_M4", "-D__SAMD51P20A__ -DADAFRUIT_GRAND_CENTRAL_M4", "grand_central_m4/bootloader-grandcentral_m4.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_itsybitsy_m4", "itsybitsy_m4",
|
||||
"Adafruit", "ItsyBitsy M4", "0x239A", ["0x802B", "0x002B"],
|
||||
"ITSYBITSY_M4", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M4_EXPRESS", "itsybitsyM4/bootloader-itsybitsy_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_feather_m4", "feather_m4",
|
||||
"Adafruit", "Feather M4 Express", "0x239A", ["0x8022", "0x0022", "0x8026"],
|
||||
"FEATHER_M4", "-D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAME51", "adafruit_feather_m4_can", "feather_m4_can",
|
||||
"Adafruit", "Feather M4 CAN", "0x239A", ["0x80CD", "0x00CD"],
|
||||
"FEATHER_M4_CAN", "-D__SAME51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -DADAFRUIT_FEATHER_M4_CAN", "featherM4/bootloader-feather_m4_express-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_trellis_m4", "trellis_m4",
|
||||
"Adafruit", "Trellis M4", "0x239A", ["0x802F", "0x002F", "0x0030"],
|
||||
"TRELLIS_M4", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_TRELLIS_M4_EXPRESS", "trellisM4/bootloader-trellis_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_pyportal_m4", "pyportal_m4",
|
||||
"Adafruit", "PyPortal M4", "0x239A", ["0x8035", "0x0035", "0x8036"],
|
||||
"PYPORTAL_M4", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYPORTAL", "metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_pyportal_m4_titano", "pyportal_m4_titano",
|
||||
"Adafruit", "PyPortal M4 Titano", "0x239A", ["0x8053", "0x8053"],
|
||||
"PYPORTAL_M4_TITANO", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYPORTAL_M4_TITANO", "metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_pybadge_m4", "pybadge_m4",
|
||||
"Adafruit", "pyBadge M4 Express", "0x239A", ["0x8033", "0x0033", "0x8034", "0x0034"],
|
||||
"PYBADGE_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_PYBADGE_M4_EXPRESS", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_metro_m4_airliftlite", "metro_m4_airlift",
|
||||
"Adafruit", "Metro M4 AirLift Lite", "0x239A", ["0x8037", "0x0037"],
|
||||
"METRO_M4_AIRLIFT_LITE", "-D__SAMD51J19A__ -DADAFRUIT_METRO_M4_AIRLIFT_LITE", "metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_pygamer_m4", "pygamer_m4",
|
||||
"Adafruit", "PyGamer M4 Express", "0x239A", ["0x803D", "0x003D", "0x803E"],
|
||||
"PYGAMER_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_PYGAMER_M4_EXPRESS", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_pybadge_airlift_m4", "pybadge_airlift_m4",
|
||||
"Adafruit", "pyBadge AirLift M4", "0x239A", ["0x8043", "0x0043", "0x8044"],
|
||||
"PYBADGE_AIRLIFT_M4", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYBADGE_AIRLIFT_M4", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_monster_m4sk", "monster_m4sk",
|
||||
"Adafruit", "MONSTER M4SK", "0x239A", ["0x8047", "0x0047", "0x8048"],
|
||||
"MONSTER_M4SK", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_MONSTER_M4SK_EXPRESS", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_hallowing_m4", "hallowing_m4",
|
||||
"Adafruit", "Hallowing M4", "0x239A", ["0x8049", "0x0049", "0x804A"],
|
||||
"HALLOWING_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_HALLOWING_M4_EXPRESS", "featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin")
|
||||
|
||||
make_board("SAMD51", "adafruit_matrixportal_m4", "matrixportal_m4",
|
||||
"Adafruit", "Matrix Portal M4", "0x239A", ["0x80C9", "0x00C9", "0x80CA"],
|
||||
"MATRIXPORTAL_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_MATRIXPORTAL_M4_EXPRESS", "matrixportalM4/bootloader-matrixportal_m4.bin")
|
||||
40
platform.txt
40
platform.txt
|
|
@ -173,13 +173,13 @@ tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -por
|
|||
# OpenOCD sketch upload
|
||||
#
|
||||
|
||||
tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}
|
||||
tools.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}
|
||||
tools.openocd.cmd=bin/openocd
|
||||
tools.openocd.cmd.windows=bin/openocd.exe
|
||||
|
||||
tools.openocd.upload.params.verbose=-d2
|
||||
tools.openocd.upload.params.quiet=-d0
|
||||
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
|
||||
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
|
||||
|
||||
tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
|
||||
tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
|
||||
|
|
@ -187,7 +187,7 @@ tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port
|
|||
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
|
||||
tools.openocd.program.params.verbose=-d2
|
||||
tools.openocd.program.params.quiet=-d0
|
||||
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
|
||||
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
|
||||
|
||||
tools.openocd.erase.params.verbose=-d3
|
||||
tools.openocd.erase.params.quiet=-d0
|
||||
|
|
@ -195,25 +195,25 @@ tools.openocd.erase.pattern=
|
|||
|
||||
tools.openocd.bootloader.params.verbose=-d2
|
||||
tools.openocd.bootloader.params.quiet=-d0
|
||||
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
|
||||
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
|
||||
|
||||
#
|
||||
# OpenOCD sketch upload - version with configurable bootloader size
|
||||
# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
|
||||
#
|
||||
|
||||
tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path}
|
||||
tools.openocd-withbootsize.path={runtime.tools.openocd-0.11.0-arduino2.path}
|
||||
tools.openocd-withbootsize.cmd=bin/openocd
|
||||
tools.openocd-withbootsize.cmd.windows=bin/openocd.exe
|
||||
|
||||
tools.openocd-withbootsize.upload.params.verbose=-d2
|
||||
tools.openocd-withbootsize.upload.params.quiet=-d0
|
||||
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
|
||||
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
|
||||
|
||||
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
|
||||
tools.openocd-withbootsize.program.params.verbose=-d2
|
||||
tools.openocd-withbootsize.program.params.quiet=-d0
|
||||
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
|
||||
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
|
||||
|
||||
tools.openocd-withbootsize.erase.params.verbose=-d3
|
||||
tools.openocd-withbootsize.erase.params.quiet=-d0
|
||||
|
|
@ -221,4 +221,28 @@ tools.openocd-withbootsize.erase.pattern=
|
|||
|
||||
tools.openocd-withbootsize.bootloader.params.verbose=-d2
|
||||
tools.openocd-withbootsize.bootloader.params.quiet=-d0
|
||||
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
|
||||
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
|
||||
|
||||
# ----------------------------------------
|
||||
# Debugger configuration (general options)
|
||||
# ----------------------------------------
|
||||
# EXPERIMENTAL feature:
|
||||
# - this is alpha and may be subject to change without notice
|
||||
debug.executable={build.path}/{build.project_name}.elf
|
||||
debug.toolchain=gcc
|
||||
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
|
||||
debug.toolchain.prefix=arm-none-eabi-
|
||||
|
||||
debug.server=openocd
|
||||
debug.server.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}/bin/openocd
|
||||
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.11.0-arduino2.path}/share/openocd/scripts/
|
||||
debug.server.openocd.script={runtime.platform.path}/{build.openocdscript}
|
||||
|
||||
# JLinkServer is not supported by arduino-cli yet
|
||||
# https://github.com/arduino/arduino-cli/blob/eca9d9a8f00582a08fadea8a4b7e3ef01b40d082/commands/debug/debug.go#L160
|
||||
# use debug_custom.json to run JLinkGDBServer instead
|
||||
# https://docs.arduino.cc/tutorials/mkr-wifi-1010/mkr-jlink-setup
|
||||
#debug.server=jlink
|
||||
#debug.server.jlink.path=JLinkGDBServer
|
||||
#debug.server.jlink.device=ATSAMD21G18
|
||||
#debug.server.jlink.script={runtime.platform.path}/{build.openocdscript}
|
||||
|
|
|
|||
6
scripts/jlink/samd21/debug_custom.json
Normal file
6
scripts/jlink/samd21/debug_custom.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"servertype": "jlink",
|
||||
"device": "ATSAMD21G18A",
|
||||
"interface": "SWD",
|
||||
"serverpath": "JLinkGDBServer"
|
||||
}
|
||||
6
scripts/jlink/samd51/debug_custom.json
Normal file
6
scripts/jlink/samd51/debug_custom.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"servertype": "jlink",
|
||||
"device": "ATSAMD51G18",
|
||||
"interface": "SWD",
|
||||
"serverpath": "JLinkGDBServer"
|
||||
}
|
||||
27
scripts/openocd/daplink_samd21.cfg
Normal file
27
scripts/openocd/daplink_samd21.cfg
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# Arduino Zero OpenOCD script.
|
||||
#
|
||||
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
source [find interface/cmsis-dap.cfg]
|
||||
transport select swd
|
||||
|
||||
# chip name
|
||||
set CHIPNAME samd21
|
||||
|
||||
source [find target/at91samdXX.cfg]
|
||||
27
scripts/openocd/daplink_samd51.cfg
Normal file
27
scripts/openocd/daplink_samd51.cfg
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# Arduino Zero OpenOCD script.
|
||||
#
|
||||
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
source [find interface/cmsis-dap.cfg]
|
||||
transport select swd
|
||||
|
||||
# chip name
|
||||
set CHIPNAME samd51
|
||||
|
||||
source [find target/atsame5x.cfg]
|
||||
27
scripts/openocd/jlink_samd21.cfg
Normal file
27
scripts/openocd/jlink_samd21.cfg
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# Arduino Zero OpenOCD script.
|
||||
#
|
||||
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
source [find interface/jlink.cfg]
|
||||
transport select swd
|
||||
|
||||
# chip name
|
||||
set CHIPNAME samd21
|
||||
|
||||
source [find target/at91samdXX.cfg]
|
||||
27
scripts/openocd/jlink_samd51.cfg
Normal file
27
scripts/openocd/jlink_samd51.cfg
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# Arduino Zero OpenOCD script.
|
||||
#
|
||||
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
source [find interface/jlink.cfg]
|
||||
transport select swd
|
||||
|
||||
# chip name
|
||||
set CHIPNAME samd51
|
||||
|
||||
source [find target/atsame5x.cfg]
|
||||
389
tools/makeboards.py
Executable file
389
tools/makeboards.py
Executable file
|
|
@ -0,0 +1,389 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
print('''# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
''')
|
||||
|
||||
mcu_dict = {
|
||||
'SAMD21': {
|
||||
'flash_size': 262144,
|
||||
'data_size': 0,
|
||||
'offset': '0x2000',
|
||||
'build_mcu': 'cortex-m0plus',
|
||||
'f_cpu': '48000000L',
|
||||
'extra_flags': '-DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS',
|
||||
'openocdscript': 'scripts/openocd/daplink_samd21.cfg',
|
||||
},
|
||||
|
||||
'SAMD51': {
|
||||
'flash_size': 507904, # SAMD51P20A and SAMD51J20A has 1032192
|
||||
'data_size': 0,
|
||||
'offset': '0x4000',
|
||||
'build_mcu': 'cortex-m4',
|
||||
'f_cpu': '120000000L',
|
||||
'extra_flags': '-D__SAMD51__ -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16',
|
||||
'openocdscript': 'scripts/openocd/daplink_samd51.cfg',
|
||||
},
|
||||
|
||||
'SAME51': {
|
||||
'flash_size': 507904,
|
||||
'data_size': 0,
|
||||
'offset': '0x4000',
|
||||
'build_mcu': 'cortex-m4',
|
||||
'f_cpu': '120000000L',
|
||||
'extra_flags': '-D__SAMD51__ -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16',
|
||||
'openocdscript': 'scripts/openocd/daplink_samd51.cfg',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def build_header(mcu, name, vendor, product, vid, pid_list):
|
||||
prettyname = f"{vendor} {product} ({mcu})"
|
||||
print()
|
||||
print("# -----------------------------------")
|
||||
print(f"# {prettyname}")
|
||||
print("# -----------------------------------")
|
||||
print(f"{name}.name={prettyname}")
|
||||
print()
|
||||
|
||||
print("# VID/PID for Bootloader, Arduino & CircuitPython")
|
||||
for i in range(len(pid_list)):
|
||||
print(f"{name}.vid.{i}={vid}")
|
||||
print(f"{name}.pid.{i}={pid_list[i]}")
|
||||
print()
|
||||
|
||||
|
||||
def build_upload(mcu, name, extra_flags):
|
||||
print("# Upload")
|
||||
print(f"{name}.upload.tool=bossac18")
|
||||
print(f"{name}.upload.protocol=sam-ba")
|
||||
|
||||
if ('SAMD51P20A' in extra_flags) or ('SAMD51J20A' in extra_flags):
|
||||
flash_size = 1032192
|
||||
else:
|
||||
flash_size = mcu_dict[mcu]['flash_size']
|
||||
print(f"{name}.upload.maximum_size={flash_size}")
|
||||
#print(f"{name}.upload.maximum_data_size={mcu_dict[mcu]['data_size']}")
|
||||
|
||||
print(f"{name}.upload.offset={mcu_dict[mcu]['offset']}")
|
||||
print(f"{name}.upload.use_1200bps_touch=true")
|
||||
print(f"{name}.upload.wait_for_upload_port=true")
|
||||
print(f"{name}.upload.native_usb=true")
|
||||
print()
|
||||
|
||||
|
||||
def build_build(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader):
|
||||
mcu_properties = mcu_dict[mcu]
|
||||
|
||||
print("# Build")
|
||||
print(f"{name}.build.mcu={mcu_properties['build_mcu']}")
|
||||
print(f"{name}.build.f_cpu={mcu_properties['f_cpu']}")
|
||||
print(f'{name}.build.usb_product="{product}"')
|
||||
print(f'{name}.build.usb_manufacturer="{vendor}"')
|
||||
print(f"{name}.build.board={boarddefine}")
|
||||
print(f"{name}.build.core=arduino")
|
||||
|
||||
# Due to fastLed issue https://github.com/FastLED/FastLED/issues/1363
|
||||
# although there is a simple fix already https://github.com/FastLED/FastLED/pull/1424
|
||||
# fastLED is not well maintained, and we need to skip ARDUINO_SAMD_ZERO for affected boards
|
||||
# in the long run we should move all of our libraries away from ARDUINO_SAMD_ZERO
|
||||
if variant in [ 'gemma_m0', 'trinket_m0', 'qtpy_m0', 'itsybitsy_m0' ]:
|
||||
print(f"{name}.build.extra_flags={extra_flags} -DARM_MATH_CM0PLUS {{build.usb_flags}}")
|
||||
else:
|
||||
print(f"{name}.build.extra_flags={extra_flags} {mcu_properties['extra_flags']} {{build.usb_flags}}")
|
||||
|
||||
print(f"{name}.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld")
|
||||
print(f"{name}.build.openocdscript={mcu_properties['openocdscript']}")
|
||||
print(f"{name}.build.variant={variant}")
|
||||
print(f"{name}.build.variant_system_lib=")
|
||||
print(f"{name}.build.vid={vid}")
|
||||
print(f"{name}.build.pid={pid_list[0]}")
|
||||
print(f"{name}.bootloader.tool=openocd")
|
||||
print(f"{name}.bootloader.file={bootloader}")
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print(f'{name}.compiler.arm.cmsis.ldflags="-L{{runtime.tools.CMSIS-5.4.0.path}}/CMSIS/Lib/GCC/" "-L{{build.variant.path}}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16')
|
||||
print()
|
||||
|
||||
|
||||
def build_menu(mcu, name):
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print("# Menu: Cache")
|
||||
print(f"{name}.menu.cache.on=Enabled")
|
||||
print(f"{name}.menu.cache.on.build.cache_flags=-DENABLE_CACHE")
|
||||
print(f"{name}.menu.cache.off=Disabled")
|
||||
print(f"{name}.menu.cache.off.build.cache_flags=")
|
||||
print()
|
||||
|
||||
print("# Menu: Speed")
|
||||
print(f"{name}.menu.speed.120=120 MHz (standard)")
|
||||
print(f"{name}.menu.speed.120.build.f_cpu=120000000L")
|
||||
print(f"{name}.menu.speed.150=150 MHz (overclock)")
|
||||
print(f"{name}.menu.speed.150.build.f_cpu=150000000L")
|
||||
print(f"{name}.menu.speed.180=180 MHz (overclock)")
|
||||
print(f"{name}.menu.speed.180.build.f_cpu=180000000L")
|
||||
print(f"{name}.menu.speed.200=200 MHz (overclock)")
|
||||
print(f"{name}.menu.speed.200.build.f_cpu=200000000L")
|
||||
print()
|
||||
|
||||
print("# Menu: Optimization")
|
||||
print(f"{name}.menu.opt.small=Small (-Os) (standard)")
|
||||
print(f"{name}.menu.opt.small.build.flags.optimize=-Os")
|
||||
print(f"{name}.menu.opt.fast=Fast (-O2)")
|
||||
print(f"{name}.menu.opt.fast.build.flags.optimize=-O2")
|
||||
print(f"{name}.menu.opt.faster=Faster (-O3)")
|
||||
print(f"{name}.menu.opt.faster.build.flags.optimize=-O3")
|
||||
print(f"{name}.menu.opt.fastest=Fastest (-Ofast)")
|
||||
print(f"{name}.menu.opt.fastest.build.flags.optimize=-Ofast")
|
||||
print(f"{name}.menu.opt.dragons=Here be dragons (-Ofast -funroll-loops)")
|
||||
print(f"{name}.menu.opt.dragons.build.flags.optimize=-Ofast -funroll-loops")
|
||||
print()
|
||||
|
||||
if (mcu == 'SAMD51' or mcu == 'SAME51'):
|
||||
print("# Menu: QSPI Speed")
|
||||
print(f"{name}.menu.maxqspi.50=50 MHz (standard)")
|
||||
print(f"{name}.menu.maxqspi.50.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=50000000")
|
||||
print(f"{name}.menu.maxqspi.fcpu=CPU Speed / 2")
|
||||
print(f"{name}.menu.maxqspi.fcpu.build.flags.maxqspi=-DVARIANT_QSPI_BAUD_DEFAULT=({{build.f_cpu}})")
|
||||
print()
|
||||
|
||||
print("# Menu: USB Stack")
|
||||
print(f"{name}.menu.usbstack.arduino=Arduino")
|
||||
print(f"{name}.menu.usbstack.tinyusb=TinyUSB")
|
||||
print(f"{name}.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB")
|
||||
print()
|
||||
|
||||
print("# Menu: Debug")
|
||||
print(f"{name}.menu.debug.off=Off")
|
||||
print(f"{name}.menu.debug.on=On")
|
||||
print(f"{name}.menu.debug.on.build.flags.debug=-g")
|
||||
print()
|
||||
|
||||
# comment out for now since debugger selection does not work, debug does not pickup the right openocd script
|
||||
# print("# Menu: Debugger")
|
||||
# script_mcu = 'samd21' if mcu == 'SAMD21' else 'samd51'
|
||||
# print(f"{name}.menu.debugger.daplink=CMSIS-DAP (DAPLink)")
|
||||
# print(f"{name}.menu.debugger.daplink.build.openocdscript=scripts/openocd/daplink_{script_mcu}.cfg")
|
||||
# print(f"{name}.menu.debugger.jlink=J-Link")
|
||||
# print(f"{name}.menu.debugger.jlink.build.openocdscript=scripts/openocd/jlink_{script_mcu}.cfg")
|
||||
|
||||
|
||||
def build_global_menu():
|
||||
print("menu.cache=Cache")
|
||||
print("menu.speed=CPU Speed")
|
||||
print("menu.opt=Optimize")
|
||||
print("menu.maxqspi=Max QSPI")
|
||||
print("menu.usbstack=USB Stack")
|
||||
print("menu.debug=Debug")
|
||||
#print("menu.debugger=Debugger")
|
||||
|
||||
|
||||
def make_board(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader):
|
||||
build_header(mcu, name, vendor, product, vid, pid_list)
|
||||
build_upload(mcu, name, extra_flags)
|
||||
build_build(mcu, name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader)
|
||||
build_menu(mcu, name)
|
||||
|
||||
|
||||
# ------------------------------
|
||||
# main
|
||||
# ------------------------------
|
||||
|
||||
build_global_menu()
|
||||
|
||||
# ------------------------------
|
||||
# SAM D21 (M0)
|
||||
# ------------------------------
|
||||
|
||||
# name, variant, vendor, product, vid, pid_list, boarddefine, extra_flags, bootloader
|
||||
# try to sort in Alphabetical order
|
||||
d21_board_list = [
|
||||
["adafruit_feather_m0", "feather_m0", "Adafruit", "Feather M0",
|
||||
"0x239A", ["0x800B", "0x000B", "0x0015"],
|
||||
"SAMD_ZERO", "-D__SAMD21G18A__ -DADAFRUIT_FEATHER_M0",
|
||||
"featherM0/bootloader-feather_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_feather_m0_express", "feather_m0_express", "Adafruit", "Feather M0 Express",
|
||||
"0x239A", ["0x801B", "0x001B"],
|
||||
"SAMD_FEATHER_M0_EXPRESS", "-D__SAMD21G18A__ -DARDUINO_SAMD_FEATHER_M0 -DADAFRUIT_FEATHER_M0_EXPRESS",
|
||||
"featherM0/bootloader-feather_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_metro_m0", "metro_m0", "Adafruit", "Metro M0 Express",
|
||||
"0x239A", ["0x8013", "0x0013"],
|
||||
"SAMD_ZERO", "-D__SAMD21G18A__ -DADAFRUIT_METRO_M0_EXPRESS",
|
||||
"metroM0/bootloader-metro_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_circuitplayground_m0", "circuitplay", "Adafruit", "Circuit Playground Express",
|
||||
"0x239A", ["0x8018", "0x0019"],
|
||||
"SAMD_CIRCUITPLAYGROUND_EXPRESS", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_CIRCUITPLAYGROUND_M0",
|
||||
"circuitplayM0/bootloader-circuitplay_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_gemma_m0", "gemma_m0", "Adafruit", "Gemma M0",
|
||||
"0x239A", ["0x801C", "0x001C"],
|
||||
"GEMMA_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_GEMMA_M0",
|
||||
"gemmaM0/bootloader-gemma_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_trinket_m0", "trinket_m0", "Adafruit", "Trinket M0",
|
||||
"0x239A", ["0x801E", "0x001E"],
|
||||
"TRINKET_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_TRINKET_M0",
|
||||
"trinketm0/bootloader-trinket_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_qtpy_m0", "qtpy_m0", "Adafruit", "QT Py M0",
|
||||
"0x239A", ["0x80CB", "0x00CB", "0x00CC"],
|
||||
"QTPY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_QTPY_M0",
|
||||
"qtpyM0/bootloader-qtpy_m0.bin"],
|
||||
|
||||
["adafruit_neotrinkey_m0", "neotrinkey_m0", "Adafruit", "NeoPixel Trinkey M0",
|
||||
"0x239A", ["0x80EF", "0x00EF", "0x80F0"],
|
||||
"NEOTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOTRINKEY_M0",
|
||||
"neotrinkey_m0/bootloader-neotrinkey_m0.bin"],
|
||||
|
||||
["adafruit_rotarytrinkey_m0", "rotarytrinkey_m0", "Adafruit", "Rotary Trinkey M0",
|
||||
"0x239A", ["0x80FB", "0x00FB", "0x80FC"],
|
||||
"ROTARYTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_ROTARYTRINKEY_M0",
|
||||
"rotarytrinkey_m0/bootloader-rotarytrinkey_m0.bin"],
|
||||
|
||||
["adafruit_neokeytrinkey_m0", "neokeytrinkey_m0", "Adafruit", "NeoKey Trinkey M0",
|
||||
"0x239A", ["0x80FF", "0x00FF", "0x8100"],
|
||||
"NEOKEYTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOKEYTRINKEY_M0",
|
||||
"neokeytrinkey_m0/bootloader-neokeytrinkey_m0.bin"],
|
||||
|
||||
["adafruit_slidetrinkey_m0", "slidetrinkey_m0", "Adafruit", "Slide Trinkey M0",
|
||||
"0x239A", ["0x8101", "0x0101", "0x8102"],
|
||||
"SLIDETRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_SLIDETRINKEY_M0",
|
||||
"slidetrinkey_m0/bootloader-slidetrinkey_m0.bin"],
|
||||
|
||||
["adafruit_proxlighttrinkey_m0", "proxlighttrinkey_m0", "Adafruit", "ProxLight Trinkey M0",
|
||||
"0x239A", ["0x8103", "0x0103", "0x8104"],
|
||||
"PROXLIGHTTRINKEY_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_PROXLIGHTTRINKEY_M0",
|
||||
"proxlighttrinkey_m0/bootloader-proxlighttrinkey_m0.bin"],
|
||||
|
||||
["adafruit_itsybitsy_m0", "itsybitsy_m0", "Adafruit", "ItsyBitsy M0 Express",
|
||||
"0x239A", ["0x800F", "0x000F", "0x8012"],
|
||||
"ITSYBITSY_M0", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M0",
|
||||
"itsybitsyM0/bootloader-itsybitsy_m0-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pirkey", "pirkey", "Adafruit", "pIRKey",
|
||||
"0x239A", ["0x8027", "0x0027", "0x8028"],
|
||||
"PIRKEY", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_PIRKEY",
|
||||
"pirkey/bootloader-pirkey-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_hallowing", "hallowing_m0_express", "Adafruit", "Hallowing M0",
|
||||
"0x239A", ["0xDEAD", "0xD1ED", "0xB000"],
|
||||
"SAMD_HALLOWING", "-D__SAMD21G18A__ -DCRYSTALLESS -DARDUINO_SAMD_HALLOWING_M0 -DADAFRUIT_HALLOWING",
|
||||
"hallowingM0/bootloader-hallowing_m0-v2.0.0-adafruit.0-21-g887cc30.bin"],
|
||||
|
||||
["adafruit_crickit_m0", "crickit_m0", "Adafruit", "Crickit M0",
|
||||
"0x239A", ["0x802D", "0x002D", "0x802D"],
|
||||
"CRICKIT_M0", "-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_CRICKIT_M0",
|
||||
"crickit/samd21_sam_ba.bin"],
|
||||
|
||||
["adafruit_blm_badge", "blm_badge", "Adafruit", "BLM Badge",
|
||||
"0x239A", ["0x80BF", "0x00BF", "0x80C0"],
|
||||
"BLM_BADGE_M0", "-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_BLM_BADGE",
|
||||
"blmbadge/bootloader-blm_badge.bin"],
|
||||
]
|
||||
|
||||
for b in d21_board_list:
|
||||
make_board("SAMD21", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8])
|
||||
|
||||
|
||||
# ----------------------------
|
||||
# SAM D51 and E51 (M4)
|
||||
# ----------------------------
|
||||
|
||||
d51_board_list = [
|
||||
["adafruit_metro_m4", "metro_m4", "Adafruit", "Metro M4",
|
||||
"0x239A", ["0x8020", "0x0020", "0x8021", "0x0021"],
|
||||
"METRO_M4", "-D__SAMD51J19A__ -DADAFRUIT_METRO_M4_EXPRESS",
|
||||
"metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_grandcentral_m4", "grand_central_m4", "Adafruit", "Grand Central M4",
|
||||
"0x239A", ["0x8031", "0x0031", "0x0032"],
|
||||
"GRAND_CENTRAL_M4", "-D__SAMD51P20A__ -DADAFRUIT_GRAND_CENTRAL_M4",
|
||||
"grand_central_m4/bootloader-grandcentral_m4.bin"],
|
||||
|
||||
["adafruit_itsybitsy_m4", "itsybitsy_m4", "Adafruit", "ItsyBitsy M4",
|
||||
"0x239A", ["0x802B", "0x002B"],
|
||||
"ITSYBITSY_M4", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M4_EXPRESS",
|
||||
"itsybitsyM4/bootloader-itsybitsy_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_feather_m4", "feather_m4", "Adafruit", "Feather M4 Express",
|
||||
"0x239A", ["0x8022", "0x0022", "0x8026"],
|
||||
"FEATHER_M4", "-D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_feather_m4_can", "feather_m4_can", "Adafruit", "Feather M4 CAN",
|
||||
"0x239A", ["0x80CD", "0x00CD"],
|
||||
"FEATHER_M4_CAN", "-D__SAME51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -DADAFRUIT_FEATHER_M4_CAN",
|
||||
"featherM4/bootloader-feather_m4_express-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_trellis_m4", "trellis_m4",
|
||||
"Adafruit", "Trellis M4", "0x239A", ["0x802F", "0x002F", "0x0030"],
|
||||
"TRELLIS_M4", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_TRELLIS_M4_EXPRESS",
|
||||
"trellisM4/bootloader-trellis_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pyportal_m4", "pyportal_m4", "Adafruit", "PyPortal M4",
|
||||
"0x239A", ["0x8035", "0x0035", "0x8036"],
|
||||
"PYPORTAL_M4", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYPORTAL",
|
||||
"metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pyportal_m4_titano", "pyportal_m4_titano", "Adafruit", "PyPortal M4 Titano",
|
||||
"0x239A", ["0x8053", "0x8053"],
|
||||
"PYPORTAL_M4_TITANO", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYPORTAL_M4_TITANO",
|
||||
"metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pybadge_m4", "pybadge_m4", "Adafruit", "pyBadge M4 Express",
|
||||
"0x239A", ["0x8033", "0x0033", "0x8034", "0x0034"],
|
||||
"PYBADGE_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_PYBADGE_M4_EXPRESS",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_metro_m4_airliftlite", "metro_m4_airlift", "Adafruit", "Metro M4 AirLift Lite",
|
||||
"0x239A", ["0x8037", "0x0037"],
|
||||
"METRO_M4_AIRLIFT_LITE", "-D__SAMD51J19A__ -DADAFRUIT_METRO_M4_AIRLIFT_LITE",
|
||||
"metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pygamer_m4", "pygamer_m4", "Adafruit", "PyGamer M4 Express",
|
||||
"0x239A", ["0x803D", "0x003D", "0x803E"],
|
||||
"PYGAMER_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_PYGAMER_M4_EXPRESS",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_pybadge_airlift_m4", "pybadge_airlift_m4", "Adafruit", "pyBadge AirLift M4",
|
||||
"0x239A", ["0x8043", "0x0043", "0x8044"],
|
||||
"PYBADGE_AIRLIFT_M4", "-D__SAMD51J20A__ -DCRYSTALLESS -DADAFRUIT_PYBADGE_AIRLIFT_M4",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_monster_m4sk", "monster_m4sk", "Adafruit", "MONSTER M4SK",
|
||||
"0x239A", ["0x8047", "0x0047", "0x8048"],
|
||||
"MONSTER_M4SK", "-D__SAMD51G19A__ -DCRYSTALLESS -DADAFRUIT_MONSTER_M4SK_EXPRESS",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_hallowing_m4", "hallowing_m4", "Adafruit", "Hallowing M4",
|
||||
"0x239A", ["0x8049", "0x0049", "0x804A"],
|
||||
"HALLOWING_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_HALLOWING_M4_EXPRESS",
|
||||
"featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin"],
|
||||
|
||||
["adafruit_matrixportal_m4", "matrixportal_m4", "Adafruit", "Matrix Portal M4",
|
||||
"0x239A", ["0x80C9", "0x00C9", "0x80CA"],
|
||||
"MATRIXPORTAL_M4", "-D__SAMD51J19A__ -DCRYSTALLESS -DADAFRUIT_MATRIXPORTAL_M4_EXPRESS",
|
||||
"matrixportalM4/bootloader-matrixportal_m4.bin"],
|
||||
]
|
||||
|
||||
for b in d51_board_list:
|
||||
# M4 CAN is the only SAME51
|
||||
if b[0] == "adafruit_feather_m4_can":
|
||||
make_board("SAME51", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8])
|
||||
else:
|
||||
make_board("SAMD51", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8])
|
||||
Loading…
Reference in a new issue