AnsweredAssumed Answered

Writing to Flash - Fault: Mem Manage Handler

Question asked by kledtke.steve.002 on Mar 31, 2016
Latest reply on Mar 31, 2016 by kledtke.steve.002
Hey there.

I am using a STM32L476RG. I'm implementing a module for handling erasing and writing of the internal FLASH memory.
In a test, I did the sequences as described in the reference manual for:
       
  • Flash unlock
  •    
  • Mass erase
  •    
  • Initiating flash programming
In mass erase, after starting it, I definitely wait for the busy flag being cleared.
Now in the last item of that list, as soon as I try to write one 64-bit word to a 64-bit-aligned address in the flash, I get this fault where it lands in the mem manage handler.
The FLASH StatusRegister is zero, i.e. no errors set.
The programming bit in the ControlRegister is set, the lock bit is cleared.
Interestingly, the MER2 bit, mass erase bank 2, is still set - is this normal, or should it have been automatically reset after completion?

What could cause this fault?
Is there some register telling about the cause of the fault? Have not found anything about that in the manual.

Thanks in advance.

Outcomes