Skip to content

Instantly share code, notes, and snippets.

//! Traits that represent a buffer that can be used with DMA.
use core::{
mem::{self, MaybeUninit},
ops::{Deref, DerefMut},
};
use stable_deref_trait::StableDeref;
/// Trait for buffers that can be given to DMA for reading.
///
#![no_std]
#![no_main]
use core::{
panic::PanicInfo,
sync::atomic::{compiler_fence, Ordering},
};
use cortex_m::singleton;
use rtic::app;
#![no_std]
#![no_main]
use core::{
panic::PanicInfo,
sync::atomic::{compiler_fence, Ordering},
};
use cortex_m::singleton;
use rtic::app;
(gdb) info address _SEGGER_RTT
Symbol "_SEGGER_RTT" is at 0x20003c68 in a file compiled without debugging.
Dump of assembler code for function f4_adc::init:
44 #[app(device = stm32f4xx_hal::stm32, peripherals = true)]
0x08003d48 <+0>: push {r4, r5, r6, r7, lr}
0x08003d4a <+2>: add r7, sp, #12
0x08003d4c <+4>: stmdb sp!, {r8, r9, r10, r11}
0x08003d50 <+8>: sub.w sp, sp, #22912 ; 0x5980
0x08003d54 <+12>: sub sp, #116 ; 0x74
macro_rules! ppi {
(
not_fixed: [ $(
$(#[$attr:meta])?
($ppix:ident, $PpixType:ident, $ch:expr),)+
],
fixed: [$(($ppix_fixed:ident, $PpixTypeFixed:ident, $ch_fixed:expr),)+],
) => {
$(
@thalesfragoso
thalesfragoso / disas-no-trace
Created March 10, 2020 05:29
Rubble with and without trace! in process_data_packet
Dump of assembler code for function rubble::link::connection::Connection<C>::process_data_packet:
/Projects/rubble/rubble/src/link/connection.rs:
130 pub(crate) fn process_data_packet(
0x00003ac8 <+0>: stmdb sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
0x00003acc <+4>: sub sp, #236 ; 0xec
0x00003ace <+6>: str r0, [sp, #20]
0x00003ad0 <+8>: add.w r7, sp, #30
0x00003ad4 <+12>: ldr r0, [sp, #280] ; 0x118
0x00003ad6 <+14>: mov r9, r1
0x00003ad8 <+16>: str r0, [sp, #32]
@thalesfragoso
thalesfragoso / main.rs
Created February 28, 2020 02:05
PoolSerial Test
//! CDC-ACM serial port example using polling in a busy loop.
#![no_std]
#![no_main]
use core::panic::PanicInfo;
use core::sync::atomic::{self, Ordering};
use cortex_m::asm::delay;
use cortex_m_rt::entry;
use embedded_hal::digital::v2::OutputPin;
Finished release [optimized + debuginfo] target(s) in 0.04s
Flashing ./target/thumbv7em-none-eabihf/release/nrf52-demo
DEBUG probe_rs::probe::flash::download > Found loadable segment containing:
DEBUG probe_rs::probe::flash::download > ".vector_table"
DEBUG probe_rs::probe::flash::download > ".text"
DEBUG probe_rs::probe::flash::download > ".rodata"
DEBUG probe_rs::probe::flash::download > Found loadable segment containing:
DEBUG probe_rs::probe::flash::download > ".data"
DEBUG probe_rs::probe::flash::loader > Using builder for region (0x00000000..0x00080000)
DEBUG probe_rs::probe::flash::builder > Building sectors and pages
DEBUG probe_rs::probe::debug_probe > Reading register IDR
DEBUG probe_rs::probe::debug_probe > Changing AP to 0, AP_BANK_SEL to 15
DEBUG probe_rs::probe::debug_probe > Read register IDR, value=0x23000000
DEBUG probe_rs::probe::debug_probe > Reading register IDR
DEBUG probe_rs::probe::debug_probe > Changing AP to 1, AP_BANK_SEL to 15
DEBUG probe_rs::probe::debug_probe > Read register IDR, value=0x02880000
DEBUG probe_rs::probe::debug_probe > Reading register IDR
DEBUG probe_rs::probe::debug_probe > Changing AP to 2, AP_BANK_SEL to 15
DEBUG probe_rs::probe::debug_probe > Read register IDR, value=0x00000000
DEBUG probe_rs::probe::debug_probe > Reading register IDR
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Flashing ./target/thumbv7em-none-eabihf/debug/nrf52-demo
DEBUG probe_rs::probe::flash::download > Found loadable segment containing:
DEBUG probe_rs::probe::flash::download > ".vector_table"
DEBUG probe_rs::probe::flash::download > ".text"
DEBUG probe_rs::probe::flash::download > ".rodata"
DEBUG probe_rs::probe::flash::download > Found loadable segment containing:
DEBUG probe_rs::probe::flash::download > ".data"
DEBUG probe_rs::probe::flash::loader > Using builder for region (0x00000000..0x00080000)
DEBUG probe_rs::probe::flash::builder > Building sectors and pages