AnsweredAssumed Answered

Problem with XGATE addressing

Question asked by lowpy on May 4, 2011
Latest reply on May 10, 2011 by lowpy

I am trying to use XGATE to execute a section of code on XGATE in parallel with code on S12 in order to speed up the overal execution of a function on a MC9S12XDT512 micro. In doing this the XGATE and S12 code has to access a common data area and this is where I got problems.

 

I declared the common variables in the SHARED_DATA segment but depending on how I use them I encounter an error in the debuger that says: No memory at [mmmm'X:1], where mmmm is an address.

 

If I use something like this:

 

#pragma DATA_SEG SHARED_DATAvolatile unsigned long X[16];#pragma DATA_SEG DEFAULTinterrupt void SoftwareTrigger0_Handler(int dataptr) {/*do something with data in vector X.....*/}

 

 

all works just fine but if I try this for example:

 

 

#pragma DATA_SEG SHARED_DATAvolatile unsigned long X[16];volatile unsigned char *pX;#pragma DATA_SEG DEFAULTvoid S12_core_function(){  pX = &X[4];  /*generate SW trigger*/}interrupt void SoftwareTrigger0_Handler(int dataptr) {/*do something with data ad address pX.....*/}

 the debug stops and the Command windows says No memory at [mmmm'X:1], and mmmm is the address of X[4]. If I try to check the data in the X variable with the Show location option in right click menu the Memory window shows Logical addresses. If I try to see what is at the address pX is pointing at, using the same method the Memory window shows XGATE addresses where the address it is looking for is not used.

 

If someone knows what I'm doing wrong please give me at least a hint on how I could fix my code. I need to use the second method because XGATE code I'm implementing will not always start processing data from the same address and I need to control where it starts processing.

 

Thanks in advance.

Outcomes