Other Parts Discussed in Thread: HALCOGEN
Hello E2E team,
I have being reading a lot of forums related to the issue I am having when enabling the cache in an application that uses DMA.
I am using the GCC compiler/linker, FreeRTOS and Halcogen v04.07.00.
I am using a dedicated MPU memory region R8 for the CPU <> DMA access. This region is setup as follows:
This region overlaps with region 3, which covers the whole RAM memory, but the region 3 is not available for editing in Halcogen, so I am not able to change the Type and Permission of the region 3:
so I figure out I could try and edit the Halcogen config file ( *.dil ) changing the following parameters:
DRIVER.SYSTEM.VAR.CORE_MPU_REGION_3_TYPE.VALUE=NORMAL_OINC_SHARED
DRIVER.SYSTEM.VAR.CORE_MPU_REGION_3_TYPE_VALUE.VALUE=0x000C
DRIVER.SYSTEM.VAR.CORE_MPU_REGION_3_PERMISSION.VALUE=PRIV_RW_USER_RW_EXEC
DRIVER.SYSTEM.VAR.CORE_MPU_REGION_3_PERMISSION_VALUE.VALUE=0x0300
This way, when I load the Halcogen project, now I can see that the region is shareable (and non-cacheable):
But still, if I enable the Cache in Halcogen settings, the SPI DMA just sends data as zeros, meanwhile if a disable the Cache in Halcogen, I can see that the DMA performs correctly.
These are the snippets of the linker file that I use to place the "sharedRAM" section on top of the "RAM" section.
/* Entry Point */
ENTRY(_c_int00)
/* Highest address of the stack */
_estack = 0x8040000; /* end of 256K RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x400; /* required amount of heap */
/* Shared RAM fully accessible and non-cacheable */
SHAREDRAM_SIZE = 0x1000;
/* Specify the memory areas */
MEMORY
{
VECTORS(rx) : ORIGIN = 0x00000000, LENGTH = 0x00000020
KERNEL (rx) : ORIGIN = 0x00000020, LENGTH = 0x00008000
FLASH (rx) : ORIGIN = 0x00008020, LENGTH = (0x001F7FE0 + 0x00200000)
CPU_STACK (rw) : ORIGIN = 0x08000000, LENGTH = 0x0000f000 /* Stack is configured in sys_core.asm */
KRAM (xrw) : ORIGIN = 0x0800f000, LENGTH = 0x00000800
RAM (xrw) : ORIGIN = (0x0800f000 + 0x00000800), LENGTH = (0x00071000 - 0x00000800 - SHAREDRAM_SIZE)
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
SHAREDRAM(rw) : ORIGIN = 0x0807F000, LENGTH = SHAREDRAM_SIZE
}
/* DMA shared data located in RAM */
.sharedRAM :
{
. = ALIGN(4);
__sharedRAM_start__ = .; /* create a global symbol at sharedRAM start */
*(.sharedRAM)
. = ALIGN(4);
} > SHAREDRAM
I am missing any other step in order to correctly use the DMA with the Cache Enabled?
Thanks for your support,
Best Regards,
Jor Sas





