System lockup when using chvprintf()

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

colin
Posts: 149
Joined: Thu Dec 22, 2011 7:44 pm

Re: System lockup with synchronous message passing

Post 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.
JetForMe
Posts: 99
Joined: Mon Jan 31, 2011 8:12 am

Re: System lockup when using chvprintf()

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: System lockup when using chvprintf()

Post 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
Post Reply