cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h743 random hard fault while reading flash

Andrei Babaev
Associate II

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

4 REPLIES 4
TDK
Guru

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".

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
Up vote any posts that you find helpful, it shows what's working..
berendi
Principal

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

Andrei Babaev
Associate II

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