Skip to content

Instantly share code, notes, and snippets.

View jamesmunns's full-sized avatar

James Munns jamesmunns

View GitHub Profile

Q&A session 2020-04-01

Misc notes:

    HAL - Hardware Abstraction Layer
^ Written by humans

Lowest: PAC - Peripheral Access Crate ^ Generated by svd2rust Register interface

james@archx1c6g ➜ spsc-bip-buffer git:(master) cargo +master run --release --example perf --features nightly_perf_example -- 0 2 255 16384 100000 true
Finished release [optimized] target(s) in 0.01s
Running `/tmp/.cargo-build-cache/release/examples/perf 0 2 255 16384 100000 true`
sender done
receiver done
elapsed (nanos) bytes msgs bytes/s msgs/s
2363048796 3264000000 12800000 1381266440.8475463 5416731.140578614
reserve and send:
╭ 6.200000e1 8.400000e1 9.200000e1 1.120000e2 1.600000e2 2.080000e2 2.949120e5 ╮
╰ [ 0.25 0.5 0.75 ]--- 0.95 ------- 0.99 ------- 0.999 -------| max ╯
git clone https://github.com/jamesmunns/bbqueue
cd bbqueue
james@archx1c6g ➜ bbqueue git:(miri-testing) git checkout miri-testing
Already on 'miri-testing'
james@archx1c6g ➜ bbqueue git:(miri-testing) cd bbqtest
james@archx1c6g ➜ bbqtest git:(miri-testing) cargo +master miri test --features travisci
Compiling bbqtest v0.1.0 (/home/james/stream2/bbqueue/bbqtest)
warning: unused import: `consts::*`
--> bbqtest/src/lib.rs:9:90
|
FRAUTH-CONTENTS
name = "James Munns"
note = "Hello, I'm James!"
pubkey = "💥💿🍞🔫☕️👽🔍👶🐣👉🏃💫⚓️👑🐸🍏🐾🐊🍎🎺💯💻💦🍸🐒👑🍼⚓️💔🏆🎬⛔️"
[identities]
email = "[email protected]"
github = "https://github.com/jamesmunns"
twitter = "https://twitter.com/bitshiftmask"
james@archx1c6g ➜ write-test git:(master) ✗ cat ./src/main.rs
use std::io::Write;
fn main() {
for _ in 0..10 {
writeln!(
::std::io::stdout().lock(),
"Hello, world!"
).unwrap_or_else(|_| {
eprintln!("stderr: Hello, stderr!");
arm-none-eabi-nm -nC ./target/thumbv7em-none-eabihf/release/alarm-clock
00000004 R __RESET_VECTOR
00000008 R __EXCEPTIONS
00000008 R __reset_vector
00000040 R __eexceptions
00000040 R __INTERRUPTS
000000dc R _stext
000000dc t <&T as core::fmt::Debug>::fmt
00000154 t <&T as core::fmt::Debug>::fmt
emb_index = {
"num-traits",
"ws2_32-sys",
"rand_jitter",
"compiler_builtins",
"num-bigint",
"miniz-sys",
"extprim",
"simple-hex",
"encoding-index-simpchinese",
==> 001-master-opt-3.txt <==
text data bss dec hex filename
2580 0 4 2584 a18 /home/james/nrf-rs/nrf52-hal/target/thumbv7em-none-eabihf/release/spi-demo
==> 001-master-opt-s.txt <==
text data bss dec hex filename
1472 0 4 1476 5c4 /home/james/nrf-rs/nrf52-hal/target/thumbv7em-none-eabihf/release/spi-demo
==> 001-master-opt-z.txt <==
text data bss dec hex filename
==> 001-unmodified.txt <==
text data bss dec hex filename
232048 0 16 232064 38a80 target/thumbv7em-none-eabihf/debug/examples/dw1000_rx_tx
32358 0 16 32374 7e76 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 002-master-c2ddfd3.txt <==
text data bss dec hex filename
233144 0 16 233160 38ec8 target/thumbv7em-none-eabihf/debug/examples/dw1000_rx_tx
32358 0 16 32374 7e76 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx

CMIM - Cortex-M Interrupt Move

Stage 1 - Moving data to interrupts

use nrf52832_pac::Interrupt;
use something::Queue;

// Done at global scope, only specify types
cmim!(