[ECOS] Cortex M3 idle sleep

Nick Garnett nickg@ecoscentric.com
Fri Feb 13 16:46:00 GMT 2009

Simon Kallweit <simon.kallweit@intefo.ch> writes:

> Nick Garnett wrote:
> > The "#if 0" is an oversight on my part. When debugging via JTAG I was
> > having difficulties breaking in to an idle system. Stopping it using
> > WFI solved this. The #else part is also a consequence of this, so that
> > code should really be:
> >
> Well that's actually the reason for me to propose a
> CYGHWR_HAL_CORTEXM_IDLE_SLEEP configuration option. During debugging,
> wfi is rather troublesome, so I thought it might be a good idea to
> make it configurable. Or is this too much cruft?

I think it might be too much cruft.

I don't know how other people work but I tend to like
enabling/disabling debug stuff by editing the source rather than
messing with the configuration. The latter is often more complicated
and it takes a lot longer to recompile everything. CVS usually reminds
me to undo the change before checking in -- except in this case where
there was no original to diff against, and I forgot about this edit.

So I would actually prefer something more like this:

#if 1
#  define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "wfi\n" )
# endif

So that I can easily override any idle thread action when I need
to. However I appreciate that this is not necessarily to everyone's
taste, and would usually make sure any such construct never escaped my
own source tree.

Nick Garnett                                        eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com        The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales:                          Reg No: 4422071
Besuchen Sie uns vom 3.-5.03.09 auf der Embedded World 2009, Stand 11-300
Visit us at Embedded World 2009, Nürnberg, Germany, 3-5 Mar, Stand 11-300

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