Skip to main content
Andrei Babaev
Associate II
July 23, 2020
Question

stm32h743 random hard fault while reading flash

  • July 23, 2020
  • 4 replies
  • 1201 views

Hi everyone!

i have a custom board with h743vit6 on it

when i'm trying to access flash like this:

cell_data = * (__I uint32_t *) address;

i'm getting random hard faults from time to time

at first everything works fine, but after hard fault happens once, i'm getting it every time i am trying to read from flash

changing latency didn't help

it can't be a power issue either cause i'm using a power source that can drive up to 1 A

the mcu works at 300 mhz, clock signal comes from fpga and looks good

writing to flash works fine though

This topic has been closed for replies.

4 replies

TDK
July 23, 2020

Instrument your hard fault handler and determine a bit more about what the error is. The SCB register contains a bunch of info. I doubt the hard faults are random.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
July 23, 2020

Have your Hard Fault handler output actionable data.

Do sanity checking on the address, before reading it. More likely something on the stack is being corrupted either due to size, accesses out of range, or cache coherency.

Going to have to dig into the details to understand the potential causes.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
berendi
Principal
July 23, 2020

What kind of flash, internal, external, how is it connected and configured?

Andrei Babaev
Associate II
July 27, 2020

So I've checked MMFAR and found out that flash bank 2 has this small region that causes my program to fail, but i still don't know the reason why it can't be accessed 0693W000003BKoeQAG.png