Look the the demo programs that came with the installations. One of them has a demo where the HCS12 core and XCore share data.
I do not understand the question here.
Can you please be more specific and explain what is your problem?
One local FAE from Freescale tell me , the local temporary variables are allocated into respective stack for CPU and XGATE, as we know , some function contains mass local temporary variables, hence, how to guarantee the enough Stack/Heap size for all time ? Especially while seven levels interrupt nested?
There is no tool available to statically estimate the memory requirement on the stack.
What you can do is fill the stacks with a fill pattern and let the application run for some time.
Then check how much stack is used.
Alternatively you can set a watchpoint on the top of stack. If there is a stack overflow application will stop.
Note that you can only define 2 watchpoints at a time while debugging on real hardware.
i would like to confirm one thing:
when one call-funtion happened, on the one hand, CPU will store 10 bytes in stack, on the other hand, the CPU will dynamically allocate the RAM resource for the temporary variables in the function, as mentioned ,do these temporary/local variables occupy not other ( non- ) paged ram but stack ? and the same to the XGATE?
Not sure I completely understand your question.
The S12 core related temporary and local variables are all placed into the same stack as function parameters. (see the HC12 and XGATE compiler manual - section "Stack Frames" for more information about using the stacks) S12 core stack have to be placed in the non-paged RAM.
Xgate "emulate" stack pointer using general purpose register R7. The stack has to be located at different global addresses then S12 core stack. XGATE stack can be (and usually is) located in paged RAM area. XGATE Local Memory Map sees this range as linear (see a S12X datasheet -> "XGATE memory map Scheme").
thanks for any hints in advance!
MCU = XEG128, CW4.6, mutilink debuger for HCS12X/XE
in prm file,i put the stack for xgate from 0xFD1000 throughout 0xFD12FF ;
RAM_XGATE_STK = READ_WRITE 0xFD1000 TO 0xFD12FF ALIGN 2[1:1]; /* The stack is set by the XGATE compiler option -Cstv=D300 */
but in the debug mode, open the memory window, XGATE address: D000 ~D3000, i never watch the stack area refresh the contents( all data are gray,never change to red)
something wrong with my setting or operation?
and another issue is: some local variables in XGATE_ISR_LIN() function, which should be stored in XGATE stack according to the xgate compiler spec , was allocated into the other data, i.e. CPU12_DATA CPU12 memory space 0x29f0'L (should say "occupy“ , one breakpoint was set over the local variables in the XGATE_ISR_LIN function to confirm this point), and results in unexpected change of the CPU12_DATA , so would you please tell me how to find the root cause for this issue step by step? or what's the items i should check?
if more info need, i will post it.
Did you set the appropriate option -Cstv for XGATE Compiler?
yes done. in make file
-Cstv = 0xD300
Retrieving data ...