[INFO] ChibiOS 2.6->3.0 porting guide

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.
User avatar
part1zan_
Posts: 44
Joined: Sun Sep 08, 2013 9:04 pm

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by part1zan_ »

Well, AFAICS, it's definitely not a stack overflow. The thread for 2.x just locks everything by doing nothing in a cycle, when the thread for 3.x does something and doesn't lock anything. That's how I see it from my point of view. Also, how could that be a stack overflow if when I added a sleep function, everything began working just fine?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by Giovanni »

Are threads at the same priority level? In 3.0 round robin is exclusively cooperative, threads at same priority have to yield explicitly in order to rotate.

Giovanni
User avatar
part1zan_
Posts: 44
Joined: Sun Sep 08, 2013 9:04 pm

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by part1zan_ »

Yes, they are at the same priority. But why is it working when I add the sleep function?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by Giovanni »

Because by going to sleep implicitly you yield and the next thread at the same priority goes in.

Giovanni
User avatar
part1zan_
Posts: 44
Joined: Sun Sep 08, 2013 9:04 pm

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by part1zan_ »

Okay, I see. Thank you very much for the explanation.
User avatar
part1zan_
Posts: 44
Joined: Sun Sep 08, 2013 9:04 pm

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by part1zan_ »

Is chrtclib ported to 3.0 yet? I get compiler errors at it.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by Giovanni »

The RTC driver in 3.0 is not yet complete and there will be no chrtclib.

Giovanni
User avatar
part1zan_
Posts: 44
Joined: Sun Sep 08, 2013 9:04 pm

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by part1zan_ »

Aha, I see. So I'll wait for it. Thank you again for your kind replies.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by steved »

A couple of things I've noticed while porting some 2.X code to 3.0:

1. chDebugPanic() seems to have vanished (although still referenced in a couple of macros in chcore.h). What's the OSAL equivalent?

2. The INLINE macro has gone - I note that 3.0 uses 'inline' - does this make it compiler-specific?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [INFO] ChibiOS 2.6->3.0 porting guide

Post by Giovanni »

Hi,

1) Now there are osalSysHalt() and chSysHalt(). I will fix the instances of the old function.

2) The 3.0 kernel has C99 as requirement so INLINE is no more required, "inline" is standard now.

Giovanni
Post Reply