Sharing Data between XGATE and CPU

Showing results for 
Search instead for 
Did you mean: 

Sharing Data between XGATE and CPU

Contributor I
This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.
Posted: Fri Sep 16, 2005 7:31 am

I want to transfer Data, which is produced by the CPU, over the SCI. The SCI is controlled by the XGATE. How can i share Data between the CPU and the XGATE? Are there any software examples? I'm using Codeworrier 4.1.

Posted: Fri Sep 16, 2005 7:50 am    
the easiest way is simply to declare a buffer or structure that both CPU and XGATE can see.
You can define this in either the XGATE source or the CPU source and it works in the same way that sharing data between any C source files works.
So starting from the wizard example you could declare a buffer in xgate.cxgate:
unsigned char buffer[10];

Then in main.c you would declare this as externally defined:
extern unsigned char buffer[];

Now both cores can write into and read buffer.

If you need to use a structure then define that in some common header.

You need to be careful that both are not writing the same location at the same time so consider using the hardware MUTEX semaphores on XGATE or some other scheme.
Posted: Fri Sep 16, 2005 8:24 am    
Thank's for your help
Labels (1)
0 Kudos
0 Replies