-
Notifications
You must be signed in to change notification settings - Fork 118
Add support for Teknic ClearCore #215
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
base: develop
Are you sure you want to change the base?
Changes from 7 commits
c799fa8
55848fd
3b20918
226a81b
acaf56f
090389e
1718730
a11f840
5ec33fd
c43ec8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" | ||
| ] | ||
| ], | ||
| "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" | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -143,6 +143,13 @@ | |||||||||||||||||
| ] | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| if VENDOR_CORE == "clearcore": | ||||||||||||||||||
| env.Append( | ||||||||||||||||||
| CPPDEFINES=[ | ||||||||||||||||||
| ("USB_CONFIG_POWER", board.get("build.usb_power", 0)) | ||||||||||||||||||
| ], | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| # | ||||||||||||||||||
| # Vendor-specific configurations | ||||||||||||||||||
| # | ||||||||||||||||||
|
|
@@ -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"), | ||||||||||||||||||
|
||||||||||||||||||
| 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"))] | |
| ) |
There was a problem hiding this comment.
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")
],
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.