70e4418df9
781: embassy-net v2 r=Dirbaio a=Dirbaio - No more `dyn` - It's no longer a global singleton, you can create muliple net stacks at once. - You can't tear them down though, the Device it still has to be `'static` due to restrictions with smoltcp's "fake GAT" in the Device trait. :( - Removed `_embassy_rand` hack, random seed is passed on creation. 785: stm32: g0: add PLL clock source r=Dirbaio a=willglynn STM32G0 SYSCLK can be sourced from PLLRCLK. Given that the HSI runs at 16 MHz and the HSE range is 4-48 MHz, the PLL is the only way to reach 64 MHz. This commit adds `ClockSrc::PLL`. The PLL sources from either HSI16 or HSE, divides it by `m`, and locks its VCO to multiple `n`. It then divides the VCO by `r`, `p`, and `q` to produce up to three associated clock signals: * PLLRCLK is one of the inputs on the SYSCLK mux. This is the main reason the user will configure the PLL, so `r` is mandatory and the output is enabled unconditionally. * PLLPCLK is available as a clock source for the ADC and I2S peripherals, so `p` is optional and the output is conditional. * PLLQCLK exists only on STM32G0B0xx, and exists only to feed the MCO and MCO2 peripherals, so `q` is optional and the output is conditional. When the user specifies `ClockSrc::PLL(PllConfig)`, `rcc::init()` calls `PllConfig::init()` which initializes the PLL per [RM0454]. It disables the PLL, waits for it to stop, enables the source oscillator, configures the PLL, waits for it to lock, and then enables the appropriate outputs. `rcc::init()` then switches the clock source to PLLRCLK. `rcc::init()` is now also resonsible for calculating and setting flash wait states. SYSCLCK < 24 MHz is fine in the reset state, but 24-48 MHz requires waiting 1 cycle and 48-64 MHz requires waiting 2 cycles. (This was likely a blocker for anyone using HSE >= 24 MHz, with or without the PLL.) Flash accesses are now automatically slowed down as needed before changing the clock source, and sped up as permitted after changing the clock source. The number of flash wait states also determines if flash prefetching will be profitable, so that is now handled automatically too. [RM0454]: https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> Co-authored-by: Will Glynn <will@willglynn.com>
67 lines
1.8 KiB
TOML
67 lines
1.8 KiB
TOML
[package]
|
|
authors = ["Dario Nieuwenhuis <dirbaio@dirbaio.net>"]
|
|
edition = "2018"
|
|
name = "embassy-stm32h7-examples"
|
|
version = "0.1.0"
|
|
resolver = "2"
|
|
|
|
[dependencies]
|
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits"] }
|
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
|
|
embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] }
|
|
embedded-io = { version = "0.3.0", features = ["async"] }
|
|
|
|
defmt = "0.3"
|
|
defmt-rtt = "0.3"
|
|
|
|
cortex-m = "0.7.3"
|
|
cortex-m-rt = "0.7.0"
|
|
embedded-hal = "0.2.6"
|
|
embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" }
|
|
embedded-hal-async = { version = "0.1.0-alpha.1" }
|
|
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
|
futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
|
|
heapless = { version = "0.7.5", default-features = false }
|
|
rand_core = "0.6.3"
|
|
critical-section = "0.2.5"
|
|
micromath = "2.0.0"
|
|
stm32-fmc = "0.2.4"
|
|
embedded-storage = "0.3.0"
|
|
|
|
# cargo build/run
|
|
[profile.dev]
|
|
codegen-units = 1
|
|
debug = 2
|
|
debug-assertions = true # <-
|
|
incremental = false
|
|
opt-level = 3 # <-
|
|
overflow-checks = true # <-
|
|
|
|
# cargo test
|
|
[profile.test]
|
|
codegen-units = 1
|
|
debug = 2
|
|
debug-assertions = true # <-
|
|
incremental = false
|
|
opt-level = 3 # <-
|
|
overflow-checks = true # <-
|
|
|
|
# cargo build/run --release
|
|
[profile.release]
|
|
codegen-units = 1
|
|
debug = 2
|
|
debug-assertions = false # <-
|
|
incremental = false
|
|
lto = 'fat'
|
|
opt-level = 3 # <-
|
|
overflow-checks = false # <-
|
|
|
|
# cargo test --release
|
|
[profile.bench]
|
|
codegen-units = 1
|
|
debug = 2
|
|
debug-assertions = false # <-
|
|
incremental = false
|
|
lto = 'fat'
|
|
opt-level = 3 # <-
|
|
overflow-checks = false # <-
|