Pumpkin, Inc.

Pumpkin User Forums

SALVO and bank problems

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

SALVO and bank problems

Postby luben » Fri Nov 21, 2003 1:20 am

Hello,

I'm working with the latest SALVO 3.2.3 and HiTech PIC 8.02PL1. I suffer from "unstable" problems - actually everything works , but from time to time I got strange behaviour, especially with the Messages - or they point to wrong address, or when refreshing the LCD task sometimes the whole project hangs - I suspect that I have the old problems with the variables and banks (resetbanks solution if you remember).

I suspect that the new HiTech version brought again this problem, because 3 months ago I never had such problems

the project is 3 events, 3 tasks (2 BINSEM an 1 message).

Any suggestions?
Best regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby aek » Fri Nov 21, 2003 3:24 am

On the PICs with PICC and PICC-18, I wouldn't expect too many problems with sprintf() ... I'll take a look nonethless.

Are you sure that you're not invoking the WDT when sprintf() is called? It can be very, very long ...

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

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

Re: SALVO and bank problems

Postby aek » Fri Nov 21, 2003 7:04 am

Hi Luben.

Well, I doubt that HI-TECH have "undone" the bank issue that was fixed in v8.0x ... if you send me the project I'll take a look ...

Of course, one quick test you can do is to disable optimizations on the files that have Salvo tasks in them ...

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

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

Re: SALVO and bank problems

Postby aek » Fri Nov 21, 2003 9:25 am

Come to think of it ... 8.02PL1 has been around a while, and we've been using it quite a bit -- so I don't think that's the issue ...

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

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

Re: SALVO and bank problems

Postby luben » Fri Nov 21, 2003 11:06 am

Hello,

I sent you the project to your mail.
What I'm suspecting is the "sprintf" command - without it it looks like there are no problems (or at least they are not so much).

Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby luben » Sat Nov 22, 2003 1:13 am

Hello,

I suffered from this problem both when WDT is ON or OFF (in MPLAB6xx when debugging the WDT is always OFF)...

Right now I'm removing the sprintf command and exchanging it with my routines. A suffered many times from sprintf - it's unpredictable command in meaning of RAM usage - if you try to create complicated calculations inside of it or if you use too many variables you'll be in trouble.

Obviously this is not a problem of the SALVO, but because SALVO cant' work without HiTech compiler, the problem of the compiler becomes SALVO problems as well...

Regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby luben » Sat Nov 22, 2003 7:26 am

Hello,

It's not from sprintf command - after i removed it - I got still the same (or similar) problems.

I got that the main reason of the problem is one task (TASK_Display) - something happens with the pointers.... will keep you in touch.

Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby luben » Mon Nov 24, 2003 2:00 am

Hello,

I think that the problem stays in OSSignalXYZ from ISR (OSFROM_ANYWHERE) - after I moved all signalling to main level - there are no problems.

I sent you the project to your mail - there I used moving the OSSignalXYZ from ISR to main level.

I checked that the error exists in old versions of SALVO and HiTech as well - compiled with 8.01PL3 (with aspic.exe fix) and SALVO 3.0 , 3.1, etc. - same result, well the hanging or resetting was slightly changed, but still exists.

best Regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby aek » Mon Nov 24, 2003 10:55 am

Hi Luben.

Your application is crashing because of a small oversight on your part ... you forgot to protect OSSignalBinSem() in mainline code via OSProtect() and OSUnprotect() ...

Without this protection, you are sure to encounter run-time errors. The occasional nature of the error that you observed is typical of failing to protect functions that are in multiple callgraphs from interrupts.

See RM-PICC.PDF for more info ...

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

[This message has been edited by aek (edited November 24, 2003).]

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

Re: SALVO and bank problems

Postby luben » Mon Nov 24, 2003 11:21 am

Hello,

Sounds great! This explains everything!

Does that mean that if I have 3 different BinSem and one of them is signaled from ISR I should protect/unprotect all of other signalXYZ services?

I mean - if I use once OSSignal XYZ in the ISR I should protect/unproitect all other OSSignal events from the same type in the main level?

In my case I Signaled one BINSEM only from ISR and other only in the main line. So, I should protect the second BinSem, despite that it's not called in ISR, right?

Anyway - this sounds like good solution for such problems... maybe I have to review again my old projects, because in many of them I fill that such issue exists. Which version of SALVO introduced at first protect/unprotect?

What I see is that I suffered from multientrance problem - while I'm into one SALVO routine in main level I try to reenter it again from ISR - the result is really what I saw - unstable system!

Best regards
Lubne

[This message has been edited by luben (edited November 24, 2003).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Next

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron