PIC32MX Virtual Address Space

Last modified by Microchip on 2023/11/09 09:00

Virtual Address Space

The MIPS32® 4GB virtual address space is partitioned into five fixed-size segments with traditional names; different things happen according to the virtual memory area an address lies in, as follows:

KUSEG: 0x00000000-0x7FFFFFFF (low 2GB) :

These addresses are permitted in User mode (see Modes of Operation). Machines with a memory management unit (MMU) will always be mapped. You should not attempt to use these addresses unless the MMU is set up. On PIC32MX, this region is also cacheable.

KSEG0: 0x80000000-0x9FFFFFFF (512MB) :

These addresses are translated directly into physical addresses by stripping off the MSB and mapping them contiguously into the low 512MB of physical memory (0x00000000 - 0x1FFFFFFF). Since this is a "trivial" translation, these addresses are often called "unmapped". On PIC32MX, this region is also cacheable and is the default space for application code.

KSEG1: 0xA0000000-0xBFFFFFFF (512MB):

These addresses are mapped into physical addresses by stripping off the leading 3-bits, giving a duplicate mapping into the low 512MB of physical memory (0x00000000 - 0x1FFFFFFF). But this time, access will not use the cache.

KSEG1 is the only memory region that can be used at reset because the prefetch cache must be configured by the boot code before it can be used. Therefore your boot code must be placed in KSEG1.

KSEG2: 0xC0000000-0xDFFFFFFF (512MB) & KSEG3: 0xE0000000-0xFFFFFFFF (512MB) :

These areas are only accessible in Kernel mode. On PIC32MX devices, these regions are not translated to any physical memory resources. Segment KSEG3 contains the Debug Segment (DSEG), available to the EJTAG probe debugger or monitor.