I'm an engineering student and currently studying cortex m3 processor and it's exception handling model. I have generated and tested usage fault, bus fault, hard fault with their corresponding fault handlers.
But I don't know how to generate memory management fault (without using a configured MPU)?
Is there any other way to generate memory management fault?
To quote the Architecture Reference Manual (emphasis mine):
In other words, if you don't want to program the MPU, you're going to have to look for one of those fixed constraints, and the obvious place to start looking is the memory map. Execute Never sounds like a constraint to me, and sure enough, whilst the Cortex-M3 TRM is a bit vague ("a fault exception"), the architecture says:
There we go. Looks like the easiest way is to simply branch into the System region (0xE0000000 - 0xFFFFFFFF) since that is always XN regardless of MPU configuration.