-
Hi, Not sure if this has been tested, but when I enable the watchdog timer on RTC like this, the firmware seems to be restarted. Do I miss configuration to prevent that? I use the RTC to sync the time over BLE and to get the device in deep sleep later Example: #![no_std]
#![no_main]
mod ble;
use embassy_executor::Spawner;
use esp_hal::{clock::CpuClock, rtc_cntl::{sleep::{RtcSleepConfig, TimerWakeupSource}, Rtc}, timer::timg::TimerGroup};
use esp_wifi::ble::controller::BleConnector;
use trouble_host::prelude::ExternalController;
use {esp_alloc as _, esp_backtrace as _};
use esp_println as _;
#[esp_hal_embassy::main]
async fn main(_spawner: Spawner) {
let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max()));
esp_alloc::heap_allocator!(size: 72 * 1024);
let timg0 = TimerGroup::new(peripherals.TIMG0);
let mut rtc = Rtc::new(peripherals.LPWR);
rtc.rwdt.enable(); // <-- this line seems to cause trouble, when I comment/remove it .. all works
let init = esp_wifi::init(
timg0.timer0,
esp_hal::rng::Rng::new(peripherals.RNG),
peripherals.RADIO_CLK,
)
.expect("Failed to initialize Bluetooth");
esp_hal_embassy::init(timg0.timer1);
let bluetooth = peripherals.BT;
let connector = BleConnector::new(&init, bluetooth);
let controller: ExternalController<_, 20> = ExternalController::new(connector);
ble::run(controller, &mut rtc).await;
} Logs
and so on .. keeps rebooting |
Beta Was this translation helpful? Give feedback.
Answered by
lulf
Jun 27, 2025
Replies: 1 comment 1 reply
-
I don't see any code that is feeding the watchdog, are you doing that? https://docs.rs/esp32-hal/latest/esp32_hal/prelude/trait._embedded_hal_watchdog_Watchdog.html#tymethod.feed |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Fristi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't see any code that is feeding the watchdog, are you doing that? https://docs.rs/esp32-hal/latest/esp32_hal/prelude/trait._embedded_hal_watchdog_Watchdog.html#tymethod.feed