Skip to content

Commit

Permalink
Merge pull request #216 from Piroro-hs/memory_x
Browse files Browse the repository at this point in the history
Auto generate memory.x
  • Loading branch information
Sh3Rm4n committed Apr 29, 2021
2 parents 09b15bd + 18617af commit 31ca8a3
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 279 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# Devices only differ in memory size are commented out
mcu:
- stm32f301
- stm32f318
- stm32f301x6
- stm32f318x8
- stm32f302x6
# - stm32f302x8
- stm32f302xb
- stm32f302xc
# - stm32f302xc
- stm32f302xd
- stm32f302xe
- stm32f302x6
- stm32f302x8
# - stm32f302xe
- stm32f303x6
# - stm32f303x8
- stm32f303xb
- stm32f303xc
# - stm32f303xc
- stm32f303xd
- stm32f303xe
- stm32f303x6
- stm32f303x8
- stm32f373
- stm32f378
- stm32f334
- stm32f328
- stm32f358
- stm32f398
# - stm32f303xe
- stm32f328x8
- stm32f358xc
- stm32f398xe
- stm32f373x8
# - stm32f373xb
# - stm32f373xc
- stm32f378xc
- stm32f334x4
# - stm32f334x6
# - stm32f334x8
features: ["rt"]
include:
- mcu: stm32f303xc
features: rt,stm32-usbd
features: rt,can,stm32-usbd
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -47,7 +52,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features=${{ matrix.mcu }},${{ matrix.features }} --lib --examples
args: --features=${{ matrix.mcu }},ld,${{ matrix.features }} --lib --examples

# This is our MSRV. However this is only for documentation
# purposes and should be increased if newer features are used.
Expand All @@ -66,7 +71,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features=stm32f303xc,stm32-usbd,rt,can --lib --examples
args: --features=stm32f303xc,stm32-usbd,rt,can,ld --lib --examples

check-tests:
name: Check Tests
Expand All @@ -89,7 +94,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features=rt,defmt,${{ matrix.mcu }} --test ${{ matrix.test }}
args: --features=ld,defmt,${{ matrix.mcu }} --test ${{ matrix.test }}

clippy:
name: Clippy
Expand All @@ -107,7 +112,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: >
--features=stm32f303xc,rt,stm32-usbd,can --lib --examples
--features=stm32f303xc,ld,rt,stm32-usbd,can --lib --examples
-- -D warnings
rustfmt:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Enable better GPIO internal resistor configuration ([#189])
- Support for GPIO output slew rate configuration ([#189])
- Support for GPIO interrupts ([#189])
- `ld` feature, which enables the memory.x generation ([#216])

### Changed

Expand All @@ -26,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Delay based on systick no longer panics ([#203]) for to high values
and support longer delays ([#208])
- Long delay during ADC initialization ([#217])

### Breaking Changes

Expand All @@ -35,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
If the supplied frequency cannot be converted to `Hertz` the code
will `panic`. This will occur if the supplied `Megahertz` frequency
cannot fit into `u32::MAX` when converting to `Hertz` ([#192])
- You always required to select a sub-target for target chips ([#216])

```rust
// The supplied frequencies must be in `MHz`.
Expand Down Expand Up @@ -313,6 +316,8 @@ let clocks = rcc
[defmt]: https://github.com/knurling-rs/defmt
[filter]: https://defmt.ferrous-systems.com/filtering.html

[#217]: https://github.com/stm32-rs/stm32f3xx-hal/pull/217
[#216]: https://github.com/stm32-rs/stm32f3xx-hal/pull/216
[#211]: https://github.com/stm32-rs/stm32f3xx-hal/pull/211
[#210]: https://github.com/stm32-rs/stm32f3xx-hal/pull/210
[#208]: https://github.com/stm32-rs/stm32f3xx-hal/pull/208
Expand Down
96 changes: 62 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,67 @@ default = ["unproven"]
unproven = ["embedded-hal/unproven"]
device-selected = []
direct-call-deprecated = []
ld = []
rt = ["stm32f3/rt"]
can = ["embedded-hal-can"]

svd-f301 = ["stm32f3/stm32f301"]
svd-f302 = ["stm32f3/stm32f302"]
svd-f303 = ["stm32f3/stm32f303"]
svd-f373 = ["stm32f3/stm32f373"]
svd-f3x4 = ["stm32f3/stm32f3x4"]

mem-4 = []
mem-6 = []
mem-8 = []
mem-b = []
mem-c = []
mem-d = []
mem-e = []

gpio-f302 = []
gpio-f303 = []
gpio-f303e = []
gpio-f333 = []
gpio-f373 = []

# Any changes here should be mirrored in README.md, src/lib.rs, and
# Any changes here should be mirrored in README.md, build.rs, src/lib.rs, and
# .github/workflows/ci.yml.
stm32f301 = ["gpio-f302", "stm32f3/stm32f301", "device-selected"]
stm32f318 = ["gpio-f302", "stm32f3/stm32f301", "device-selected"]
stm32f302 = ["stm32f3/stm32f302", "direct-call-deprecated"]
stm32f302x6 = ["stm32f302", "gpio-f302", "device-selected"]
stm32f302x8 = ["stm32f302", "gpio-f302", "device-selected"]
stm32f302xb = ["stm32f302", "gpio-f303", "device-selected"]
stm32f302xc = ["stm32f302", "gpio-f303", "device-selected"]
stm32f302xd = ["stm32f302", "gpio-f303e", "device-selected"]
stm32f302xe = ["stm32f302", "gpio-f303e", "device-selected"]
stm32f303 = ["stm32f3/stm32f303", "direct-call-deprecated"]
stm32f303x6 = ["stm32f303", "gpio-f333", "device-selected"]
stm32f303x8 = ["stm32f303", "gpio-f333", "device-selected"]
stm32f303xb = ["stm32f303", "gpio-f303", "device-selected"]
stm32f303xc = ["stm32f303", "gpio-f303", "device-selected"]
stm32f303xd = ["stm32f303", "gpio-f303e", "device-selected"]
stm32f303xe = ["stm32f303", "gpio-f303e", "device-selected"]
stm32f328 = ["gpio-f333", "stm32f3/stm32f303", "device-selected"]
stm32f358 = ["gpio-f303", "stm32f3/stm32f303", "device-selected"]
stm32f398 = ["gpio-f303e", "stm32f3/stm32f303", "device-selected"]
stm32f373 = ["gpio-f373", "stm32f3/stm32f373", "device-selected"]
stm32f378 = ["gpio-f373", "stm32f3/stm32f373", "device-selected"]
stm32f334 = ["gpio-f333", "stm32f3/stm32f3x4", "device-selected"]
stm32f301 = ["svd-f301", "direct-call-deprecated"]
stm32f301x6 = ["stm32f301", "mem-6", "gpio-f302", "device-selected"]
stm32f301x8 = ["stm32f301", "mem-8", "gpio-f302", "device-selected"]
stm32f318 = ["svd-f301", "direct-call-deprecated"]
stm32f318x8 = ["stm32f318", "mem-8", "gpio-f302", "device-selected"]
stm32f302 = ["svd-f302", "direct-call-deprecated"]
stm32f302x6 = ["stm32f302", "mem-6", "gpio-f302", "device-selected"]
stm32f302x8 = ["stm32f302", "mem-8", "gpio-f302", "device-selected"]
stm32f302xb = ["stm32f302", "mem-b", "gpio-f303", "device-selected"]
stm32f302xc = ["stm32f302", "mem-c", "gpio-f303", "device-selected"]
stm32f302xd = ["stm32f302", "mem-d", "gpio-f303e", "device-selected"]
stm32f302xe = ["stm32f302", "mem-e", "gpio-f303e", "device-selected"]
stm32f303 = ["svd-f303", "direct-call-deprecated"]
stm32f303x6 = ["stm32f303", "mem-6", "gpio-f333", "device-selected"]
stm32f303x8 = ["stm32f303", "mem-8", "gpio-f333", "device-selected"]
stm32f303xb = ["stm32f303", "mem-b", "gpio-f303", "device-selected"]
stm32f303xc = ["stm32f303", "mem-c", "gpio-f303", "device-selected"]
stm32f303xd = ["stm32f303", "mem-d", "gpio-f303e", "device-selected"]
stm32f303xe = ["stm32f303", "mem-e", "gpio-f303e", "device-selected"]
stm32f328 = ["svd-f303", "direct-call-deprecated"]
stm32f328x8 = ["stm32f328", "mem-8", "gpio-f333", "device-selected"]
stm32f358 = ["svd-f303", "direct-call-deprecated"]
stm32f358xc = ["stm32f358", "mem-c", "gpio-f303", "device-selected"]
stm32f398 = ["svd-f303", "direct-call-deprecated"]
stm32f398xe = ["stm32f398", "mem-e", "gpio-f303e", "device-selected"]
stm32f373 = ["svd-f373", "direct-call-deprecated"]
stm32f373x8 = ["stm32f373", "mem-8", "gpio-f373", "device-selected"]
stm32f373xb = ["stm32f373", "mem-b", "gpio-f373", "device-selected"]
stm32f373xc = ["stm32f373", "mem-c", "gpio-f373", "device-selected"]
stm32f378 = ["svd-f373", "direct-call-deprecated"]
stm32f378xc = ["stm32f378", "mem-c", "gpio-f373", "device-selected"]
stm32f334 = ["svd-f3x4", "direct-call-deprecated"]
stm32f334x4 = ["stm32f334", "mem-4", "gpio-f333", "device-selected"]
stm32f334x6 = ["stm32f334", "mem-6", "gpio-f333", "device-selected"]
stm32f334x8 = ["stm32f334", "mem-8", "gpio-f333", "device-selected"]

defmt-default = ["defmt"]
defmt-trace = ["defmt"]
Expand All @@ -118,45 +146,45 @@ opt-level = "s"

[[example]]
name = "pwm"
required-features = ["stm32f303xc"]
required-features = ["ld", "stm32f303xc"]

[[example]]
name = "toggle"
required-features = ["rt", "stm32f303xc"]
required-features = ["ld", "stm32f303xc"]

[[example]]
name = "usb_serial"
required-features = ["rt", "stm32f303xc", "stm32-usbd"]
required-features = ["ld", "stm32f303xc", "stm32-usbd"]

[[example]]
name = "spi"
required-features = ["stm32f303"]
required-features = ["ld", "stm32f303"]

[[example]]
name = "can"
required-features = ["rt", "can", "stm32f303"]
required-features = ["ld", "can", "stm32f303"]

[[example]]
name = "serial_dma"
required-features = ["stm32f303"]
required-features = ["ld", "stm32f303"]

[[example]]
name = "adc"
required-features = ["stm32f303"]
required-features = ["ld", "stm32f303"]

[[example]]
name = "i2c_scanner"
required-features = ["stm32f303xc"]
required-features = ["ld", "stm32f303xc"]

[[example]]
name = "gpio_erased"
required-features = ["rt", "stm32f303xc"]
required-features = ["ld", "stm32f303xc"]

[[example]]
name = "gpio_interrupts"
required-features = ["rt", "stm32f303xc"]
required-features = ["ld", "rt", "stm32f303xc"]

[[test]]
name = "rcc"
required-features = ["rt", "defmt"]
required-features = ["ld", "defmt"]
harness = false

0 comments on commit 31ca8a3

Please sign in to comment.