From 2251b57ba4cf09d4ff10e6fb3e3a28e81a686e73 Mon Sep 17 00:00:00 2001 From: decorator-factory <42166884+decorator-factory@users.noreply.github.com> Date: Sun, 18 Aug 2024 22:45:11 +0300 Subject: [PATCH] Use aligned address to demonstrate HardFault --- src/start/exceptions.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/start/exceptions.md b/src/start/exceptions.md index 64b3b8f9..e7056be7 100644 --- a/src/start/exceptions.md +++ b/src/start/exceptions.md @@ -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 {} @@ -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, } ```