Leon2 timer/clock frequency

Bornet Romain romain.bornet at heig-vd.ch
Fri Aug 23 07:28:07 UTC 2013


I'm a new user of RTEMS on Leon2 and I'm trying to run an application under Qemu for Leon2 (qemu from Couverture project:https://forge.open-do.org/projects/couverture-qemu/).

I can successfully run a simple application like hello world but as soon as I use primitives depending on timers I see that the clock is not correctly configured and runs much more quickly than it should.

I had a look at the clock initialization code in the Leon2 BSP and found that the code does not initialize the Timer1 prescaler but assumes that Timer1 is running at 1MHz and just writes the number of microseconds per tick in the preload register ( Clock_driver_support_initialize_hardware() macro in http://git.rtems.org/rtems/tree/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c).
As far as I understood the Leon2 BSP does no hardware initialization and relies on a "boot prom" to perform low-level hardware initialization.

Then my question:
Does the Leon2 BSP perform some timer initialization (prescaler setting) or does it really rely on the assumption that the boot prom configured the timer1 to run at 1MHz ? I perhaps missed something in my code digging...

Thanks for your help

More information about the users mailing list