Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Industruino SAMx boards support #159

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions boards/industruino_420maker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"ldscript": "flash_with_bootloader.ld"
},
"core": "industruino",
"cpu": "cortex-m0plus",
"extra_flags": "-DARDUINO_SAMD_ZERO -D__SAML21E18B__",
"f_cpu": "48000000L",
"hwids": [
[
"0x2E78",
"0x804E"
],
[
"0x2E78",
"0x004E"
]
],
"mcu": "saml21e18b",
"usb_product": "Industruino 4-20mA.ker",
"variant": "industruino_420maker"
},
"debug": {
"jlink_device": "ATSAML21E18",
"onboard_tools": [
"cmsis-dap"
],
"openocd_chipname": "at91saml21e18",
"openocd_target": "at91samdXX",
"svd_path": "ATSAML21E18B.svd"
},
"frameworks": [
"arduino"
],
"name": "Industruino 4-20mA.ker",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"native_usb": true,
"offset_address": "0x2000",
"protocol": "sam-ba",
"protocols": [
"sam-ba",
"blackmagic",
"jlink",
"atmel-ice"
],
"require_upload_port": true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://industruino.com/shop/product/industruino-4-20ma-ker-89",
"vendor": "ES Gear Ltd"
}
56 changes: 56 additions & 0 deletions boards/industruino_d21g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"ldscript": "flash_with_bootloader.ld"
},
"core": "industruino",
"cpu": "cortex-m0plus",
"extra_flags": "-DARDUINO_SAMD_ZERO -D__SAMD21G18A__",
"f_cpu": "48000000L",
"hwids": [
[
"0x2E78",
"0x804D"
],
[
"0x2E78",
"0x004D"
]
],
"mcu": "samd21g18a",
"usb_product": "Industruino D21G",
"variant": "industruino_d21g"
},
"debug": {
"jlink_device": "ATSAMD21G18",
"onboard_tools": [
"cmsis-dap"
],
"openocd_chipname": "at91samd21g18",
"openocd_target": "at91samdXX",
"svd_path": "ATSAMD21G18A.svd"
},
"frameworks": [
"arduino"
],
"name": "Industruino D21G",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"native_usb": true,
"offset_address": "0x4000",
"protocol": "sam-ba",
"protocols": [
"sam-ba",
"blackmagic",
"jlink",
"atmel-ice"
],
"require_upload_port": true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://industruino.com/shop/product/industruino-ind-i-o-d21g-2",
"vendor": "ES Gear Ltd"
}
4 changes: 4 additions & 0 deletions builder/frameworks/arduino/arduino-samd.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
if VENDOR_CORE == "sparkfun" and board.get("build.mcu", "").startswith("samd51"):
BUILD_CORE = "arduino51"

if VENDOR_CORE == "industruino":
BUILD_CORE = "industruino"

env.Append(
CPPDEFINES=[
"ARDUINO_ARCH_SAMD"
Expand All @@ -59,6 +62,7 @@
os.path.join("Core", "Include") if VENDOR_CORE in ("adafruit", "seeed") else "Include",
), # Adafruit and Seeed cores use CMSIS v5.4 with different folder structure
os.path.join(CMSIS_ATMEL_DIR, "CMSIS", "Device", "ATMEL"),
os.path.join(CMSIS_ATMEL_DIR, "CMSIS-Atmel", "CMSIS", "Device", "ATMEL"),
os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE)
],

Expand Down
6 changes: 5 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def _jlink_cmd_script(env, source):
env.Append(
UPLOADERFLAGS=[
"-U", "--offset", board.get("upload.offset_address")])

elif board.get("build.core") == "industruino":
# special flags for the latest bossac tool
env.Append(
UPLOADERFLAGS=[
"-U", "--offset", board.get("upload.offset_address")])
else:
env.Append(UPLOADERFLAGS=[
"--erase",
Expand Down
15 changes: 15 additions & 0 deletions examples/arduino-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ platform = atmelsam
framework = arduino
board = digix

[env:industruino_420maker]
platform = atmelsam
board = industruino_420maker
framework = arduino
; External 3.3v on or off:
; EXT_3V3_ON=1 or EXT_3V3_ON=0
; Serial communication SPI+I2C or SPI+UART or I2C+UART:
; SERCOM_CONFIG_1 or SERCOM_CONFIG_2 or SERCOM_CONFIG_3
build_flags = -D EXT_3V3_ON=1 -D SERCOM_CONFIG_1

[env:industruino_d21g]
platform = atmelsam
board = industruino_d21g
framework = arduino

[env:mkr1000USB]
platform = atmelsam
framework = arduino
Expand Down
15 changes: 15 additions & 0 deletions examples/arduino-external-libs/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ platform = atmelsam
framework = arduino
board = digix

[env:industruino_420maker]
platform = atmelsam
board = industruino_420maker
framework = arduino
; External 3.3v on or off:
; EXT_3V3_ON=1 or EXT_3V3_ON=0
; Serial communication SPI+I2C or SPI+UART or I2C+UART:
; SERCOM_CONFIG_1 or SERCOM_CONFIG_2 or SERCOM_CONFIG_3
build_flags = -D EXT_3V3_ON=1 -D SERCOM_CONFIG_3

[env:industruino_d21g]
platform = atmelsam
board = industruino_d21g
framework = arduino

[env:mkr1000USB]
platform = atmelsam
framework = arduino
Expand Down
15 changes: 15 additions & 0 deletions examples/arduino-internal-libs/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ platform = atmelsam
framework = arduino
board = digix

[env:industruino_420maker]
platform = atmelsam
board = industruino_420maker
framework = arduino
; External 3.3v on or off:
; EXT_3V3_ON=1 or EXT_3V3_ON=0
; Serial communication SPI+I2C or SPI+UART or I2C+UART:
; SERCOM_CONFIG_1 or SERCOM_CONFIG_2 or SERCOM_CONFIG_3
build_flags = -D EXT_3V3_ON=1 -D SERCOM_CONFIG_2

[env:industruino_d21g]
platform = atmelsam
board = industruino_d21g
framework = arduino

[env:mkr1000USB]
platform = atmelsam
framework = arduino
Expand Down
Loading