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 SAMD20J18A support #555

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions boards/samd20_xplained_pro/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[build]
target = "thumbv6m-none-eabi"

[target.thumbv6m-none-eabi]
runner = 'arm-none-eabi-gdb -q -x openocd.gdb'
#runner = 'probe-run --chip ATSAMD21G18A'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: even this is commented out, it's the wrong chip name


rustflags = [

# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95
"-C", "link-arg=--nmagic",

"-C", "link-arg=-Tlink.x",
]
40 changes: 40 additions & 0 deletions boards/samd20_xplained_pro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "samd20_xplained_pro"
version = "0.1.0"
authors = ["Kaizen Sparc <[email protected]>"]
description = "Board Support crate for the Microchip SAMD20 Xplained Pro eval board"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/atsamd-rs/atsamd"
readme = "README.md"
edition = "2018"

[dependencies.cortex-m-rt]
version = "0.7"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll want this to be a tier two board, so no path dependency

Copy link
Author

Choose a reason for hiding this comment

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

If I remove the path dependency, it will use the published crate which does not contains the current updates, how should I replace it?
Btw why does including this path makes it a Tier 1 dependency?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, good point... I think we'll need to leave it as a path dependency for now since it's new.

Tier one BSPs use path dependencies on the HAL, which means for any HAL change affecting BSPs, all Tier one BSPs must be upgraded in the same PR for CI to pass. Tier two BSPs only rely on released versions of the HAL/PACs, so they can be locked to an older version and updated if someone is interested in doing so. This lowers the burden on maintainers as well as folks looking to change the HAL. See the README for more details.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I understand now. Maybe we can remove the board implementation from this PR, and I open a new PR with it after this one is merged? (If yes, I would probably keep it until the end of the PR for practical reasons and remove it at the end :))

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, to facilitate development, one option is to use a patch in Cargo.toml . The idea would be to PR the changes that you want to eventually be published, but don't include the patch section which just refers to your local copy of atsamd-rs instead of the one on crates.io .

That said, it probably still makes sense to publish the PAC and HAL changes, before a separate PR to add the new boards.

version = "0.14"
default-features = false

[dev-dependencies]
cortex-m = "0.7"
panic-halt = "0.2"
panic-semihosting = "0.5"
cortex-m-semihosting = "0.3"
cortex-m-rtic = "0.5.1"

[features]
# ask the HAL to enable atsamd20j support
default = ["rt", "atsamd-hal/samd20j", "atsamd-hal/samd20"]
rt = ["cortex-m-rt", "atsamd-hal/samd20j-rt"]
unproven = ["atsamd-hal/unproven"]
use_semihosting = []

# for cargo flash
[package.metadata]
chip = "ATSAMD20J18"

[[example]]
name = "blinky_basic"
9 changes: 9 additions & 0 deletions boards/samd20_xplained_pro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Microchip SAMD20 Xplained Pro

This crate provides a type-safe API for working with the [Microchip SAMD20 Xplained Pro](https://www.microchip.com/en-us/development-tool/ATSAMD20-XPRO).

## Examples?

Check out the repository for examples:

https://github.com/atsamd-rs/atsamd/tree/master/boards/samd20_xplained_pro/examples
Loading