diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 9ca3a1f91..0d7d5bf68 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Introduce `DmaRxStreamBuf` (#2242) - Implement `embedded_hal_async::delay::DelayNs` for `TIMGx` timers (#2084) - Added `Efuse::read_bit` (#2259) +- Added `Rtc::disable_rom_message_printing` (S3 and H2 only) (#2280) ### Changed diff --git a/esp-hal/src/rtc_cntl/mod.rs b/esp-hal/src/rtc_cntl/mod.rs index dd835eee2..ecfc08fed 100644 --- a/esp-hal/src/rtc_cntl/mod.rs +++ b/esp-hal/src/rtc_cntl/mod.rs @@ -392,6 +392,25 @@ impl<'d> Rtc<'d> { config.start_sleep(wakeup_triggers); config.finish_sleep(); } + + /// Temporarily disable log messages of the ROM bootloader. + /// + /// If you need to permanently disable the ROM bootloader messages, you'll + /// need to set the corresponding eFuse. + #[cfg(any(esp32s3, esp32h2))] + pub fn disable_rom_message_printing(&self) { + // Corresponding documentation: + // ESP32-S3: TRM v1.5 chapter 8.3 + // ESP32-H2: TRM v0.5 chapter 8.2.3 + + #[cfg(esp32s3)] + let rtc_cntl = unsafe { &*LPWR::ptr() }; + #[cfg(esp32h2)] + let rtc_cntl = unsafe { &*LP_AON::ptr() }; + rtc_cntl + .store4() + .modify(|r, w| unsafe { w.bits(r.bits() & 1) }); + } } impl<'d> crate::private::Sealed for Rtc<'d> {}