Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
59 changes: 59 additions & 0 deletions boards/clearcore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"build": {
"arduino": {
"ldscript": "flash_with_bootloader.ld"
},
"core": "clearcore",
"cpu": "cortex-m4",
"extra_flags": [
"-D __SAME53N19A__",
"-D __SAMD53__",
"-D ARDUINO_ARM_ClearCore",
"-D ARDUINO_ARCH_SAM",
"-D __ARM_FEATURE_DSP=1",
"-D __FPU_PRESENT",
"-D ARM_MATH_CM4",
"-D ENABLE_CACHE",
"-D VARIANT_QSPI_BAUD_DEFAULT=50000000"
],
"f_cpu": "120000000L",
"hwids": [
[
"0x2890",
"0x0022"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this on my hardware and the HWID needs to be adjusted to be 0x2890 0x8022, I think the zero was a typo. Specifying the COM port directly will skip that check and will let it keep working, though

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction, this needs to have BOTH HWID's, not changing the singular one. The bootloader, which can sometimes get stuck searching for an upload, uses the HWID you used. There are cases where PIO will get stuck and not be able to find the COM port when that happens, so both will be needed.

]
],
"mcu": "same53n19a",
"system": "samd",
"usb_product": "Teknic ClearCore",
"variant": "clearcore"
},
"debug": {
"jlink_device": "ATSAME53N19A",
"openocd_chipname": "at91same53n19",
"openocd_target": "atsame5x",
"svd_path": "ATSAME53N19A.svd"
},
"frameworks": [
"arduino"
],
"name": "ClearCore",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 196608,
"maximum_size": 507904,
"native_usb": true,
"offset_address": "0x4000",
"protocol": "sam-ba",
"protocols": [
"sam-ba",
"jlink",
"atmel-ice"
],
"require_upload_port": true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.teknic.com",
"vendor": "Teknic"
}
34 changes: 34 additions & 0 deletions builder/frameworks/arduino/arduino-samd.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@
]
)

if VENDOR_CORE == "clearcore":
env.Append(
CPPDEFINES=[
("USB_CONFIG_POWER", board.get("build.usb_power", 0))
],
)

#
# Vendor-specific configurations
#
Expand Down Expand Up @@ -170,6 +177,33 @@
os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE, "api", "deprecated-avr-comp")
]
)
elif VENDOR_CORE == "clearcore":
env.Prepend(
CPPPATH=[
os.path.join(FRAMEWORK_DIR, "variants", "clearcore", "ThirdParty", "SAME53", "CMSIS", "Device", "Include"),
]
)

env.Append(
CPPPATH=[
os.path.join(FRAMEWORK_DIR, "cores", "arduino", "api"),
os.path.join(FRAMEWORK_DIR, "cores", "arduino"),
os.path.join(FRAMEWORK_DIR, "variants", "clearcore"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this line because the code below it that checks for "is there a build.variant and if yes add it to the cpp path" already takes care of this:

if "build.variant" in board:
variants_dir = os.path.join(
"$PROJECT_DIR", board.get("build.variants_dir")) if board.get(
"build.variants_dir", "") else os.path.join(FRAMEWORK_DIR, "variants")
env.Append(
CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))]
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, the only line I don't need is 191? Or also the two first arduino lines?

so, this would be the result:

CPPPATH=[
    os.path.join(FRAMEWORK_DIR, "cores", "arduino", "api"),
    os.path.join(FRAMEWORK_DIR, "cores", "arduino"),
    os.path.join(FRAMEWORK_DIR, "Teknic", "LwIP", "LwIP", "port", "include"),
    os.path.join(FRAMEWORK_DIR, "Teknic", "LwIP", "LwIP", "src", "include"),
    os.path.join(FRAMEWORK_DIR, "Teknic", "libClearCore", "inc")
],

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, only os.path.join(FRAMEWORK_DIR, "variants", "clearcore"), is not needed.

os.path.join(FRAMEWORK_DIR, "Teknic", "LwIP", "LwIP", "port", "include"),
os.path.join(FRAMEWORK_DIR, "Teknic", "LwIP", "LwIP", "src", "include"),
os.path.join(FRAMEWORK_DIR, "Teknic", "libClearCore", "inc")
],

LIBPATH=[
os.path.join(FRAMEWORK_DIR, "Teknic", "libClearCore", "Release"),
os.path.join(FRAMEWORK_DIR, "Teknic", "LwIP", "Release")
],

LIBS=[
"ClearCore",
"LwIP"
]
)

#
# Target: Build Core Library
Expand Down
4 changes: 2 additions & 2 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def _jlink_cmd_script(env, source):
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES"
)
if board.get("build.core") in ("adafruit", "seeed", "sparkfun") and board.get(
"build.mcu").startswith(("samd51", "same51")):
if board.get("build.core") in ("adafruit", "seeed", "sparkfun", "clearcore") and board.get(
"build.mcu").startswith(("samd51", "same51", "same53")):
# special flags for the latest bossac tool
env.Append(
UPLOADERFLAGS=[
Expand Down
Loading