Delay::measure function

Martin Schröder martin.schroeder at openlimit.com
Fri Jul 4 12:06:40 CEST 2014


Hello Xavier,

Am 04.07.2014 11:18, schrieb Xavier LEBARS:
> Hello,
>
> Thanks for the answer, we can display Hello World only once. (I resend my message because I forgot to add the L4 mailing list ...)

the Hello World example calls sleep(1) which causes the kernel to 
suspend the task for one second until the next line is printed. This 
delay period is derived from the fiasco system clock. The system clock 
needs periodically increased. Usually a hardware timer is configured to 
periodically generate (hardware-)interrupts at a rate of 1000 Hz. And 
every time the interrupt handler of the timer is triggered, it calls a 
function in the kernel to increase the system clock. See the the last 
line in timer-arm-realview.cpp where Kip::k()->clock; is called.

If your system clock is not advanced, the sleep(1) will never return.

> We still have another questions. What kind of interrupts are you talking about ? Which module should actually throw this interrupt and when ?

In the bsp you have to add support for the hardware-timers of your SOC, 
configure one channel for 1000Hz and make sure that the timer interrupts 
are routet to the interrupt handler.

Best regards
    Martin






More information about the l4-hackers mailing list