Skip to content

Commit

Permalink
Use aligned address to demonstrate HardFault
Browse files Browse the repository at this point in the history
  • Loading branch information
decorator-factory authored Aug 18, 2024
1 parent 019f392 commit 2251b57
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/start/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ use cortex_m_semihosting::hio;
fn main() -> ! {
// read a nonexistent memory location
unsafe {
ptr::read_volatile(0x3FFF_FFFE as *const u32);
ptr::read_volatile(0x3FFF_0000 as *const u32);
}
loop {}
Expand All @@ -236,14 +236,14 @@ you'll see something like this on the OpenOCD console.
$ openocd
(..)
ExceptionFrame {
r0: 0x3ffffffe,
r1: 0x00f00000,
r2: 0x20000000,
r0: 0x3fff0000,
r1: 0x00000003,
r2: 0x080032e8,
r3: 0x00000000,
r12: 0x00000000,
lr: 0x080008f7,
pc: 0x0800094a,
xpsr: 0x61000000
lr: 0x080016df,
pc: 0x080016e2,
xpsr: 0x61000000,
}
```

Expand Down

0 comments on commit 2251b57

Please sign in to comment.