Code not compiled with CW5.7 and HCS08GT32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Code not compiled with CW5.7 and HCS08GT32

Jump to solution
2,846 Views
VianneyC
Contributor I
Good morning,

I am using CodeWarrior V5.7 to compile some code for the HCs08GT32 microcontroller.
The problem I have is the next :
I have some C code,

Code:
#if EY_FAMILY || AP_FAMILY if ( MASS_ERASE_EN )   fl_mass_erase();#endif  INF_LOOP:  {  STOP_FLTIM();           /* stop rx timeout timer */      fl_data.fl_str.length = 0xFF-3;      chks = 0;  byte_cnt = 0;  RESET_SCI_RX_FLAGS();  /* reset of SCI rx flag */

and because the result waited does not work I looked the LST file,

Code:
  546:  #if EY_FAMILY || AP_FAMILY  547:   if ( MASS_ERASE_EN )  548:     fl_mass_erase();  549:  #endif  550:    551:    INF_LOOP:  552:    {  553:    STOP_FLTIM();        /* stop rx timeout timer */  554:    555:        fl_data.fl_str.length = 0xFF-3;  0004 6efc01   [4]             MOV   #-4,fl_data:1  556:      chks = 0;  0007 95       [2]             TSX     0008 6f01     [5]             CLR   1,X  557:    byte_cnt = 0;  000a 7f       [4]             CLR   ,X  558:    559:    RESET_SCI_RX_FLAGS();  /* reset of SCI rx flag */  000b 450004   [3]             LDHX  @SCIR:4  000e f6       [3]             LDA   ,X  000f e603     [3]             LDA   3,X  0011 e602     [3]             LDA   2,X  0013 2007     [3]             BRA   L1C ;abs = 001c

 as you can see, the "STOP_FLTIM" macro do not have the corresponding ASM code.

Has someone already seen this behavior of CW ? What can I do to avoid that ?



Below, you can find the code of the macro "STOP_FLTIM" :

Code:
#define STOP_FLTIM() \   STOP_TIM(FLTIM); /* stop and reset FLTIM timer */ \   RESET_TIM(FLTIM); \         RESET_TOVF(FLTIM); /* reset FLTIM flag */ \ #define _STOP_TIM(t)          t##SC &=  ~(CLKSB|CLKSA); #define STOP_TIM(f)           STOP_TIM_a(f##_timer) #define STOP_TIM_a(t)         _STOP_TIM(t) #define _RESET_TIM(t)         t##CNTL = 0; #define RESET_TIM(f)          RESET_TIM_a(f##_timer) #define RESET_TIM_a(t)        _RESET_TIM(t)#define _RESET_TOVF(t)        {READ_REG(t##SC);t##SC&=~TOF;}#define RESET_TOVF(f)         RESET_TOVF_a(f##_timer)#define RESET_TOVF_a(t)       _RESET_TOVF(t)

 Below, you can find the macro preprocessed :

Code:
( * ( ( volatile ZByte * ) ( 0x30 ) ) ) &= ~ ( 0x10 | 0x08 );;( * ( ( volatile ZByte * ) ( 0x32 ) ) ) = 0 ;; { ( ( * ( ( volatile ZByte * ) ( 0x30 ) ) ) ) ; ( * ( ( volatile ZByte * ) ( 0x30 ) ) ) &= ~ 0x80 ; };;

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
735 Views
Lundin
Senior Contributor IV
0 Kudos
6 Replies
735 Views
CrasyCat
Specialist III
Hello
 
I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.
 
CrasyCat
0 Kudos
735 Views
Phoenix
Contributor III
I investigated this ServiceRequest - everything works fine. There is BSR instruction at the beginning of mentioned function. Just disable compiler optimization ( -O0 ) and the code will be at the place you are looking for it.
0 Kudos
735 Views
Alban
Senior Contributor II
Hi,

Your macro + call include a semi-column.
Your preprocessor output confirms your lines ends with ";;"

This is not standard C to end lines with double ;

Try and fix that first.
Alban
0 Kudos
735 Views
CompilerGuru
NXP Employee
NXP Employee
Actually I think this is perfectly legal for statements, according to C there is something called an "empty statement". and having a bunch of semicolons together just means to have a bunch of empty statements :smileyhappy:.

When I remember right, additional semicolons are not legal for declarations, there it is a common extension many compiler support, anyway. The double semicolon is not the problem.

What I would do is to preprocess the complete source file,
save it as *.c file, add it to the project and check if compiling that does still cause the issue. Then depending on the result, try to simplify the test file or to see what happens during preprocessing.

Also the 5.7 is the version of the ide, which does not matter much. What is the version of the product?
Something like "CW for HC(S)08 V5.1" for example.

Daniel
0 Kudos
736 Views
Lundin
Senior Contributor IV
0 Kudos
735 Views
VianneyC
Contributor I
I am sorry. I do not understand your message.
What I am supposed to do ?

Vianney


0 Kudos