Pumpkin, Inc.

Pumpkin User Forums

problem with the 8th task

If you can't make Salvo do what you want it to do, post it here.

problem with the 8th task

Postby aek » Fri Jun 08, 2007 7:07 am

Check that _all_ of the tasks have infinite loops, e.g.

code:
while (1)
{
...
}

and that all tasks have an OS_Xyz() context switch in them ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: problem with the 8th task

Postby gloin » Fri Jun 08, 2007 11:46 am

I m trying to do a very simple application, with 8 tasks, i m only toggling a led for each task. Im using pic18f6680, an icd2, and hitech compiler. When i create 8th task, everything is stopping. I dont forget to change this line when i create the new task

#define OSTASKS 8

could anyone help me?

regards,

------------------
Gloin

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Re: problem with the 8th task

Postby gloin » Sun Jun 10, 2007 10:12 am

hello aek,

I wrote my tasks like this;

void Taskn(void)
{
for(; ;)
{
LATDm = !LATDm;
OS_Delay(1000, Task1L);
}
}

n = 1,2 .. 8
m = 0,1,.. 7

I managed to run 8 tasks when I selected the
"Compile for ICD2" option from the build options. Before this I was getting stack overflow error in the mplab simulator. Then I added a 9th task, there was no problem, but with the 10th task I got the same stack overflow error. Do you have any suggestions?

regards,

------------------
Gloin

[This message has been edited by gloin (edited June 10, 2007).]

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Re: problem with the 8th task

Postby gloin » Sun Jun 10, 2007 10:36 am

for example if i create one binary semaphore, i can only run 3 tasks, if i add 4th task, everything stops because of stack overflow error

------------------
Gloin

[This message has been edited by gloin (edited June 11, 2007).]

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Re: problem with the 8th task

Postby aek » Mon Jun 11, 2007 6:03 am

It sounds to me like you're running out of memory ...you need to examine your memory maps and make sure that the blocks of RAM that Salvo is using are not being overwritten by someone else, and that your linker is properly configured.

You are using Salvo Pro but I don't recognize your userid as being a Pumpkin Salvo customer. If you bought Salvo through HI-TECH you'll need to get your support through them at www.htsoft.com.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: problem with the 8th task

Postby gloin » Mon Jun 11, 2007 9:53 am

quote:
Originally posted by aek:
It sounds to me like you're running out of memory ...you need to examine your memory maps and make sure that the blocks of RAM that Salvo is using are not being overwritten by someone else, and that your linker is properly configured.

Is there a way to configure it?

quote:
You are using Salvo Pro but I don't recognize your userid as being a Pumpkin Salvo customer. If you bought Salvo through HI-TECH you'll need to get your support through them at www.htsoft.com.
[/B]
I m a student and studying with salvo at school.

regards,

------------------
Gloin

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Re: problem with the 8th task

Postby aek » Tue Jun 12, 2007 12:39 am

Linker options are set via the compiler ... however, I don't think the HI-TECH linker needs much attention.

What happens if you do a library build instead of a source-code build? Do the issues go away?

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: problem with the 8th task

Postby gloin » Tue Jun 12, 2007 10:28 am

after building of the project hitech compiler gives this memory map:

Memory Usage Map:

Program ROM $000000 - $000CFF $000D00 ( 3328) bytes
Program ROM $000D08 - $00118F $000488 ( 1160) bytes
$001188 ( 4488) bytes total Program ROM

RAM data $0000E9 - $0000FF $000017 ( 23) bytes
RAM data $000CD7 - $000CF3 $00001D ( 29) bytes
$000034 ( 52) bytes total RAM data

Near RAM $000000 - $000055 $000056 ( 86) bytes total Near RAM
ROM data $000D00 - $000D06 $000007 ( 7) bytes total ROM data
Config Data $300000 - $300009 $00000A ( 10) bytes total Config Data


Program statistics:

Total ROM used 4495 bytes (6.9%)
Total RAM used 138 bytes (4.1%) Near RAM used 86 bytes (89.6%)

my salvocfg.h file is below
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSL
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSB
#define OSTASKS 10

I tried slp86lab.lib and gave stack error again? should i change the pic18f6680? my friend tried a project with 5 tasks and 2 binary semaphores with 18f452, salvo and hitech compiler is same as me. It is working without a problem.

In addition, you know i get stack error with 10 tasks, if i used one bin.semaphore, i could create only 3 tasks, at 4th task, i got the same stack overflow error.

as i wrote before in my code im only toggling an output pin and delaying that task, can delaying all 10 tasks cause a stack overflow. My all tasks have same priority.

------------------
Gloin

[This message has been edited by gloin (edited June 13, 2007).]

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Re: problem with the 8th task

Postby aek » Wed Jun 13, 2007 9:03 am

Have you downloaded, installed and used the latest patch:

quote:
salvo-lite|le|pro-pic-3.2.3-e.zip is a complete set
of new Salvo libraries and a new header file for use
with the HI-TECH PICC-18 compiler v9.50PL2 and above
(it may also work with earlier versions of PICC-18).
This resolves the issue of errors involving Salvo
objects in the NVRAM area, e.g. 'Error[491]: can't
find 0x83 words for psect "nvram" in segment "NVRAM"'
that will occur when a large number of Salvo tasks
and events are defined. Unzip all of the library and
header files into their respective directories.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: problem with the 8th task

Postby gloin » Wed Jun 13, 2007 10:17 am

quote:
Originally posted by aek:
Have you downloaded, installed and used the latest patch:


i will try it as soon as possible, thank you


------------------
Gloin

[This message has been edited by gloin (edited June 13, 2007).]

Gloin
gloin
 
Posts: 7
Joined: Thu Jun 07, 2007 11:00 pm

Next

Return to Coding

Who is online

Users browsing this forum: No registered users and 0 guests

cron