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?
Solved! Go to Solution.
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
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
Thank you Daniel; I have tried your instruction , but result is still negative.
other direction or comments?
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
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
thanks for both!
attachment please kindly find the updated prm and definition.
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