-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard fault crash after 1-2 minutes of running #76
Comments
Hm, any activity here? |
Hi @itxs. That's odd. Unfortunately I do not have your board at hand, so you need to try a few things. First can you please test if this problems also occurs with a very simple loop. The code is adapted from adapted from https://docs.rs/stm32f0xx-hal/latest/stm32f0xx_hal/delay/index.html, but I didn't test if it compiles, there might be some typo. use helloworld1 as _; // global logger + panicking-behavior + memory layout
use stm32f0xx_hal as hal;
use crate::hal::pac;
use crate::hal::prelude::*;
use crate::hal::delay::Delay;
use cortex_m::peripheral::Peripherals;
#[cortex_m_rt::entry]
fn main() -> ! {
let mut p = pac::Peripherals::take().unwrap();
let mut cp = cortex_m::Peripherals::take().unwrap();
let mut rcc = p.RCC.configure().freeze(&mut p.FLASH);
let mut delay = Delay::new(cp.SYST, &rcc);
loop {
delay.delay_ms(1_000_u16);
defmt::println!("Hello, world!");
}
helloworld1::exit()
} Afterwards can you please test if the problem occurs with all your commits, or which commit introduced the bug. When you have this please come back here with the results. I assume this is an error on in the HAL, because I don't see which part of the template should be responsible for this, but let's see. |
Sure, will check, sorry for delay |
Did you get it working? |
I've written a simple button application based on the app-template. However, after some time of firmware being run on the STM32F027B-DISCO board, it stopped. I started to dig in and found HardFault occurred. The breakpoint in the HardFault handler in lib.rs never hit even if I press Run after the automatic stop caused by the debugger.
The repo: https://github.com/itxs/embedded_rust_learning
The screenshot of an issue:
The text was updated successfully, but these errors were encountered: