Getting stuck with tickless mode

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

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

Re: Getting stuck with tickless mode

Post by Giovanni »

That "vt_lasttime" at 65000 confirms my suspect, thanks for all the data.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Getting stuck with tickless mode

Post by steved »

Up to 60 hours continuous operation on a 32F051 now - looking very promising. However, if I've done the sums right a 32-bit counter at 10KHz rolls over after about 120 hours, so I'll leave it running for now, especially in view of rbarreiros' experience.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Getting stuck with tickless mode

Post by Giovanni »

Fixed the problem as bug #573.

It was a missing cast, integer promotion rules kicked in and a comparison failed. There was also another problem that could have affected 32 bits counters too.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Getting stuck with tickless mode

Post by steved »

Giovanni wrote:Fixed the problem as bug #573.

It was a missing cast, integer promotion rules kicked in and a comparison failed. There was also another problem that could have affected 32 bits counters too.

Giovanni

I've downloaded the changes and got them on test - running for an hour now, and the code seems to run much 'better'. I am continuously polling a serial port, and on the last effort it was showing a lot of symptoms of things taking too long in the ST code; mostly erratic return of data. Now its much more stable, with just an occasional error (which is mostly down to the test setup, not helped by my dodgy vintage Delphi code and the things that Windows occasionally decides are more important than running my software)
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Getting stuck with tickless mode

Post by Giovanni »

Delphi? I still do things with Delphi 7 and I still think it is the best. I still use it for my programming needs on desktop. Actually it inspired the modularity I strive for in ChibiOS.

The symptoms you mentioned could have been caused by the issue I resolved. The problem with the tickless mode is that I have still to find a way to test it exhaustively, unlike everything else in the kernel. I think the only solution is a long duration stress test along the lines of "IRQ-STORM".

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Getting stuck with tickless mode

Post by steved »

Giovanni wrote:Delphi? I still do things with Delphi 7 and I still think it is the best. I still use it for my programming needs on desktop.
Pascal was the first high level language I used on embedded systems - took a little educating of the compiler authors about the difference between RAM and ROM! Nice to see you stopped at Delphi 7 as well :) I've not yet found anything better, but its getting a bit long in the tooth.

Giovanni wrote:The symptoms you mentioned could have been caused by the issue I resolved. The problem with the tickless mode is that I have still to find a way to test it exhaustively, unlike everything else in the kernel. I think the only solution is a long duration stress test along the lines of "IRQ-STORM".

Once it all looks solid for a week or so I'll have it running on three processors 24/7, which is a start; certainly my code uses the virtual timers extensively, with enough interrupts and task switching to add a touch of randomness.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Getting stuck with tickless mode

Post by Giovanni »

Bad and good news....

The bad one is that I fixed another significant bug in the tickless mode (#577), this could cause intervals shorter than normal, this could be the cause of the strange events you observed steved.

The good one is that, finally, I can now test it properly, the test application revealed the problem and it has been running the stress test for hours now.

I will make another release later just for this one.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Getting stuck with tickless mode

Post by steved »

Giovanni wrote:Bad and good news....
Giovanni

As you say - my setup had been running for 5 days continuously without a lockup.
Have implemented the latest changes; had a couple of hours running, and subjectively it appears a little 'better'. Will try and give it a week before stopping it.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Getting stuck with tickless mode

Post by steved »

Have now had my test 32F051 board running continuously for fractionally under 7 days without it faltering, so I think we can say this is sorted!

About to put the same code into two more boards for 'permanent' test.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Getting stuck with tickless mode

Post by Giovanni »

Thanks for confirming :)

This was one of the few remaining open points.

Giovanni
Post Reply