Skip to content

Instantly share code, notes, and snippets.

View jamesmunns's full-sized avatar

James Munns jamesmunns

View GitHub Profile
#[doc = "Factory Information Configuration Registers"]
pub struct FICR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FICR {}
impl FICR {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const ficr::RegisterBlock {
0x1000_0000 as *const _
}
#[doc = "Factory Information Configuration Registers"]
pub struct FICR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FICR {}
impl FICR {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const ficr::RegisterBlock {
0x1000_0000 as *const _
}
<peripheral>
<name>FICR</name>
<description>Factory Information Configuration Registers</description>
<groupName>FICR</groupName>
<baseAddress>0x10000000</baseAddress>
<size>32</size>
<addressBlock>
<offset>0</offset>
<size>0x1000</size>
<usage>registers</usage>
.---------------------------.
| CI Server | .------------------------------.
|---------------------------| | Embedded Target |
| | |------------------------------|
| .-----------------------. | JTAG | .--------------------------. |
| | Cross Compiler | |<-------->| | Normal Device Firmware | |
| | Firmware Programmer | | | '--------------------------' |
| | Testing Framework | | UART | |
| | Test Hardware Drivers | |<-------->| |
| | Coprocessor Firmware | | | |
@jamesmunns
jamesmunns / paring_output
Created April 13, 2017 11:04
Connect, then try to read from a service
[bt] [INF] show_dev_info: Identity: cf:75:ce:86:6d:02 (random)
[bt] [INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000, manufacturer 0xffff
[bt] [INF] show_dev_info: LMP: version 5.0 (0x09) subver 0xffff
[bt] [WRN] bt_pub_key_gen: ECC HCI commands not available[0m
Bluetooth initialized
Advertising successfully started
Connected
Passkey for 77:a1:46:5a:a2:7a (random): 13868
Disconnected (reason 19)
@jamesmunns
jamesmunns / bad.map
Created March 26, 2017 00:31
blue pill map files
target/thumbv7m-none-eabi/debug/bin: file format elf32-littlearm
SYMBOL TABLE:
08000000 l d .text 00000000 .text
08000ca8 l d .debug_gdb_scripts 00000000 .debug_gdb_scripts
00000000 l d .debug_str 00000000 .debug_str
00000000 l d .debug_abbrev 00000000 .debug_abbrev
00000000 l d .debug_info 00000000 .debug_info
00000000 l d .debug_ranges 00000000 .debug_ranges

Keybase proof

I hereby claim:

  • I am jamesmunns on github.
  • I am jamesmunns (https://keybase.io/jamesmunns) on keybase.
  • I have a public key ASCJqj7QGR1krgSR7nVngi128xNPiIN0PLJHZtxP7USlLgo

To claim this, I am signing this object:

// The idea is to take a stream of bytes that looks like this:
//
// < One Byte Length > < Field A Data >
// < One Byte Length > < Field B Data >
// < One Byte Length > < Field C Data >
// < Two byte CRC16CCITT >
//
// Max length of fields:
// A: 31 bytes, B: 40 bytes, C: 64 bytes
// Total (incl. metadata): 140 bytes
fn main() {
println!("Hello, world!");
}
pub fn handler(&self, req: CoAPRequest) -> Option<CoAPResponse> {
match req.get_option(CoAPOption::UriPath) {
Some(req_path) => {
match req.get_class() {
MessageClass::RequestType(rq_type) => {
match self.map.get(&rq_type) {
Some(dispatch) => {
dispatch.get(&req_path)
},
None => None,