diff options
| author | Alexandros Liarokapis <[email protected]> | 2024-08-17 00:26:33 +0300 |
|---|---|---|
| committer | Alexandros Liarokapis <[email protected]> | 2024-08-17 16:54:41 +0300 |
| commit | 2b7e76efe9916170cba69da964d53c19a246ae45 (patch) | |
| tree | 10f1b8973e80af44dd81a65aad4f1e7456a3ca30 /embassy-stm32/src/rcc | |
| parent | 6d9ed4c0807c977aa6d3c852360d52128f8c459a (diff) | |
Fix dma nvic issues on dual core lines
This commit addresses #3256 by disabling dma NVIC interrupt enablement at startup.
Instead, per-channel NVIC interrupt enablement is now done with the rest of the dma channel configuration.
This ensures that each core will only handle the interrupts of the DMA channels that it uses.
Diffstat (limited to 'embassy-stm32/src/rcc')
| -rw-r--r-- | embassy-stm32/src/rcc/bd.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/c0.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/f013.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/f247.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/g0.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/g4.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/h.rs | 3 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/l.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/u5.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/wba.rs | 1 |
10 files changed, 15 insertions, 1 deletions
diff --git a/embassy-stm32/src/rcc/bd.rs b/embassy-stm32/src/rcc/bd.rs index 4e9c18594..9ccca8a2a 100644 --- a/embassy-stm32/src/rcc/bd.rs +++ b/embassy-stm32/src/rcc/bd.rs | |||
| @@ -16,6 +16,7 @@ pub enum LseMode { | |||
| 16 | Bypass, | 16 | Bypass, |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | #[derive(Clone, Copy)] | ||
| 19 | pub struct LseConfig { | 20 | pub struct LseConfig { |
| 20 | pub frequency: Hertz, | 21 | pub frequency: Hertz, |
| 21 | pub mode: LseMode, | 22 | pub mode: LseMode, |
| @@ -80,6 +81,7 @@ fn bdcr() -> Reg<Bdcr, RW> { | |||
| 80 | return crate::pac::RCC.csr1(); | 81 | return crate::pac::RCC.csr1(); |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 84 | #[derive(Clone, Copy)] | ||
| 83 | pub struct LsConfig { | 85 | pub struct LsConfig { |
| 84 | pub rtc: RtcClockSource, | 86 | pub rtc: RtcClockSource, |
| 85 | pub lsi: bool, | 87 | pub lsi: bool, |
diff --git a/embassy-stm32/src/rcc/c0.rs b/embassy-stm32/src/rcc/c0.rs index 5adf37941..6712aedc4 100644 --- a/embassy-stm32/src/rcc/c0.rs +++ b/embassy-stm32/src/rcc/c0.rs | |||
| @@ -37,6 +37,7 @@ pub struct Hsi { | |||
| 37 | 37 | ||
| 38 | /// Clocks configutation | 38 | /// Clocks configutation |
| 39 | #[non_exhaustive] | 39 | #[non_exhaustive] |
| 40 | #[derive(Clone, Copy)] | ||
| 40 | pub struct Config { | 41 | pub struct Config { |
| 41 | /// HSI Configuration | 42 | /// HSI Configuration |
| 42 | pub hsi: Option<Hsi>, | 43 | pub hsi: Option<Hsi>, |
diff --git a/embassy-stm32/src/rcc/f013.rs b/embassy-stm32/src/rcc/f013.rs index 63dc27bdd..60577b213 100644 --- a/embassy-stm32/src/rcc/f013.rs +++ b/embassy-stm32/src/rcc/f013.rs | |||
| @@ -76,6 +76,7 @@ pub enum HrtimClockSource { | |||
| 76 | 76 | ||
| 77 | /// Clocks configutation | 77 | /// Clocks configutation |
| 78 | #[non_exhaustive] | 78 | #[non_exhaustive] |
| 79 | #[derive(Clone, Copy)] | ||
| 79 | pub struct Config { | 80 | pub struct Config { |
| 80 | pub hsi: bool, | 81 | pub hsi: bool, |
| 81 | pub hse: Option<Hse>, | 82 | pub hse: Option<Hse>, |
diff --git a/embassy-stm32/src/rcc/f247.rs b/embassy-stm32/src/rcc/f247.rs index 61f687d30..58056301a 100644 --- a/embassy-stm32/src/rcc/f247.rs +++ b/embassy-stm32/src/rcc/f247.rs | |||
| @@ -63,6 +63,7 @@ pub struct Pll { | |||
| 63 | /// Used to calculate flash waitstates. See | 63 | /// Used to calculate flash waitstates. See |
| 64 | /// RM0033 - Table 3. Number of wait states according to Cortex®-M3 clock frequency | 64 | /// RM0033 - Table 3. Number of wait states according to Cortex®-M3 clock frequency |
| 65 | #[cfg(stm32f2)] | 65 | #[cfg(stm32f2)] |
| 66 | #[derive(Clone, Copy)] | ||
| 66 | pub enum VoltageScale { | 67 | pub enum VoltageScale { |
| 67 | /// 2.7 to 3.6 V | 68 | /// 2.7 to 3.6 V |
| 68 | Range0, | 69 | Range0, |
| @@ -76,6 +77,7 @@ pub enum VoltageScale { | |||
| 76 | 77 | ||
| 77 | /// Configuration of the core clocks | 78 | /// Configuration of the core clocks |
| 78 | #[non_exhaustive] | 79 | #[non_exhaustive] |
| 80 | #[derive(Clone, Copy)] | ||
| 79 | pub struct Config { | 81 | pub struct Config { |
| 80 | pub hsi: bool, | 82 | pub hsi: bool, |
| 81 | pub hse: Option<Hse>, | 83 | pub hse: Option<Hse>, |
diff --git a/embassy-stm32/src/rcc/g0.rs b/embassy-stm32/src/rcc/g0.rs index c2fa0ca39..c53c83b0e 100644 --- a/embassy-stm32/src/rcc/g0.rs +++ b/embassy-stm32/src/rcc/g0.rs | |||
| @@ -33,6 +33,7 @@ pub struct Hse { | |||
| 33 | /// Use this struct to configure the PLL source, input frequency, multiplication factor, and output | 33 | /// Use this struct to configure the PLL source, input frequency, multiplication factor, and output |
| 34 | /// dividers. Be sure to keep check the datasheet for your specific part for the appropriate | 34 | /// dividers. Be sure to keep check the datasheet for your specific part for the appropriate |
| 35 | /// frequency ranges for each of these settings. | 35 | /// frequency ranges for each of these settings. |
| 36 | #[derive(Clone, Copy)] | ||
| 36 | pub struct Pll { | 37 | pub struct Pll { |
| 37 | /// PLL Source clock selection. | 38 | /// PLL Source clock selection. |
| 38 | pub source: PllSource, | 39 | pub source: PllSource, |
| @@ -55,6 +56,7 @@ pub struct Pll { | |||
| 55 | 56 | ||
| 56 | /// Clocks configutation | 57 | /// Clocks configutation |
| 57 | #[non_exhaustive] | 58 | #[non_exhaustive] |
| 59 | #[derive(Clone, Copy)] | ||
| 58 | pub struct Config { | 60 | pub struct Config { |
| 59 | /// HSI Enable | 61 | /// HSI Enable |
| 60 | pub hsi: bool, | 62 | pub hsi: bool, |
diff --git a/embassy-stm32/src/rcc/g4.rs b/embassy-stm32/src/rcc/g4.rs index c261c0fed..16561f908 100644 --- a/embassy-stm32/src/rcc/g4.rs +++ b/embassy-stm32/src/rcc/g4.rs | |||
| @@ -32,6 +32,7 @@ pub struct Hse { | |||
| 32 | /// Use this struct to configure the PLL source, input frequency, multiplication factor, and output | 32 | /// Use this struct to configure the PLL source, input frequency, multiplication factor, and output |
| 33 | /// dividers. Be sure to keep check the datasheet for your specific part for the appropriate | 33 | /// dividers. Be sure to keep check the datasheet for your specific part for the appropriate |
| 34 | /// frequency ranges for each of these settings. | 34 | /// frequency ranges for each of these settings. |
| 35 | #[derive(Clone, Copy)] | ||
| 35 | pub struct Pll { | 36 | pub struct Pll { |
| 36 | /// PLL Source clock selection. | 37 | /// PLL Source clock selection. |
| 37 | pub source: PllSource, | 38 | pub source: PllSource, |
| @@ -54,6 +55,7 @@ pub struct Pll { | |||
| 54 | 55 | ||
| 55 | /// Clocks configutation | 56 | /// Clocks configutation |
| 56 | #[non_exhaustive] | 57 | #[non_exhaustive] |
| 58 | #[derive(Clone, Copy)] | ||
| 57 | pub struct Config { | 59 | pub struct Config { |
| 58 | /// HSI Enable | 60 | /// HSI Enable |
| 59 | pub hsi: bool, | 61 | pub hsi: bool, |
diff --git a/embassy-stm32/src/rcc/h.rs b/embassy-stm32/src/rcc/h.rs index e3c7dd158..376a0b454 100644 --- a/embassy-stm32/src/rcc/h.rs +++ b/embassy-stm32/src/rcc/h.rs | |||
| @@ -120,7 +120,7 @@ impl From<TimerPrescaler> for Timpre { | |||
| 120 | /// Power supply configuration | 120 | /// Power supply configuration |
| 121 | /// See RM0433 Rev 4 7.4 | 121 | /// See RM0433 Rev 4 7.4 |
| 122 | #[cfg(any(pwr_h7rm0399, pwr_h7rm0455, pwr_h7rm0468, pwr_h7rs))] | 122 | #[cfg(any(pwr_h7rm0399, pwr_h7rm0455, pwr_h7rm0468, pwr_h7rs))] |
| 123 | #[derive(PartialEq)] | 123 | #[derive(Clone, Copy, PartialEq)] |
| 124 | pub enum SupplyConfig { | 124 | pub enum SupplyConfig { |
| 125 | /// Default power supply configuration. | 125 | /// Default power supply configuration. |
| 126 | /// V CORE Power Domains are supplied from the LDO according to VOS. | 126 | /// V CORE Power Domains are supplied from the LDO according to VOS. |
| @@ -180,6 +180,7 @@ pub enum SMPSSupplyVoltage { | |||
| 180 | 180 | ||
| 181 | /// Configuration of the core clocks | 181 | /// Configuration of the core clocks |
| 182 | #[non_exhaustive] | 182 | #[non_exhaustive] |
| 183 | #[derive(Clone, Copy)] | ||
| 183 | pub struct Config { | 184 | pub struct Config { |
| 184 | pub hsi: Option<HSIPrescaler>, | 185 | pub hsi: Option<HSIPrescaler>, |
| 185 | pub hse: Option<Hse>, | 186 | pub hse: Option<Hse>, |
diff --git a/embassy-stm32/src/rcc/l.rs b/embassy-stm32/src/rcc/l.rs index e9266c65b..6120d33be 100644 --- a/embassy-stm32/src/rcc/l.rs +++ b/embassy-stm32/src/rcc/l.rs | |||
| @@ -30,6 +30,7 @@ pub struct Hse { | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | /// Clocks configuration | 32 | /// Clocks configuration |
| 33 | #[derive(Clone, Copy)] | ||
| 33 | pub struct Config { | 34 | pub struct Config { |
| 34 | // base clock sources | 35 | // base clock sources |
| 35 | pub msi: Option<MSIRange>, | 36 | pub msi: Option<MSIRange>, |
diff --git a/embassy-stm32/src/rcc/u5.rs b/embassy-stm32/src/rcc/u5.rs index d6331f512..28545ca51 100644 --- a/embassy-stm32/src/rcc/u5.rs +++ b/embassy-stm32/src/rcc/u5.rs | |||
| @@ -59,6 +59,7 @@ pub struct Pll { | |||
| 59 | pub divr: Option<PllDiv>, | 59 | pub divr: Option<PllDiv>, |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | #[derive(Clone, Copy)] | ||
| 62 | pub struct Config { | 63 | pub struct Config { |
| 63 | // base clock sources | 64 | // base clock sources |
| 64 | pub msi: Option<MSIRange>, | 65 | pub msi: Option<MSIRange>, |
diff --git a/embassy-stm32/src/rcc/wba.rs b/embassy-stm32/src/rcc/wba.rs index 8e1779d7c..1fee648d4 100644 --- a/embassy-stm32/src/rcc/wba.rs +++ b/embassy-stm32/src/rcc/wba.rs | |||
| @@ -15,6 +15,7 @@ pub struct Hse { | |||
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | /// Clocks configuration | 17 | /// Clocks configuration |
| 18 | #[derive(Clone, Copy)] | ||
| 18 | pub struct Config { | 19 | pub struct Config { |
| 19 | // base clock sources | 20 | // base clock sources |
| 20 | pub hsi: bool, | 21 | pub hsi: bool, |
