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.
Hi,
In Armv8-M, MPU can be programmed only to the regions that need to be accessed by either data access operations or instruction execution.
If a memory spaced is not programmed by a MPU region, then on either a data or instruction access fault is triggered.
Hence, there is no need of using one more MPU region to mark a memory space with "No Access" by both data and instruction access operations.
Thanks,
Uma
Thank you
you mean I can clear the PRIVDEFENA of register mpu_ctrl
and then map all the memory I need, and unmap any region I don't
need? then any access to these unmaped regions will generate the fault?
Yes, you need to map MPU regions to only to the memory that you need. Any access to un-mapped regions will generate fault.