[En-Nut-Discussion] NutGetMillis is a _very expensive_ function on Ethernut3

Ole Reinhardt ole.reinhardt at embedded-it.de
Sat Aug 16 17:43:44 CEST 2008


Hi all,

I experienced kind of system hangs on the Ethernut3 plattform when using
NutGetMillis() to calculate timeouts in my application. There might be
situations where I call NutGetMillis quite often.

I did not look into the implementation so far, but found (openocd /
arm-elf-insight helped me) that mostly I stopped the application the CPU
was working in TwMasterTransact which was at least called by
NutGetMillis().

So every call to NutGetMillis requests the current CPU clock from the
clock generator (cy22393) using the I2C bitbanging driver.

For me this seems to generate a lot unnecessary CPU load.

How could we simplify this function? At least there should be the system
timer which should be called in a regulary manner? Right? In most cases
the system clock won't change over the running time so we don't need to
check it every time we call NutGetMillis() again?

Regards,

Ole

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list