From dc59f7b7777e74817d4d323cf5999a7d33a8bb40 Mon Sep 17 00:00:00 2001 From: Robert Wiewel Date: Mon, 28 Feb 2022 08:47:37 +0100 Subject: [PATCH] Don't disable RWDT boot protection in RAM examples --- esp32-hal/examples/ram.rs | 7 +++---- esp32c3-hal/examples/ram.rs | 5 +++-- esp32s2-hal/examples/ram.rs | 7 +++---- esp32s3-hal/examples/ram.rs | 7 +++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/esp32-hal/examples/ram.rs b/esp32-hal/examples/ram.rs index 950b571a4..5a27b5e8a 100644 --- a/esp32-hal/examples/ram.rs +++ b/esp32-hal/examples/ram.rs @@ -7,7 +7,6 @@ use esp32_hal::{ pac::{Peripherals, UART0}, prelude::*, ram, - RtcCntl, Serial, Timer, }; @@ -30,11 +29,11 @@ fn main() -> ! { let mut timer0 = Timer::new(peripherals.TIMG0); let mut serial0 = Serial::new(peripherals.UART0).unwrap(); - let mut rtc_cntl = RtcCntl::new(peripherals.RTC_CNTL); - // Disable MWDT and RWDT (Watchdog) flash boot protection + // Disable MWDT flash boot protection timer0.disable(); - rtc_cntl.set_wdt_global_enable(false); + // The RWDT flash boot protection remains enabled and it being triggered is part + // of the example timer0.start(10_000_000u64); diff --git a/esp32c3-hal/examples/ram.rs b/esp32c3-hal/examples/ram.rs index f0d51cbab..ce709b72e 100644 --- a/esp32c3-hal/examples/ram.rs +++ b/esp32c3-hal/examples/ram.rs @@ -29,9 +29,10 @@ fn main() -> ! { let mut timer0 = Timer::new(peripherals.TIMG0); let mut serial0 = Serial::new(peripherals.UART0).unwrap(); - // don't disable WDTs ... we actually want it getting triggered in this example - + // Disable MWDT and RWDT (Watchdog) flash boot protection timer0.disable(); + // The RWDT flash boot protection remains enabled and it being triggered is part + // of the example timer0.start(10_000_000u64); diff --git a/esp32s2-hal/examples/ram.rs b/esp32s2-hal/examples/ram.rs index 3d1abd416..8b82a501a 100644 --- a/esp32s2-hal/examples/ram.rs +++ b/esp32s2-hal/examples/ram.rs @@ -7,7 +7,6 @@ use esp32s2_hal::{ pac::{Peripherals, UART0}, prelude::*, ram, - RtcCntl, Serial, Timer, }; @@ -29,12 +28,12 @@ fn main() -> ! { let peripherals = Peripherals::take().unwrap(); let mut timer0 = Timer::new(peripherals.TIMG0); - let mut rtc_cntl = RtcCntl::new(peripherals.RTC_CNTL); let mut serial0 = Serial::new(peripherals.UART0).unwrap(); - // Disable MWDT and RWDT (Watchdog) flash boot protection + // Disable MWDT flash boot protection timer0.disable(); - rtc_cntl.set_wdt_global_enable(false); + // The RWDT flash boot protection remains enabled and it being triggered is part + // of the example timer0.start(10_000_000u64); diff --git a/esp32s3-hal/examples/ram.rs b/esp32s3-hal/examples/ram.rs index 6eaa52075..cee69e979 100644 --- a/esp32s3-hal/examples/ram.rs +++ b/esp32s3-hal/examples/ram.rs @@ -7,7 +7,6 @@ use esp32s3_hal::{ pac::{Peripherals, UART0}, prelude::*, ram, - RtcCntl, Serial, Timer, }; @@ -29,12 +28,12 @@ fn main() -> ! { let peripherals = Peripherals::take().unwrap(); let mut timer0 = Timer::new(peripherals.TIMG0); - let mut rtc_cntl = RtcCntl::new(peripherals.RTC_CNTL); let mut serial0 = Serial::new(peripherals.UART0).unwrap(); - // Disable MWDT and RWDT (Watchdog) flash boot protection + // Disable MWDT flash boot protection timer0.disable(); - rtc_cntl.set_wdt_global_enable(false); + // The RWDT flash boot protection remains enabled and it being triggered is part + // of the example timer0.start(10_000_000u64);