Im working with TriCore TС299 microcontroller and using ERIKA 3. When i calling standard C function malloc, I have return result null. As if it is impossible to allocate memory. Then I opened the linker script "ee_tc_gcc_flash.ld" and changed the line
Code: Select all
/* Heap size */
//__HEAP_SIZE = DEFINED (__HEAP_SIZE) ? __HEAP_SIZE : 0;
__HEAP_SIZE = DEFINED (__HEAP_SIZE) ? __HEAP_SIZE : 2K;
Then I found on this forum that in order to use the heap I must indicate in the OIL file the LDFLAGS linker option.
The The GNU linker documentation define this:
I tried the options:--heap reserve
--heap reserve,commit
Specify the number of bytes of memory to reserve (and optionally commit) to
be used as heap for this program. The default is 1Mb reserved, 4K committed.
[This option is specific to the i386 PE targeted port of the linker]
Code: Select all
...
OS EE {
...
LDFLAGS = "--heap 2048";
...
Code: Select all
...
OS EE {
...
LDFLAGS = "--heap = 2048";
...
Code: Select all
...
OS EE {
...
LDFLAGS = "--heap reserve 2048";
...
Code: Select all
tricore-gcc.exe: error: =: No such file or directory
tricore-gcc.exe: error: 2048: No such file or directory
tricore-gcc.exe: error: unrecognized command line option '--heap'
make[1]: *** [/cygdrive/d/Prj/Photon/DEMOMU~1/erika/mk/ee_arch_rules.mk:105: erika3app.elf] Error 1