[NEWS]Very High Resolutions in Tickless Mode

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

[NEWS]Very High Resolutions in Tickless Mode

Post by Giovanni »

Hi all,

I wanted to signal a "breakthrough" achieved in the RT kernel starting from revision 7551.

Arbitrary High System Time Resolution

Now it is possible to set CH_CFG_ST_FREQUENCY to any frequency achievable by the used timer. Virtual timers and timeouts will work with the specified resolution.

There are things to consider when pushing the frequency:
1) The time conversion macros like MS2ST() can fail because integer overflows in the 32bits range used by the macros, I am considering allowing 64 bits math there. Constant expressions should not result in actual 64 bits arithmetic code in the system but I have to reason some more about it.

2) Special care must be taken in choosing the value for CH_CFG_ST_TIMEDELTA. This value represents the "uncertainty" level because system jitter. Basically the value is the number of cycles of acceptable jitter in the VTs subsystem. The value is a time interval expressed in system ticks that must be greater than: Longer VT callback routine + time spent in fast IRQs + safety number of cycles.

I tested on an F4 using CH_CFG_ST_FREQUENCY=4000000 and CH_CFG_ST_TIMEDELTA=16, the test suite passes using those values. Note that times specified for VTs can have an error up to CH_CFG_ST_TIMEDELTA*2 cycles (in excess).

Being the matter complex, frequencies in excess of 100kHz are only recommended in case of real necessity of such high resolutions.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [NEWS]Very High Resolutions in Tickless Mode

Post by barthess »

Outstanding numbers! But did you have a deal with projects requiring such resolution?
If yes - what was that (if this information is not against your NDAs)?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS]Very High Resolutions in Tickless Mode

Post by Giovanni »

Of course I cannot comment things under NDA, assuming there are such things :)

It is just the natural evolution path for RT. Competition does not sleep so better push ahead in terms of performance and features.

Giovanni
User avatar
Erikk
Posts: 10
Joined: Wed Jan 22, 2014 1:26 pm
Been thanked: 1 time

Re: [NEWS]Very High Resolutions in Tickless Mode

Post by Erikk »

Which ChibiOs v3 revision is included in Chibistudio Preview 8 ?

Thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS]Very High Resolutions in Tickless Mode

Post by Giovanni »

Frankly I don't remember, you could replace it with a specific revision if you need to keep track of it. Not much different from the current trunk anyway, I just added things since.

Giovanni
Post Reply