About virtual and physical memory
Processors that contain a Memory Management Unit (MMU) provide two views of memory, virtual and physical. The virtual address is the address prior to address translation in the MMU and the physical address is the address after translation.
Normally when the debugger accesses memory, it uses virtual addresses. However, if the MMU is disabled, then the mapping is flat and the virtual address is the same as the physical address.
To force the debugger to use physical addresses, prefix the addresses
P:0x8000 P:0+main creates a physical address with the address offset of main()
If your processor also contains TrustZone technology, then you have access to
Secure and Normal worlds, each with their own separate virtual and physical address
mappings. In this case, the address prefix
not available, and instead you must use
normal physical and
SP: for secure physical.
- Processors that are compliant with Arm® Architectures prior to Armv6 do not support physical addressing in this manner. This includes the Arm7 and Arm9 family of processors.
Physical address access is not enabled for all operations. For example, the Arm hardware does not support setting breakpoints via a physical address.
When memory is accessed via a physical address, the caches are not flushed. Hence, results might differ depending on whether you view memory through the physical or virtual addresses (assuming they are addressing the same memory addresses).