Hello!
I use board MSC8156ADS and environment CodeWarrior. I’ve decided to check the dynamic memory function. As an example, there was used the project l2_cache_demo.
For memory allotment in memory DDR0 the following function is used:
osMalloc(BUFF_SIZE, OS_MEM_DDR0_SHARED);
In module os_config.h declared
#define OS_SHARED_MEM_DDR0_SIZE 0x1000000
OS_SHARED_MEM_DDR0_SIZE limits the max memory size which is allotted in external memory DDR0.
But the size DDR0 is 1GB.
Trying to change OS_SHARED_MEM_DDR0_SIZE more there is the mistake during compilation:
ERROR: Non-zero return status from "C:\Program Files\Freescale\CW SC v10.1\eclipse\\..\SC\StarCore_Support\compiler\bin\sc3000-ld.exe". l2_cache_core0 Unknown C/C++ Problem
Fatal(F1031): LCF configuration: in core c0, task task0_c0: virtual memory 'shared_data_ddr0_descriptor'(org=0x41000000, size=0x02000000) is not aligned to MATT/MMU constraints on address and size. os_msc815x_link.l3k l2_cache_core0/link_cmd line 54 C/C++ Problem
make: *** [../../l2_dbg.eld] Error 1 l2_cache_core0 line 0 C/C++ Problem
Could you please advise me how can I use the whole memory (1GB DRR0) and, accordingly, memory DDR1?
Thanks in advance!
Hello
The linker files generated when you create a SDOS project with the project wizard as well as the demo projects delivered with SDOS are set up to use a portion of each memory area (M3. DDR0, DDR1) for core private data and the remaining part of memory as shared data.
According to the comment in memory_map_link.l3k mapping in each memory area looks as follows:
/****************************************************/ /* For each memory - the mapping will be as follows */ /****************************************************/ /* +------------------------------+ _LocalDataM_b */ /* | +--------------------------+ | */ /* | | Local partition core 0 | | */ /* | +--------------------------+ | */ /* | | Local partition core 1 | | */ /* | +--------------------------+ | */ /* | | Local partition core 2 | | */ /* | +--------------------------+ | */ /* | | Local partition core 3 | | */ /* | +--------------------------+ | */ /* | | Local partition core 4 | | */ /* | +--------------------------+ | */ /* | | Local partition core 5 | | */ /* | +--------------------------+ | */ /* +------------------------------+ _LocalDataM_e */ /* | | */ /* | Shared partition | */ /* | | */ /* | | */ /* | | */ /* | | */ /* +------------------------------+ */ /* */ /****************************************************/
If you wish to use the whole DDR0 memory area as Shared heap, you need to adjust your .l3k files as well as the os_config.h to make sure there is nothing else allocated in DDR0 anymore.
CrasyCat
Thanks for response!
I've looked through .l3k files.
If I understood correctly, the DDR0 Shared Memory size is 1Gb. That's what I need. It seems, all settings are right, but the local memory size is 16 Mb. OS_SHARED_MEM_DDR0_SIZE doesn't allow to allot more than 16 Mb.
Probably, the memory is alloted not in DDR0 Shared Memory, but in local memory, though I point out OS_MEM_DDR0_SHARED.
May be I make smthg in a wrong way.
Could you please explain, what I need to change in l3k files?