Skip to content

Commit ff5d61d

Browse files
authored
Merge pull request #374 from decorator-factory-clones/decorator-factory-patch-1
Use aligned address to demonstrate HardFault
2 parents 019f392 + 2251b57 commit ff5d61d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/start/exceptions.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ use cortex_m_semihosting::hio;
213213
fn main() -> ! {
214214
// read a nonexistent memory location
215215
unsafe {
216-
ptr::read_volatile(0x3FFF_FFFE as *const u32);
216+
ptr::read_volatile(0x3FFF_0000 as *const u32);
217217
}
218218
219219
loop {}
@@ -236,14 +236,14 @@ you'll see something like this on the OpenOCD console.
236236
$ openocd
237237
(..)
238238
ExceptionFrame {
239-
r0: 0x3ffffffe,
240-
r1: 0x00f00000,
241-
r2: 0x20000000,
239+
r0: 0x3fff0000,
240+
r1: 0x00000003,
241+
r2: 0x080032e8,
242242
r3: 0x00000000,
243243
r12: 0x00000000,
244-
lr: 0x080008f7,
245-
pc: 0x0800094a,
246-
xpsr: 0x61000000
244+
lr: 0x080016df,
245+
pc: 0x080016e2,
246+
xpsr: 0x61000000,
247247
}
248248
```
249249

0 commit comments

Comments
 (0)