CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Run on V4 compiler and not on V5

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
LCHARLES



Joined: 19 Sep 2014
Posts: 3

View user's profile Send private message

Run on V4 compiler and not on V5
PostPosted: Fri Sep 19, 2014 10:16 am     Reply with quote

Hi sorry for my poor english i’m french !

I have a compilation problem with one of our application.
We use Pic18f67J10.
The application was build on a V4.112 compiler few months ago.
We update our CCS Compiler in spring to V5.020

With the V4.112 compiler all is OK. The application run perfectly.

With the 5.020 we are seeing an erratic run (we suspect memory crash).

In the source, we are using structure in some structure with different type of data (int1, int8, array of structure etc ….)
We pad the structure int1 to 16 - no effect !

May be some optimization or changes in the two compiler versions make pb

Have you any idea ?

Waiting for a response.

Best regards .
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Sep 19, 2014 11:25 am     Reply with quote

very early Version 5 did have it's 'problems' I strongly suggest you buy or upgrade to the current version or stay with your known stable version 4,
unless there are specific reasons to upgrade to 5.

hth
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 19, 2014 4:52 pm     Reply with quote

Quote:
In the source, we are using structure in some structure with different type
of data (int1, int8, array of structure etc ….)
We pad the structure int1 to 16 no effect !

If you think that's the problem, post a small compilable test program
that has this structure in it. Then we can compile it and look at the .LST
file for problems.

Other ideas:

1. Read these threads and see if they are related to your problem:

Code made in version 4.114 does not work in version 5.
http://www.ccsinfo.com/forum/viewtopic.php?t=52786

Strange problem compiler versions.
http://www.ccsinfo.com/forum/viewtopic.php?t=52197

SD Card Lite Driver from brushelectronics.com
http://www.ccsinfo.com/forum/viewtopic.php?t=52237

2. Compile your program with both versions of the compiler.
Do it on different PC's, or do a clean install each time, so you're certain
the correct version files are being used for each compilation. Then
compare the Config Words at the end of the .LST file. Are they the same
for each compilation ? Look at the numbers. There may be something
wrong with vs. 5.020:
http://www.ccsinfo.com/forum/viewtopic.php?t=51991&start=8
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Sep 21, 2014 10:18 am     Reply with quote

didn't you use arrays?
the fact that the crash occurs after some operation make me suspicious.

mis indexing /or over-indexing an array
can cause a crash too!!

and the difference between static mem address thats overflowing
could stem from WHERE and in what ORDER your vars were placed.
that's tougher to figure out .....
anyway
PS: PCM programmer donated an excellent course level 101 in
HOW to THINK about your problem too.

the .LST file comparision is your friend here
on EITHER cause of your trouble.

introduce yourself to it.......
Very Happy Very Happy Very Happy Very Happy Very Happy
LCHARLES



Joined: 19 Sep 2014
Posts: 3

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 8:06 am     Reply with quote

Hi
Thank you to all who responded !

May be i find something !

I use some structure of structure .
When i access the Array of bits named DefF1,DefF2,DefFeux it is the beginning
of the structure (TAFFICHAGE Aff[NBLIG]; ) who is modified.

best regards

Code:
#define NBLIGNES 1      // variable define
#define NBPAGEMAX 3
#define NBCARLIG_LOGIQUE  12
#define NBFEUXLEDS  23


typedef struct
   {
   int8           TypeAff;                 
   int8           Mode[NBPAGEMAX];           
   char           Texte[NBPAGEMAX] [NBCARLIG_LOGIQUE+3];
   int16          Taff[NBPAGEMAX];
   int16          Tnoir[NBPAGEMAX];
   int8           NbPage;
   int1           trou[15];   
   int1           Ok;     
} TAFFICHAGE;


typedef struct
   {
   unsigned int8  PageEnCours;
   unsigned int16 CptAff[NBPAGEMAX];
   unsigned int16 CptNoir[NBPAGEMAX];
   unsigned int8  TypeDefSa2[NBCARLIG_PHYS];
   unsigned int8  IndiceRapide[NBPAGEMAX];
   unsigned int8  CptRapide[NBPAGEMAX];
   
   int1           trou[12];   
   int1           FirstAff; 
   int1           EnAff;     
   int1           EnNoir;   
   int1           Rapide[NBPAGEMAX];     
} TDATA_AFFICHAGE;

typedef struct {
   int8  Fleche; 
   int8  LastCdeFleche;                     
   int8  PosFleche;
   
   int1  trou[8];
   int1  Ak5;                       
   int1  Gyro;                     
   int1  GyroBleu;                 
   int1  Sirene;                   
                                   
   int1  FeuxTravDroite;           
   int1  FeuxTravGauche;           
   int1  Feux;     
   int1  XenonAk5;   
} TCDE;


typedef struct {
   TCDE Cde;       
   TAFFICHAGE Aff[NBLIG];
   TDATA_AFFICHAGE DatAf[NBLIG];
   
   int8 DefGlob;       
   unsigned int8 CdeLum;
   unsigned int8 LumCours;
   int8 IndiceSa2;         
   unsigned int8 EtatLum;

   int1  trou[14];       
   int1 DefF1[NBFEUXLEDS];
   int1 DefF2[NBFEUXLEDS]; 
   int1 DefFeux[NBFEUXLEDS];
   int1 VFont4x7;           
   int1 SimuFont6x7;       
} TFLU;
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 9:34 am     Reply with quote

Code:
NBLIG
NBCARLIG_PHYS

Your structure doesn't compile if I put it in a test program. It's missing
the #define statements for the constants shown above.

Quote:
When i access the Array of bits named DefF1,DefF2,DefFeux it is the beginning
of the structure (TAFFICHAGE Aff[NBLIG]; ) who is modified.

Post some code that shows how you access the array of bits.
I'm trying to make a test program. You should actually do that.
A test program is a small, complete, compilable program that
demonstrates the problem.
LCHARLES



Joined: 19 Sep 2014
Posts: 3

View user's profile Send private message

PostPosted: Tue Sep 30, 2014 12:54 am     Reply with quote

hi
Code:

#define NBLIG 1
#define NBCARLIG_PHYS 11


I access almost like this :
Code:

TFLU Flu;
int1 def;  // (result of function)
int8 numfeu;

for (numfeu=0;numfeu<NBFEUXLEDS;numfeu++)
  {
//  def=func();
  def=1

  if (def)
    { 
    if (Flu.DefF1[numfeu]==0)   
      Flu.DefF1[numfeu]=1;
   else
      if (Flu.DefF2[numfeu]==0)
        Flu.DefF2[numfeu]=1;
    else
      if (Flu.DefFeux[numfeu]==0)
        {
        Flu.DefFeux[numfeu]=1;
        ret=false;       
        }
    }
  else
    {
    Flu.DefF1[numfeu]=0;
    Flu.DefF2[numfeu]=0;
    Flu.DefFeux[numfeu]=0; 
    }
  }


My boss told me that I have already spent a lot of time with this problem. I have no more time for further investigations.


best regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group