Page 2 of 2
Re: System lockup with synchronous message passing
Posted: Fri Oct 10, 2014 6:44 pm
by colin
JetForMe wrote:Any chance there's the potential for deadlock when all threads have the same priority, and all are sending synchronous messages as described?
I recall that ChibiOS 3.x removes the preemptive round-robin feature that 2.x had. Now round-robin scheduling is completely cooperative. (I think this is a unfortunate BTW that this is not an option any longer.) So it seems that if all your threads are at the same priority, and one of them doesn't yield by sleeping, waiting, etc. then yes it could cause a "hang". But be careful how you use the word
deadlock. Your lockup may or may not be a
deadlock, which is an issue with the order of resource acquisition.
Re: System lockup when using chvprintf()
Posted: Fri Oct 10, 2014 7:19 pm
by JetForMe
Well, I don't want to split hairs about exactly what's causing execution to stop; that was mere speculation. The point is, it does, and now, with the priorities I've assigned, it seems to run non-stop (it ran all night without the watchdog kicking in).
What you say about the removal of preemptive scheduling is disappointing, though. In any case, this is ChibiOS 2.6.4.
Re: System lockup when using chvprintf()
Posted: Sat Oct 11, 2014 7:25 am
by Giovanni
You need debugger support, hard to tell what goes wrong, you may port your code on a discovery board and use that for debug.
About preemptive round robin, it is still present in 3.0 but defaulted to OFF (CH_CFG_TIME_QUANTUM=FALSE) because it is not compatible with the tickless mode (CH_CFG_ST_TIMEDELTA!=0).
Giovanni