[ECOS] ecos usage question

Andrew Lunn andrew@lunn.ch
Sat Aug 30 13:10:00 GMT 2008


On Sat, Aug 30, 2008 at 09:30:51AM +0400, Dave Milter wrote:
> Hi,
> 
> I have several question about ecos (new for me technology),
> may be someone can answer?
> 
> As I understand I build ecos as library and then link it to my code,
> move it to bootable storage and my device is ready to run,
> 
> but
> 1)what about reflashing, I mean updating software in device,
> what preferred way? At now I see only one way: building also redboot,
> and first of all boot it, then it boot my software or reflash my software or
> reflash itself, but I actually will have on flash two ecos libraries,
> one linking with my software and another linking with redboot.

Two different eCos libraries. Redboot only needs a very minimal part
of eCos. Your application, depending on its size, is likely to use a
lot more of eCos. The both the configuration and the linker ensures
what ends up in your final image is only what you need.

> 2)What about FPU? I see in code C implementation of math.h functions,
> what about if want use assembler variants which gcc produce?

The gcc side of things will probably just work. 

For ARM you probably need to work on the task switching. You need to
ensure that the task switch code knows you are using an FPU so it can
store and restore the FPU registers as well. ARM does not seem to have
any support for this at all at the moment. You have a few options...

1) Restrict yourself to using the FPU in a single thread. This
   requires no support from eCos, but is the easiest to break causing
   difficult to find problems.

2) Limit FPU usage to threads. ISR and DSR cannot use the FPU. This
   will limit your changes to HAL_THREAD_INIT_CONTEXT,
   HAL_THREAD_SWITCH_CONTEXT and HAL_THREAD_LOAD_CONTEXT.

3) You allow usage of the FPU in ISR and DSR. This requires you change
   the interrupt handling code to store and restore the FPU context on
   each interrupt.

I would probably go for 2).

  Andrew

-- 
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