XET256,RPAGE confused

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

XET256,RPAGE confused

Jump to solution
2,680 Views
HUST
Contributor I

 we find the RPAGE is wrong  which results in unexpected behavior.
 one case, firstly the MCU will directly come into Sleep Mode after reset. At last we find the Sleep Flag has been SET by mistake.

  from the map we can get:
                                       - VARIABLES:
      DIM_DWork                               FC165A      20      32     350   RAM_FC_555  
    
    the component DIM_DWork.ProgramMode_Start address should  be in FC166A.
  
  
    and in FD166A  we find
    - VARIABLES:
      slm_sleepMode                           FD166A       1       1       6   RAM_FD_554 


 we suspect the system confused the RAM_FC with RAM_FD .and actually the RPAGE is already wrong  before this operation. But we don’t know why.
 
 so  would you please make it clear? Or explain?
    
 
 and another question is : would you tell  us the mechanism  for the both core XGATE and CPU12 when they  allocate the RAM source to the temporary variables?

 

RPAGE_Error.zip

Message Edited by t.dowe on 2009-09-22 12:34 PM
Labels (1)
Tags (1)
0 Kudos
1 Solution
664 Views
CrasyCat
Specialist III

Hello

 

I checked eth data you sent over.

 

Both the definition and declaration of DLM_DWork should place the variable in the same section.

 

So the declaration the variable should look like:

 

#pragma DATA_SEG __RPAGE_SEG APP_RAM
extern D_Work_DLM DLM_DWork;

#pragma DATA_SEG DEFAULT

 

CrasyCat

View solution in original post

0 Kudos
7 Replies
664 Views
CompilerGuru
NXP Employee
NXP Employee

In the banked memory model, variables placed in the DEFAULT_RAM section must be allocated in the normal 16 bit memory area, and not banked.

Has this been done?

How is DIM_DWork defined and declared, is it in a

#pragma DATA_SEG __RPAGE_SEG NAMEX

(or  #pragma DATA_SEG __GPAGE_SEG NAMEY)

area?

Also note that allocating parts of DEFAULT_RAM into a non paged area is not safe (as it is done in the prm).

>      DEFAULT_RAM             /* all variables, the default RAM location */
>                                INTO  RAM; // Not: RAM_FD,RAM_FC ;

> NAMEX INTO RAM_FD;

> NAMEY INTO RAM_FC;

 

Note that the paged RAM can be used for the XGATE only section (XGATE_RAM).

 

Daniel

 

0 Kudos
664 Views
HUST
Contributor I

Thank you Daniel; I have tried your instruction , but result is still negative.

 

 other direction or comments?

0 Kudos
664 Views
CompilerGuru
NXP Employee
NXP Employee

I don't think I had instructions :smileyhappy:.

What did you change? Did you make sure DEFAULT_RAM gets allocated non banked only?

How is the non working variable declared/defined?

Daniel

0 Kudos
664 Views
CrasyCat
Specialist III

Hello

 

I looked at the .prm file you have attached.

DEFAULT RAM is placed in banked memory, which is not correct if you are building in banked memory model.

 

You need to either place DEFAULT_RAM in non banked memory or define the variable in a __RPAGE_SEG user defined section. 

 

CrasyCat

0 Kudos
664 Views
HUST
Contributor I

thanks for both!

 

attachment please kindly find the updated prm and definition.

 

 

0 Kudos
665 Views
CrasyCat
Specialist III

Hello

 

I checked eth data you sent over.

 

Both the definition and declaration of DLM_DWork should place the variable in the same section.

 

So the declaration the variable should look like:

 

#pragma DATA_SEG __RPAGE_SEG APP_RAM
extern D_Work_DLM DLM_DWork;

#pragma DATA_SEG DEFAULT

 

CrasyCat

0 Kudos
664 Views
HUST
Contributor I
thanks for any comments!
0 Kudos