We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
For the ARMv8M mpu, there is only two bits for the AP(access permission), another
XN bit for executable.
I wan't to mark a region (e.g. from 0~4096) with no any access, mainly used for NULL pointer
read/write check. For ARMv7M, the mpu has 3 bits in AP field(RASR register), and I can select 000
to mark this region no any access, but for ARMv8M, there is only two bits in the register
MPU_RBAR,
"
00 – read/write by privileged code only01 – read/write by any privilege level10 – Read only by privileged code only11 – Read only by any privilege level
So, how should I do with the new MPU? any advice will be appreciated.
Yes, you need to map MPU regions to only to the memory that you need. Any access to un-mapped regions will generate fault.