StartOS EE_rq_insert stuck in while loop

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Locked
szalokicsiga

StartOS EE_rq_insert stuck in while loop

Post 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!
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

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

Re: StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga »

Actually I didn't modify anything in that, so I don't understand.
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

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

Re: StartOS EE_rq_insert stuck in while loop

Post 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!
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by paolo.gai »

ok, good to know... what kind of project are you currently developing?

PJ
szalokicsiga

Re: StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga »

I'm just trying to integrate the OS into an existing project in a company. Just basic cyclic tasks and ISRs.
Locked