refine panic handler and add some logging info
This commit is contained in:
parent
6cd5c4182a
commit
18a8053cab
@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
* Const generics, bumping the MSRV to 1.51.0
|
* Const generics, bumping the MSRV to 1.51.0
|
||||||
* `lockin-internal` and `lockin-external` have been merged into `lockin`
|
* `lockin-internal` and `lockin-external` have been merged into `lockin`
|
||||||
* Default target CPU is cortex-m7, effective bumping the MSRV to 1.52.0
|
* Set target CPU to cortex-m7, effectively bumping the MSRV to 1.52.0
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
## Applications
|
## Applications
|
||||||
|
|
||||||
This firmware offers a library of hardware and software functionality targeting the use of the Stabilizer hardware in various digital signal processing applications commonly occurring in Quantum Technology applications.
|
This firmware offers a library of hardware and software functionality targeting the use of the Stabilizer hardware in various digital signal processing applications commonly occurring in Quantum Technology.
|
||||||
It provides abstractions over the fast analog inputs and outputs, time stamping, Pounder DDS interfaces and a collection of tailored and optimized digital signal processing algorithms (IIR, FIR, Lockin, PLL, reciprocal PLL, Unwrapper, Lowpass, Cosine-Sine, Atan2).
|
It provides abstractions over the fast analog inputs and outputs, time stamping, Pounder DDS interfaces and a collection of tailored and optimized digital signal processing algorithms (IIR, FIR, Lockin, PLL, reciprocal PLL, Unwrapper, Lowpass, Cosine-Sine, Atan2).
|
||||||
An application can compose and configure these hardware and software components to implement different use cases.
|
An application can compose and configure these hardware and software components to implement different use cases.
|
||||||
Several applications are provides by default:
|
Several applications are provides by default:
|
||||||
|
@ -157,7 +157,7 @@ pub fn setup(
|
|||||||
log::set_logger(&LOGGER)
|
log::set_logger(&LOGGER)
|
||||||
.map(|()| log::set_max_level(log::LevelFilter::Trace))
|
.map(|()| log::set_max_level(log::LevelFilter::Trace))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
log::info!("Starting...");
|
log::info!("starting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the system timer for RTIC scheduling.
|
// Set up the system timer for RTIC scheduling.
|
||||||
@ -537,6 +537,7 @@ pub fn setup(
|
|||||||
&mut eeprom_i2c,
|
&mut eeprom_i2c,
|
||||||
&mut delay,
|
&mut delay,
|
||||||
));
|
));
|
||||||
|
log::info!("EUI48: {}", mac_addr);
|
||||||
|
|
||||||
let network_devices = {
|
let network_devices = {
|
||||||
// Configure the ethernet controller
|
// Configure the ethernet controller
|
||||||
@ -673,6 +674,7 @@ pub fn setup(
|
|||||||
let pounder_pgood = gpiob.pb13.into_pull_down_input();
|
let pounder_pgood = gpiob.pb13.into_pull_down_input();
|
||||||
delay.delay_ms(2u8);
|
delay.delay_ms(2u8);
|
||||||
let pounder = if pounder_pgood.is_high().unwrap() {
|
let pounder = if pounder_pgood.is_high().unwrap() {
|
||||||
|
log::info!("Found Pounder");
|
||||||
let ad9959 = {
|
let ad9959 = {
|
||||||
let qspi_interface = {
|
let qspi_interface = {
|
||||||
// Instantiate the QUADSPI pins and peripheral interface.
|
// Instantiate the QUADSPI pins and peripheral interface.
|
||||||
@ -935,6 +937,7 @@ pub fn setup(
|
|||||||
// info!("Version {} {}", build_info::PKG_VERSION, build_info::GIT_VERSION.unwrap());
|
// info!("Version {} {}", build_info::PKG_VERSION, build_info::GIT_VERSION.unwrap());
|
||||||
// info!("Built on {}", build_info::BUILT_TIME_UTC);
|
// info!("Built on {}", build_info::BUILT_TIME_UTC);
|
||||||
// info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET);
|
// info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET);
|
||||||
|
log::info!("setup() complete");
|
||||||
|
|
||||||
// Enable the instruction cache.
|
// Enable the instruction cache.
|
||||||
core.SCB.enable_icache();
|
core.SCB.enable_icache();
|
||||||
|
@ -59,15 +59,22 @@ pub use configuration::{setup, PounderDevices, StabilizerDevices};
|
|||||||
fn panic(info: &core::panic::PanicInfo) -> ! {
|
fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||||
use core::{
|
use core::{
|
||||||
fmt::Write,
|
fmt::Write,
|
||||||
sync::atomic::{compiler_fence, Ordering::SeqCst},
|
sync::atomic::{AtomicBool, Ordering},
|
||||||
};
|
};
|
||||||
use cortex_m::interrupt;
|
use cortex_m::asm;
|
||||||
use rtt_target::{ChannelMode, UpChannel};
|
use rtt_target::{ChannelMode, UpChannel};
|
||||||
|
|
||||||
interrupt::disable();
|
cortex_m::interrupt::disable();
|
||||||
|
|
||||||
|
// Recursion protection
|
||||||
|
static PANICKED: AtomicBool = AtomicBool::new(false);
|
||||||
|
while PANICKED.load(Ordering::Relaxed) {
|
||||||
|
asm::bkpt();
|
||||||
|
}
|
||||||
|
PANICKED.store(true, Ordering::Relaxed);
|
||||||
|
|
||||||
let gpiod = unsafe { &*hal::stm32::GPIOD::ptr() };
|
|
||||||
// Turn on both red LEDs, FP_LED_1, FP_LED_3
|
// Turn on both red LEDs, FP_LED_1, FP_LED_3
|
||||||
|
let gpiod = unsafe { &*hal::stm32::GPIOD::ptr() };
|
||||||
gpiod.odr.modify(|_, w| w.odr6().high().odr12().high());
|
gpiod.odr.modify(|_, w| w.odr6().high().odr12().high());
|
||||||
|
|
||||||
// Analogous to panic-rtt-target
|
// Analogous to panic-rtt-target
|
||||||
@ -76,10 +83,10 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
|
|||||||
writeln!(channel, "{}", info).ok();
|
writeln!(channel, "{}", info).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
// Abort
|
||||||
// Halt
|
asm::udf();
|
||||||
compiler_fence(SeqCst);
|
// Halt
|
||||||
}
|
// loop { core::sync::atomic::compiler_fence(Ordering::SeqCst); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cortex_m_rt::exception]
|
#[cortex_m_rt::exception]
|
||||||
|
Loading…
Reference in New Issue
Block a user