PDA

View Full Version : [MADos] scheduler problem



g3gg0
08-09-2003, 02:51 AM
does someone know little bit about ARM processors?
i set up a timer based scheduler in MADos, but under
special cirumstances the whole phone hangs...
i really dont know why it doesn schedule anymore

maybe someone can help a little bit :rolleyes:
just contact me, i'll explain and give src

wumpus
08-09-2003, 12:09 PM
Sounds like a deadlock... Or the opposite two threads trying to access a device (notacibly ccont) at the same time.
Other THings To Check:
- forgot to terminate/mark interrupt handled by writing 1 to the approciate bit

- bx lr(return; gcc generates this with empty handlers) in combination with mov lr,pc when doing procedure jump tables (ARM mode elephants wreak havoc in THUMB code)

- is the hangup timed? maybe it is some timer unaccounted for

- buffer overflows/code runovers :-(

- stacks

<M457>
09-09-2003, 11:32 AM
I've found the problem :smile:

in the function toggle() you need to take off ccont_reset_wdt(),
and your scheduler will works perfectly!
tested with up to 8 threads.
byE ;)


-=)(M457)(=-

g3gg0
09-09-2003, 01:53 PM
I've found the problem :smile:

in the function toggle() you need to take off ccont_reset_wdt(),
and your scheduler will works perfectly!
tested with up to 8 threads.
byE ;)


-=)(M457)(=-

aiiiiii : )
didnt try wumpus' tips yet, but he was right as u figured out : D
(i set up gccarm for linux yesterday...)
i should create a thread that only does hardware-IO so its seperated
from the other threads, or some mutex implementations....

thanx : )


so now i can slow down the scheduler... its a little bit too fast imho...
what do u think is a good scheduler time?
i guess 50ms is a good value.. every task gets 50ms of cpu power
then it gets switched

wumpus
09-09-2003, 03:23 PM
guess 50ms is a good value.. every task gets 50ms of cpu power
then it gets switched
That should be enough, especially on a slow embedded system like the DCT3, all task switching overhead is wasted time :-)

Most tasks in a realistic system will run much less than the allocated 50ms anyway, they will need a mutex or data from another task way before that. (IO driven not CPU driven)