[ECOS] place thread stack into CCM memory on STM32

Sergei Gavrikov sergei.gavrikov@gmail.com
Fri Oct 17 14:25:00 GMT 2014


On Fri, 17 Oct 2014, Oleg Uzenkov wrote:

> Ok,  it appears that it is possible to specify
> __attribute__((section("<name>"))) for class's member methods.

Really?

  https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html says

  You may use the section attribute with initialized or uninitialized
  global variables.

IMO, your C++ style (rejected) is not very good. Look, please, on the
eCos kernel's tests in C++ (those *.cxx tests are examples to follow).
In a fact that C++ coding style is something likes EC++. I would say it
is Embedded C++ style from eCos gurus.

Find kernel/current/tests/testaux.hxx and tests/*.cxx code.

On 64K aside. I would try to "move" eCos heap (__heap1) in .ccm segment.
Then all dynamic stuff will be live in .ccm segment. Benefits: 1) you
will get more space for eCos program (code+data) ~120K; 2) you will get
64K room for all dynamically allocated objects (just allocate the
buffers for thread's stacks); 3) no mess with 'section' attribute.
Drawback(s): 1) if you won't use 'new' or 'malloc' (will you?) then .ccm
will be waste. I seems for me (not tested, I have no STM target) you have
only to re-define the heap's size in mlt*h (set it 64K) and move __heap1
label in mlt*ldi (put __heap1 after .ccm section). Well, this is just an
idea, perhaps, I miss something and it will not work, but you can try
it.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list