Hi,
I'm working on MSC8156 ADS, and I've migrated my project to CW version 10.1.8, from version 10.1.3.
I've followed the instructions in the PDF document, and I've managed to build the project without errors and no warnings.
But I've receive Linker Info on the output as follows:
What is missing in my project ?
Thanks.
Solved! Go to Solution.
Hello
Memory allocation, wide character management, file management local management functions are using RTlib Heap.
Some string management function like strcoll, strxfrm are also using RTlib Heap.
If you are programming in C++, new operator will also use RTLIB heap.
CrasyCat
Hello
Are you building a SmartDSP OS project or a bare board project?
CrasyCat
Hi,
I'm using SDOS in my project.
ITCO.
Hello
This is the expected behavior, as the stack section is not explicitly specified in the linker command files for SDOS applications.
To remove these messages, add definitions for the stack section the .l3k files.
To define a real stack section, apply the following modifications to the project:
1. In file msc815x_init.c, define the symbol StackStart as follows:
uint8_t StackStart[ALIGN_SIZE(OS_STACK_SIZE,8)] attribute ((section("stack")));#pragma align StackStart 8
2. In the local_map.l3k file, add the stack section to descriptor_local_data as follows:
descriptor_local_data { .oskernel_local_data .data ramsp_0 .oskernel_rom .rom .exception .exception_index .ramsp_0 .init_table .rom_init .rom_init_tables .staticinit LNK_SECTION(att_mmu, "rw", 0x200, 4, ".att_mmu"); .bsstab reserved_crt_tls .oskernel_local_data_bss .bss stack } > local_data_descriptor;
There is one constraint though.
The section that contains the symbol _g_heap_nocache must be allocated in the same MMU segment as the startup stack.
That means the section .oskernel_local_data must be allocated in same MMU segment as stack.
CrasyCat
Hi,
I've added the Stack definitions as you wrote, but I still reveive the information remarks ([LNK,0,6999,-1] 3 per core x 2):
In the code it seems like the following (msc815x_init.c):
uint8_t StackStart[ALIGN_SIZE(OS_STACK_SIZE,8)]/* attribute ((section("stack")))*/;
#pragma align StackStart 8
...
#if defined(OS_HEAP_NONCACHEABLE_SIZE) && (OS_HEAP_NONCACHEABLE_SIZE > 0)
uint8_t g_heap_nocache[OS_HEAP_NONCACHEABLE_SIZE] = { 0 };
#pragma align g_heap_nocache OS_HEAP_NONCACHEABLE_SIZE
uint32_t g_heap_nocache_size=OS_HEAP_NONCACHEABLE_SIZE;
#else
#define OS_HEAP_NONCACHEABLE_SIZE 0
uint8_t *g_heap_nocache=0;
uint32_t g_heap_nocache_size=0;
#endif
Hello
stack definition should look as follows in msc815x_init.c:
uint8_t StackStart[ALIGN_SIZE(OS_STACK_SIZE,8)] __attribute__ ((section("stack")));
#pragma align StackStart 8
CrasyCat
Hi,
I've added the StartStack declaration and the build is OK. Now, I receive the following info about HEAP (for all cores):
Information: Could not locate heap section for core c0. Heap not set. It must be set by user
In OS config header file the Heaps are declared (by defining their size). What is missing in the configuration?
Hello
This one refers to the run time library heap. This heap is used when you are using malloc (instead of osMalloc) for dynamic memory allocation.
Not sure you even need this one in your application.
CrasyCat
Hi,
I'm using only osMalloc and also USING_RTLIB is set to 0 (my project is embedded). Is there any other API that might case this Info (printf()...)?
ITCO
Hello
Memory allocation, wide character management, file management local management functions are using RTlib Heap.
Some string management function like strcoll, strxfrm are also using RTlib Heap.
If you are programming in C++, new operator will also use RTLIB heap.
CrasyCat
Hello,
Thanks, but I'm not using RTLIB (USING_RTLIB is set to 0) nor C++. Is there anything else that might cause this Info?
ITCO
The message is generated because the linker does not find any explicit definition for a section called heap.
If you do not need memory allocation in RTLib Heap, either you should ignore this message or you define a dummy heap section in your .l3k file.
For example add following line to one of your local data descriptor:
LNK_SECTION(heap, "rw", 8, 0x8, "heap");
CrasyCat
Hi,
Thanks, it is working OK !
ITCO
Hi,
I've tried that at the first by I received error/warning, it means that something else is missing.
I simply put the attribute in comment to have the same declaration as _g_heap_nocache as you've recommended.
ITCO