Skip to content

Instantly share code, notes, and snippets.

@bofh
Created May 8, 2018 23:18
Show Gist options
  • Save bofh/3f57054a62f47f06eaf857f6fc8878f1 to your computer and use it in GitHub Desktop.
Save bofh/3f57054a62f47f06eaf857f6fc8878f1 to your computer and use it in GitHub Desktop.
#[export_name = "_reset"]
pub unsafe extern "C" fn reset() -> ! {
asm!("
cpsie i\n
movw r0, 0xd800\n
movt r0, 0x1fff\n
ldr r0, [r0]\n
msr MSP, r0" ::: "r0" : "volatile");
let f = 0x1FFFD804u32 as *const fn();
(*f)();
loop {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment