Page 1 of 1

StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 10:55 am
by szalokicsiga
Hi!

In EE_oo_StartOS() my program stucks in EE_rq_insert() function in the following while loop:

p = EE_NIL;
q = EE_rq_first;
prio = EE_th_ready_prio[t];

while ((q != EE_NIL) && (prio <= EE_th_ready_prio[q])) {
p = q;
q = EE_th_next[q];
}

I couldn't find out why is it stuck.

The values are:
q=0
p=0
prio=2
EE_th_ready_prio=(2,8,128,64,32,16,4,256,1)
EE_th_next=(0,0,0,0,0,0,0,0,0)

Does anybody have any idea?
Thank you!

Re: StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 11:40 am
by paolo.gai
EE_NIL is -1

I guess you modified the default initialization of the data structures, the one you published will never work... just try...

PJ

Re: StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 1:01 pm
by szalokicsiga
Actually I didn't modify anything in that, so I don't understand.

Re: StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 1:05 pm
by paolo.gai
th_next is used to queue tasks in the ready or stacked queue... all 0 is not a valid value! is the configuration coming out of RT-Druid initializing everything to 0? that seems really really strange!

PJ

Re: StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 3:02 pm
by szalokicsiga
Sorry, my bad. NVM_init accidentally wrote zeros to the memory, where is EE_th_next is stored...
Thank you for your help!

Re: StartOS EE_rq_insert stuck in while loop

Posted: Mon Dec 19, 2016 4:10 pm
by paolo.gai
ok, good to know... what kind of project are you currently developing?

PJ

Re: StartOS EE_rq_insert stuck in while loop

Posted: Wed Dec 21, 2016 10:13 am
by szalokicsiga
I'm just trying to integrate the OS into an existing project in a company. Just basic cyclic tasks and ISRs.