mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-30 13:50:38 +00:00
Remove unnecessary riscv::interrupt::enable()
from examples (#936)
This commit is contained in:
parent
7084a380a6
commit
52da17075e
@ -13,7 +13,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -46,10 +45,6 @@ fn main() -> ! {
|
|||||||
RTC.borrow_ref_mut(cs).replace(rtc);
|
RTC.borrow_ref_mut(cs).replace(rtc);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
@ -27,7 +26,17 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
||||||
|
|
||||||
da.enable_sp_monitor(0x3fccee00, 0x3fcd0000);
|
extern "C" {
|
||||||
|
// top of stack
|
||||||
|
static mut _stack_start: u32;
|
||||||
|
// bottom of stack
|
||||||
|
static mut _stack_end: u32;
|
||||||
|
}
|
||||||
|
|
||||||
|
let stack_top = unsafe { &mut _stack_start } as *mut _ as u32;
|
||||||
|
let stack_bottom = unsafe { &mut _stack_end } as *mut _ as u32;
|
||||||
|
|
||||||
|
da.enable_sp_monitor(stack_bottom + 4096, stack_top);
|
||||||
|
|
||||||
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
||||||
|
|
||||||
@ -37,10 +46,6 @@ fn main() -> ! {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
eat_up_stack(0);
|
eat_up_stack(0);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -15,7 +15,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Delay,
|
Delay,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut delay = Delay::new(&clocks);
|
let mut delay = Delay::new(&clocks);
|
||||||
loop {
|
loop {
|
||||||
led.toggle().unwrap();
|
led.toggle().unwrap();
|
||||||
|
@ -14,7 +14,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -54,10 +53,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
||||||
|
@ -12,7 +12,6 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0},
|
peripherals::{self, Peripherals, TIMG0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
TIMER0.borrow_ref_mut(cs).replace(timer0);
|
TIMER0.borrow_ref_mut(cs).replace(timer0);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -46,10 +45,6 @@ fn main() -> ! {
|
|||||||
RTC.borrow_ref_mut(cs).replace(rtc);
|
RTC.borrow_ref_mut(cs).replace(rtc);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
@ -29,11 +28,21 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// top of stack
|
||||||
|
static mut _stack_start: u32;
|
||||||
|
// bottom of stack
|
||||||
|
static mut _stack_end: u32;
|
||||||
|
}
|
||||||
|
|
||||||
|
let stack_top = unsafe { &mut _stack_start } as *mut _ as u32;
|
||||||
|
let stack_bottom = unsafe { &mut _stack_end } as *mut _ as u32;
|
||||||
|
|
||||||
// uncomment the functionality you want to test
|
// uncomment the functionality you want to test
|
||||||
|
|
||||||
// da.enable_sp_monitor(0x3fcce000, 0x3fccffff);
|
da.enable_sp_monitor(stack_bottom + 4096, stack_top);
|
||||||
// da.enable_region0_monitor(0x3fcce000, 0x3fcce100, true, true);
|
// da.enable_region0_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
da.enable_region1_monitor(0x3fcce000, 0x3fcce100, true, true);
|
// da.enable_region1_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
|
|
||||||
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
||||||
|
|
||||||
@ -43,10 +52,6 @@ fn main() -> ! {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
eat_up_stack(0);
|
eat_up_stack(0);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -15,7 +15,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Delay,
|
Delay,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut delay = Delay::new(&clocks);
|
let mut delay = Delay::new(&clocks);
|
||||||
loop {
|
loop {
|
||||||
led.toggle().unwrap();
|
led.toggle().unwrap();
|
||||||
|
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -54,10 +53,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
||||||
|
@ -13,7 +13,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -53,10 +52,6 @@ fn main() -> ! {
|
|||||||
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Cpu,
|
Cpu,
|
||||||
UsbSerialJtag,
|
UsbSerialJtag,
|
||||||
@ -53,10 +52,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(
|
writeln!(
|
||||||
|
@ -14,7 +14,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
@ -29,11 +28,21 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// top of stack
|
||||||
|
static mut _stack_start: u32;
|
||||||
|
// bottom of stack
|
||||||
|
static mut _stack_end: u32;
|
||||||
|
}
|
||||||
|
|
||||||
|
let stack_top = unsafe { &mut _stack_start } as *mut _ as u32;
|
||||||
|
let stack_bottom = unsafe { &mut _stack_end } as *mut _ as u32;
|
||||||
|
|
||||||
// uncomment the functionality you want to test
|
// uncomment the functionality you want to test
|
||||||
|
|
||||||
// da.enable_sp_monitor(0x4087ee00, 0x40880000);
|
da.enable_sp_monitor(stack_bottom + 4096, stack_top);
|
||||||
// da.enable_region0_monitor(0x4087ee00, 0x4087ef00, true, true);
|
// da.enable_region0_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
da.enable_region1_monitor(0x4087ee00, 0x4087ef00, true, true);
|
// da.enable_region1_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
|
|
||||||
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
||||||
|
|
||||||
@ -43,10 +52,6 @@ fn main() -> ! {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
eat_up_stack(0);
|
eat_up_stack(0);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -15,7 +15,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Delay,
|
Delay,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut delay = Delay::new(&clocks);
|
let mut delay = Delay::new(&clocks);
|
||||||
loop {
|
loop {
|
||||||
led.toggle().unwrap();
|
led.toggle().unwrap();
|
||||||
|
@ -14,7 +14,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -54,10 +53,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
||||||
|
@ -13,7 +13,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -57,10 +56,6 @@ fn main() -> ! {
|
|||||||
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32c6_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Cpu,
|
Cpu,
|
||||||
UsbSerialJtag,
|
UsbSerialJtag,
|
||||||
@ -52,10 +51,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(
|
writeln!(
|
||||||
|
@ -14,7 +14,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
@ -29,19 +28,28 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG);
|
||||||
|
|
||||||
// Uncomment the functionality you want to test
|
extern "C" {
|
||||||
// We use a 0x1200 wide SP and 0x100 regions, and RAM ends at 0x40850000
|
// top of stack
|
||||||
|
static mut _stack_start: u32;
|
||||||
|
// bottom of stack
|
||||||
|
static mut _stack_end: u32;
|
||||||
|
}
|
||||||
|
|
||||||
|
let stack_top = unsafe { &mut _stack_start } as *mut _ as u32;
|
||||||
|
let stack_bottom = unsafe { &mut _stack_end } as *mut _ as u32;
|
||||||
|
|
||||||
|
// uncomment the functionality you want to test
|
||||||
|
|
||||||
// Monitor the SP so as to prevent stack overflow or erroneous push/pop. When
|
// Monitor the SP so as to prevent stack overflow or erroneous push/pop. When
|
||||||
// the SP exceeds the minimum or maximum threshold, the module will record the
|
// the SP exceeds the minimum or maximum threshold, the module will record the
|
||||||
// PC pointer and generate an interrupt
|
// PC pointer and generate an interrupt
|
||||||
// da.enable_sp_monitor(0x4084ee00, 0x40850000);
|
da.enable_sp_monitor(stack_bottom + 4096, stack_top);
|
||||||
|
|
||||||
// Monitor reads/writes performed by the CPU over data bus and peripheral bus
|
// Monitor reads/writes performed by the CPU over data bus and peripheral bus
|
||||||
// in a certain address space, i.e., memory region. Whenever the bus reads or
|
// in a certain address space, i.e., memory region. Whenever the bus reads or
|
||||||
// writes in the specified address space, an interrupt will be triggered
|
// writes in the specified address space, an interrupt will be triggered
|
||||||
// da.enable_region0_monitor(0x4084ee00, 0x4084ef00, true, true);
|
// da.enable_region0_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
da.enable_region1_monitor(0x4084ee00, 0x4084ef00, true, true);
|
// da.enable_region1_monitor(stack_bottom, stack_bottom + 4096, true, true);
|
||||||
|
|
||||||
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
critical_section::with(|cs| DA.borrow_ref_mut(cs).replace(da));
|
||||||
|
|
||||||
@ -51,10 +59,6 @@ fn main() -> ! {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
eat_up_stack(0);
|
eat_up_stack(0);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
@ -15,7 +15,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Delay,
|
Delay,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
interrupt::enable(peripherals::Interrupt::GPIO, interrupt::Priority::Priority3).unwrap();
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut delay = Delay::new(&clocks);
|
let mut delay = Delay::new(&clocks);
|
||||||
loop {
|
loop {
|
||||||
led.toggle().unwrap();
|
led.toggle().unwrap();
|
||||||
|
@ -14,7 +14,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
@ -40,10 +39,6 @@ fn main() -> ! {
|
|||||||
|
|
||||||
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -54,10 +53,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
writeln!(SERIAL.borrow_ref_mut(cs).as_mut().unwrap(), "Hello World! Send a single `#` character or send at least 30 characters and see the interrupts trigger.").ok();
|
||||||
|
@ -13,7 +13,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
@ -57,10 +56,6 @@ fn main() -> ! {
|
|||||||
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
TIMER1.borrow_ref_mut(cs).replace(timer1);
|
||||||
});
|
});
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ use esp32h2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
riscv,
|
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Cpu,
|
Cpu,
|
||||||
UsbSerialJtag,
|
UsbSerialJtag,
|
||||||
@ -52,10 +51,6 @@ fn main() -> ! {
|
|||||||
interrupt::InterruptKind::Edge,
|
interrupt::InterruptKind::Edge,
|
||||||
);
|
);
|
||||||
|
|
||||||
unsafe {
|
|
||||||
riscv::interrupt::enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
writeln!(
|
writeln!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user