Hi,
I could use your help understanding the freeRTOS MPU settings that Halcogen generated for my TMS570LS3137ZWT. The code in question is this:
/* First setup the entire flash for unprivileged read only access. */ prvMpuSetRegion(portUNPRIVILEGED_FLASH_REGION, 0x00000000, portMPU_SIZE_4MB | portMPU_REGION_ENABLE, portMPU_PRIV_RO_USER_RO_EXEC | portMPU_NORMAL_OIWTNOWA_SHARED); /* Setup the first 32K for privileged only access. This is where the kernel code is placed. */ prvMpuSetRegion(portPRIVILEGED_FLASH_REGION, 0x00000000, portMPU_SIZE_32KB | portMPU_REGION_ENABLE, portMPU_PRIV_RO_USER_NA_EXEC | portMPU_NORMAL_OIWTNOWA_SHARED); /* Setup the privileged data RAM region. This is where the kernel data is placed. */ prvMpuSetRegion(portPRIVILEGED_RAM_REGION, 0x08000000, portMPU_SIZE_512KB | portMPU_REGION_ENABLE, portMPU_PRIV_RW_USER_RO_EXEC | portMPU_NORMAL_OIWTNOWA_SHARED); /* Default peripherals setup */ prvMpuSetRegion(portGENERAL_PERIPHERALS_REGION, 0xF0000000, portMPU_SIZE_256MB | portMPU_REGION_ENABLE | portMPU_SUBREGION_1_DISABLE | portMPU_SUBREGION_2_DISABLE | portMPU_SUBREGION_3_DISABLE | portMPU_SUBREGION_4_DISABLE, portMPU_PRIV_RW_USER_RW_NOEXEC | portMPU_DEVICE_NONSHAREABLE); /* Privilege System Region setup */ prvMpuSetRegion(portPRIVILEGED_SYSTEM_REGION, 0xFFF80000, portMPU_SIZE_512KB | portMPU_REGION_ENABLE, portMPU_PRIV_RW_USER_RO_NOEXEC | portMPU_DEVICE_NONSHAREABLE);
The flash, peripheral and system region settings I do understand but not the RAM. The TMS570LS3137ZWT only has 256 KB of integrated RAM but halcogen sets the size to 512KB. Why is that?
Also, this sentence from the RTOS website confuses me:
- The data maintained by the RTOS kernel (all non stack data that is private to the FreeRTOS source files) is located in a region of RAM that can only be accessed while the microcontroller is in Privileged mode.
If the whole RAM is taken up by the privileged kernel section then where is the stack going to be placed?
I'd appreciate if someone could clear it up for me.
Thanks