cancel
Showing results for 
Search instead for 
Did you mean: 

large SDRAM access causing hardfault in stm32f429

arunnmishra
Associate II
Posted on August 06, 2014 at 11:49

Hello there!

I've interfaced 128 MB(16 bit data bus) sdram through fmc interface in my stm32f429 device. Initialization and everything seems ok. Reading/writing to sdram is ok for small chunks. But writing 12 MB or larger (from base address 0xd0000000) is causing hard fault. Similarly for higher memory ranges(Say 0xd1000000) even lesser amount can be accessed continuously without causing hard fault. I've written and read back whole chip correctly by accessing memory in smaller chunks(i.e tested first few MB than further and so on).

If there any one who have faced the similar problem of any suggestion/solution regarding this behavior.

Thanks in advance   

#stm32f429 #!psychic #external-ram
3 REPLIES 3
Posted on August 06, 2014 at 14:57

Hard to say, you'd perhaps want to look at the registers in the faulting case to try and understand what was going on. The primary reason it would hard fault is that the access exceeds the memory array in some fashion.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
arunnmishra
Associate II
Posted on August 08, 2014 at 12:03

Thanks clive1, I also suspected on faulty registers initially but when I access those register individually, they worked fine. Though I've successfully initialized my memory and moved my heap to those external ram and everything working fine till time, but still I think that the design might produce some problem in the field    

Posted on August 08, 2014 at 17:52

These types of gross faults should be easier to pin down than most. Would recommend implementing an effective Hard Fault handler that can dump register and stacked states. Joseph Yiu has some that are a reasonable starting point, and orders of magnitude better than a while(1); loop

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..