Use Dbgmcu::enable_all()
in stm32f4 examples
This commit is contained in:
parent
5ac91933ff
commit
57eecd4292
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#[path = "../example_common.rs"]
|
#[path = "../example_common.rs"]
|
||||||
mod example_common;
|
mod example_common;
|
||||||
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::pac;
|
|
||||||
use embedded_hal::digital::v2::OutputPin;
|
use embedded_hal::digital::v2::OutputPin;
|
||||||
use example_common::*;
|
use example_common::*;
|
||||||
|
|
||||||
@ -20,11 +20,7 @@ fn main() -> ! {
|
|||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
pac::DBGMCU.cr().modify(|w| {
|
Dbgmcu::enable_all();
|
||||||
w.set_dbg_sleep(true);
|
|
||||||
w.set_dbg_standby(true);
|
|
||||||
w.set_dbg_stop(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let p = embassy_stm32::init(Default::default());
|
let p = embassy_stm32::init(Default::default());
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
#[path = "../example_common.rs"]
|
#[path = "../example_common.rs"]
|
||||||
mod example_common;
|
mod example_common;
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||||
use embassy_stm32::pac;
|
|
||||||
use embedded_hal::digital::v2::{InputPin, OutputPin};
|
use embedded_hal::digital::v2::{InputPin, OutputPin};
|
||||||
use example_common::*;
|
use example_common::*;
|
||||||
|
|
||||||
@ -19,11 +19,7 @@ fn main() -> ! {
|
|||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
pac::DBGMCU.cr().modify(|w| {
|
Dbgmcu::enable_all();
|
||||||
w.set_dbg_sleep(true);
|
|
||||||
w.set_dbg_standby(true);
|
|
||||||
w.set_dbg_stop(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let p = embassy_stm32::init(Default::default());
|
let p = embassy_stm32::init(Default::default());
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
mod example_common;
|
mod example_common;
|
||||||
use embassy::executor::Executor;
|
use embassy::executor::Executor;
|
||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
|
use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
|
||||||
@ -42,11 +43,7 @@ fn main() -> ! {
|
|||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
pac::DBGMCU.cr().modify(|w| {
|
Dbgmcu::enable_all();
|
||||||
w.set_dbg_sleep(true);
|
|
||||||
w.set_dbg_standby(true);
|
|
||||||
w.set_dbg_stop(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
// EXTI clock
|
// EXTI clock
|
||||||
pac::RCC.apb2enr().modify(|w| {
|
pac::RCC.apb2enr().modify(|w| {
|
||||||
|
@ -15,7 +15,6 @@ use example_common::*;
|
|||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy_stm32::dbgmcu::Dbgmcu;
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::pac;
|
|
||||||
use embassy_stm32::spi::{Config, Spi};
|
use embassy_stm32::spi::{Config, Spi};
|
||||||
use embassy_stm32::time::Hertz;
|
use embassy_stm32::time::Hertz;
|
||||||
use embedded_hal::blocking::spi::Transfer;
|
use embedded_hal::blocking::spi::Transfer;
|
||||||
|
@ -11,12 +11,12 @@ mod example_common;
|
|||||||
use cortex_m::prelude::_embedded_hal_blocking_serial_Write;
|
use cortex_m::prelude::_embedded_hal_blocking_serial_Write;
|
||||||
use embassy::executor::Executor;
|
use embassy::executor::Executor;
|
||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use example_common::*;
|
use example_common::*;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy_stm32::pac;
|
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn main_task() {
|
async fn main_task() {
|
||||||
@ -42,11 +42,7 @@ fn main() -> ! {
|
|||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
pac::DBGMCU.cr().modify(|w| {
|
Dbgmcu::enable_all();
|
||||||
w.set_dbg_sleep(true);
|
|
||||||
w.set_dbg_standby(true);
|
|
||||||
w.set_dbg_stop(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let executor = EXECUTOR.put(Executor::new());
|
let executor = EXECUTOR.put(Executor::new());
|
||||||
|
@ -12,8 +12,8 @@ use core::fmt::Write;
|
|||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy::executor::Executor;
|
use embassy::executor::Executor;
|
||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::pac;
|
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use embassy_traits::uart::Write as _;
|
use embassy_traits::uart::Write as _;
|
||||||
use example_common::*;
|
use example_common::*;
|
||||||
@ -42,20 +42,7 @@ fn main() -> ! {
|
|||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
pac::DBGMCU.cr().modify(|w| {
|
Dbgmcu::enable_all();
|
||||||
w.set_dbg_sleep(true);
|
|
||||||
w.set_dbg_standby(true);
|
|
||||||
w.set_dbg_stop(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
pac::RCC.ahb1enr().modify(|w| {
|
|
||||||
w.set_gpioaen(true);
|
|
||||||
w.set_gpioben(true);
|
|
||||||
w.set_gpiocen(true);
|
|
||||||
w.set_gpioden(true);
|
|
||||||
w.set_gpioeen(true);
|
|
||||||
w.set_gpiofen(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let executor = EXECUTOR.put(Executor::new());
|
let executor = EXECUTOR.put(Executor::new());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user