StartOS EE_rq_insert stuck in while loop

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
szalokicsiga
Newbie
Posts: 24
Joined: Thu Oct 13, 2016 2:49 pm

StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga » Mon Dec 19, 2016 10:55 am

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: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by paolo.gai » Mon Dec 19, 2016 11:40 am

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
Newbie
Posts: 24
Joined: Thu Oct 13, 2016 2:49 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga » Mon Dec 19, 2016 1:01 pm

Actually I didn't modify anything in that, so I don't understand.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by paolo.gai » Mon Dec 19, 2016 1:05 pm

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
Newbie
Posts: 24
Joined: Thu Oct 13, 2016 2:49 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga » Mon Dec 19, 2016 3:02 pm

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: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by paolo.gai » Mon Dec 19, 2016 4:10 pm

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

PJ

szalokicsiga
Newbie
Posts: 24
Joined: Thu Oct 13, 2016 2:49 pm

Re: StartOS EE_rq_insert stuck in while loop

Post by szalokicsiga » Wed Dec 21, 2016 10:13 am

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

Post Reply