初始化RAM时生锈STM32F4 HardFault

时间:2019-12-11 09:22:44

标签: rust stm32

系统:

  • Win10
  • VS代码
  • rustc 1.39.0(4560ea788 2019-11-04)

和:

[dependencies]
cortex-m = "0.6.0"
cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0"

说明

我遵循了https://rust-embedded.github.io/book/start/hardware.html

中描述的步骤

我得到了以下内容:

PS C:\stm32\rustspace\test002> cargo build --example hello
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
PS C:\stm32\rustspace\test002> arm-none-eabi-gdb -q .\target\thumbv7em-none-eabihf\debug\examples\hello
Reading symbols from .\target\thumbv7em-none-eabihf\debug\examples\hello...
(gdb) target remote :3333
Remote debugging using :3333
core::fmt::Formatter::pad () at src/libcore/fmt/mod.rs:1285
1285    src/libcore/fmt/mod.rs: No such file or directory.
(gdb) load
Loading section .vector_table, size 0x400 lma 0x8000000
Loading section .text, size 0x152c lma 0x8000400
Loading section .rodata, size 0x5c0 lma 0x8001930
Start address 0x8001490, load size 7916
Transfer rate: 11 KB/sec, 2638 bytes/write.
(gdb) monitor arm semihosting enable
semihosting is enabled
(gdb) break main
Breakpoint 1 at 0x8000444: file examples\hello.rs, line 11.
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

Program received signal SIGINT, Interrupt.
0x0800191e in HardFault_ (ef=0x0) at C:\Users\Klaus Liebler\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-rt-0.6.11\src\lib.rs:555
555             atomic::compiler_fence(Ordering::SeqCst);

进一步的调试显示,在lib.rs中执行这些行时会发生硬故障

// Initialize RAM
r0::zero_bss(&mut __sbss, &mut __ebss);
r0::init_data(&mut __sdata, &mut __edata, &__sidata);

我该怎么办?

0 个答案:

没有答案