I have a follow-up question from this.
I want to create a 4GB background region on R5 core. All I have to do is to fill following for region-0 in MPU?
starting address: 0
size: 2^32 = 0x100000000
Is anything else I need to do to declare a background region?
Register value of 0x3F => b0011_1111
Dividing that into the fields:
bit = enable = b1 = Enabledbits[5:1] = RSize = b11111 = 31
If you take a look at the description of RSize in the Armv7-A/R Architecture Reference Manual (Rev C.d, page 2720) it says "region size is 2^(N+1) bytes." (Where N is the value of the field)
So 2^(31+1) = 4GB.