diff options
| -rw-r--r-- | embassy-executor/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-executor/src/raw/trace.rs | 2 | ||||
| -rw-r--r-- | embassy-mspm0/CHANGELOG.md | 3 | ||||
| -rw-r--r-- | embassy-mspm0/build.rs | 11 | ||||
| -rw-r--r-- | embassy-stm32/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/ringbuffered.rs | 34 |
6 files changed, 28 insertions, 25 deletions
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index ecc4b6338..e500833c0 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -30,6 +30,7 @@ build = [ | |||
| 30 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "embassy-time-driver", "scheduler-deadline"]}, | 30 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "embassy-time-driver", "scheduler-deadline"]}, |
| 31 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "scheduler-priority", "scheduler-deadline"]}, | 31 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "scheduler-priority", "scheduler-deadline"]}, |
| 32 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "scheduler-deadline"]}, | 32 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "scheduler-deadline"]}, |
| 33 | {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread", "embassy-time-driver", "scheduler-priority", "scheduler-deadline", "trace"]}, | ||
| 33 | {target = "thumbv7em-none-eabi", features = ["arch-spin"]}, | 34 | {target = "thumbv7em-none-eabi", features = ["arch-spin"]}, |
| 34 | {target = "thumbv7em-none-eabi", features = ["arch-spin", "scheduler-deadline"]}, | 35 | {target = "thumbv7em-none-eabi", features = ["arch-spin", "scheduler-deadline"]}, |
| 35 | {target = "armv7a-none-eabi", features = ["arch-cortex-ar", "executor-thread"]}, | 36 | {target = "armv7a-none-eabi", features = ["arch-cortex-ar", "executor-thread"]}, |
| @@ -37,6 +38,7 @@ build = [ | |||
| 37 | {target = "armv7r-none-eabihf", features = ["arch-cortex-ar", "executor-thread"]}, | 38 | {target = "armv7r-none-eabihf", features = ["arch-cortex-ar", "executor-thread"]}, |
| 38 | {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32"]}, | 39 | {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32"]}, |
| 39 | {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread"]}, | 40 | {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread"]}, |
| 41 | {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread", "trace"]}, | ||
| 40 | # Nightly builds | 42 | # Nightly builds |
| 41 | {group = "nightly", target = "thumbv7em-none-eabi", features = ["nightly"]}, | 43 | {group = "nightly", target = "thumbv7em-none-eabi", features = ["nightly"]}, |
| 42 | {group = "nightly", target = "thumbv7em-none-eabi", features = ["nightly", "log"]}, | 44 | {group = "nightly", target = "thumbv7em-none-eabi", features = ["nightly", "log"]}, |
diff --git a/embassy-executor/src/raw/trace.rs b/embassy-executor/src/raw/trace.rs index 74519b927..830162039 100644 --- a/embassy-executor/src/raw/trace.rs +++ b/embassy-executor/src/raw/trace.rs | |||
| @@ -169,7 +169,7 @@ impl TaskTracker { | |||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | #[cfg(feature = "trace")] | 171 | #[cfg(feature = "trace")] |
| 172 | extern "Rust" { | 172 | unsafe extern "Rust" { |
| 173 | /// This callback is called when the executor begins polling. This will always | 173 | /// This callback is called when the executor begins polling. This will always |
| 174 | /// be paired with a later call to `_embassy_trace_executor_idle`. | 174 | /// be paired with a later call to `_embassy_trace_executor_idle`. |
| 175 | /// | 175 | /// |
diff --git a/embassy-mspm0/CHANGELOG.md b/embassy-mspm0/CHANGELOG.md index fcb0f9dbd..d9910a7ab 100644 --- a/embassy-mspm0/CHANGELOG.md +++ b/embassy-mspm0/CHANGELOG.md | |||
| @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 7 | 7 | ||
| 8 | <!-- next-header --> | 8 | <!-- next-header --> |
| 9 | ## Unreleased - ReleaseDate | 9 | ## Unreleased - ReleaseDate |
| 10 | 10 | ||
| 11 | - feat: Add I2C Controller (blocking & async) + examples for mspm0l1306, mspm0g3507 (tested MCUs) (#4435) | 11 | - feat: Add I2C Controller (blocking & async) + examples for mspm0l1306, mspm0g3507 (tested MCUs) (#4435) |
| 12 | - fix gpio interrupt not being set for mspm0l110x | 12 | - fix gpio interrupt not being set for mspm0l110x |
| 13 | - feat: Add window watchdog implementation based on WWDT0, WWDT1 peripherals (#4574) | 13 | - feat: Add window watchdog implementation based on WWDT0, WWDT1 peripherals (#4574) |
| @@ -17,3 +17,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 17 | - fix: add MSPM0C1106 to build test matrix | 17 | - fix: add MSPM0C1106 to build test matrix |
| 18 | - feat: add MSPM0H3216 support | 18 | - feat: add MSPM0H3216 support |
| 19 | - feat: Add i2c target implementation (#4605) | 19 | - feat: Add i2c target implementation (#4605) |
| 20 | - fix: group irq handlers must check for NO_INTR (#4785) | ||
diff --git a/embassy-mspm0/build.rs b/embassy-mspm0/build.rs index 1d118ad66..4942364aa 100644 --- a/embassy-mspm0/build.rs +++ b/embassy-mspm0/build.rs | |||
| @@ -194,8 +194,15 @@ fn generate_groups() -> TokenStream { | |||
| 194 | use crate::pac::#group_enum; | 194 | use crate::pac::#group_enum; |
| 195 | 195 | ||
| 196 | let group = crate::pac::CPUSS.int_group(#group_number); | 196 | let group = crate::pac::CPUSS.int_group(#group_number); |
| 197 | // MUST subtract by 1 since 0 is NO_INTR | 197 | let stat = group.iidx().read().stat(); |
| 198 | let iidx = group.iidx().read().stat().to_bits() - 1; | 198 | |
| 199 | // check for spurious interrupts | ||
| 200 | if stat == crate::pac::cpuss::vals::Iidx::NO_INTR { | ||
| 201 | return; | ||
| 202 | } | ||
| 203 | |||
| 204 | // MUST subtract by 1 because NO_INTR offsets IIDX values. | ||
| 205 | let iidx = stat.to_bits() - 1; | ||
| 199 | 206 | ||
| 200 | let Ok(group) = #group_enum::try_from(iidx as u8) else { | 207 | let Ok(group) = #group_enum::try_from(iidx as u8) else { |
| 201 | return; | 208 | return; |
diff --git a/embassy-stm32/CHANGELOG.md b/embassy-stm32/CHANGELOG.md index d6d67209d..8b215f13b 100644 --- a/embassy-stm32/CHANGELOG.md +++ b/embassy-stm32/CHANGELOG.md | |||
| @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 37 | - change: stm32/uart: BufferedUartRx now returns all available bytes from the internal buffer | 37 | - change: stm32/uart: BufferedUartRx now returns all available bytes from the internal buffer |
| 38 | - change: timer: added output compare values | 38 | - change: timer: added output compare values |
| 39 | - feat: timer: add ability to set master mode | 39 | - feat: timer: add ability to set master mode |
| 40 | - fix: usart: fix race condition in ringbuffered usart | ||
| 40 | - feat: Add I2C MultiMaster (Slave) support for I2C v1 | 41 | - feat: Add I2C MultiMaster (Slave) support for I2C v1 |
| 41 | 42 | ||
| 42 | ## 0.4.0 - 2025-08-26 | 43 | ## 0.4.0 - 2025-08-26 |
diff --git a/embassy-stm32/src/usart/ringbuffered.rs b/embassy-stm32/src/usart/ringbuffered.rs index 20bfefd9e..bac570d27 100644 --- a/embassy-stm32/src/usart/ringbuffered.rs +++ b/embassy-stm32/src/usart/ringbuffered.rs | |||
| @@ -7,7 +7,9 @@ use embassy_embedded_hal::SetConfig; | |||
| 7 | use embedded_io_async::ReadReady; | 7 | use embedded_io_async::ReadReady; |
| 8 | use futures_util::future::{Either, select}; | 8 | use futures_util::future::{Either, select}; |
| 9 | 9 | ||
| 10 | use super::{Config, ConfigError, Error, Info, State, UartRx, rdr, reconfigure, set_baudrate, sr}; | 10 | use super::{ |
| 11 | Config, ConfigError, Error, Info, State, UartRx, clear_interrupt_flags, rdr, reconfigure, set_baudrate, sr, | ||
| 12 | }; | ||
| 11 | use crate::Peri; | 13 | use crate::Peri; |
| 12 | use crate::dma::ReadableRingBuffer; | 14 | use crate::dma::ReadableRingBuffer; |
| 13 | use crate::gpio::{AnyPin, SealedPin as _}; | 15 | use crate::gpio::{AnyPin, SealedPin as _}; |
| @@ -338,26 +340,16 @@ impl Drop for RingBufferedUartRx<'_> { | |||
| 338 | /// For usart_v1 and usart_v2, all status flags must be handled together anyway because all flags | 340 | /// For usart_v1 and usart_v2, all status flags must be handled together anyway because all flags |
| 339 | /// are cleared by a single read to the RDR register. | 341 | /// are cleared by a single read to the RDR register. |
| 340 | fn check_idle_and_errors(r: Regs) -> Result<bool, Error> { | 342 | fn check_idle_and_errors(r: Regs) -> Result<bool, Error> { |
| 341 | // Critical section is required so that the flags aren't set after read and before clear | 343 | // SAFETY: read only and we only use Rx related flags |
| 342 | let sr = critical_section::with(|_| { | 344 | let sr = sr(r).read(); |
| 343 | // SAFETY: read only and we only use Rx related flags | 345 | |
| 344 | let sr = sr(r).read(); | 346 | #[cfg(not(any(usart_v3, usart_v4)))] |
| 345 | 347 | unsafe { | |
| 346 | #[cfg(any(usart_v3, usart_v4))] | 348 | // This read also clears the error and idle interrupt flags on v1 (TODO and v2?) |
| 347 | r.icr().write(|w| { | 349 | rdr(r).read_volatile() |
| 348 | w.set_idle(true); | 350 | }; |
| 349 | w.set_pe(true); | 351 | clear_interrupt_flags(r, sr); |
| 350 | w.set_fe(true); | 352 | |
| 351 | w.set_ne(true); | ||
| 352 | w.set_ore(true); | ||
| 353 | }); | ||
| 354 | #[cfg(not(any(usart_v3, usart_v4)))] | ||
| 355 | unsafe { | ||
| 356 | // This read also clears the error and idle interrupt flags on v1 (TODO and v2?) | ||
| 357 | rdr(r).read_volatile() | ||
| 358 | }; | ||
| 359 | sr | ||
| 360 | }); | ||
| 361 | if sr.pe() { | 353 | if sr.pe() { |
| 362 | Err(Error::Parity) | 354 | Err(Error::Parity) |
| 363 | } else if sr.fe() { | 355 | } else if sr.fe() { |
