I downloaded the directory. At first I tried using cygwin's "make" command on the makefiles, but neither did anything. Then I moved the directory to my project and tried to compile, but I got a ton of errors.
What exactly should I do get this thing working?
How do I use the sc_xscope_support-master directory?
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
The repository sc_xscope_support contains API definitions for transmitting and receiving xSCOPE data between the host and the device. This repository will not build as it is and this needs to be included in the host application. The example usage of the host application is available in the following link:
https://github.com/xcore/sw_startkit_ex ... _control.c
In the above file, hook_data_received function receives all the data (Except print messages) that is sent by xSCOPE and stores in the data buffer. If you want to send data from the host to the device, you need to use xscope_ep_request_upload function.
On the device side, sample usage is available in the following link:
https://github.com/xcore/sw_startkit_ex ... control.xc
xscope_data_from_host receives data from the host.
From the below file:
https://github.com/xcore/sw_startkit_ex ... src/dsp.xc
You can see function xscope_int to send data from the device to the host.
Hope this helps.
https://github.com/xcore/sw_startkit_ex ... _control.c
In the above file, hook_data_received function receives all the data (Except print messages) that is sent by xSCOPE and stores in the data buffer. If you want to send data from the host to the device, you need to use xscope_ep_request_upload function.
On the device side, sample usage is available in the following link:
https://github.com/xcore/sw_startkit_ex ... control.xc
xscope_data_from_host receives data from the host.
From the below file:
https://github.com/xcore/sw_startkit_ex ... src/dsp.xc
You can see function xscope_int to send data from the device to the host.
Hope this helps.
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Thank you.sethu_jangala wrote:The repository sc_xscope_support contains API definitions for transmitting and receiving xSCOPE data between the host and the device. This repository will not build as it is and this needs to be included in the host application. The example usage of the host application is available in the following link:
https://github.com/xcore/sw_startkit_ex ... _control.c
In the above file, hook_data_received function receives all the data (Except print messages) that is sent by xSCOPE and stores in the data buffer. If you want to send data from the host to the device, you need to use xscope_ep_request_upload function.
On the device side, sample usage is available in the following link:
https://github.com/xcore/sw_startkit_ex ... control.xc
xscope_data_from_host receives data from the host.
From the below file:
https://github.com/xcore/sw_startkit_ex ... src/dsp.xc
You can see function xscope_int to send data from the device to the host.
Hope this helps.
So essentially I use xscope functions normally on the XMOS, then run a program on the computer which will redirect xscope messages to somewhere else?
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
Yes, you can direct the xscope messages to the program running on the host. Also, you can send some information from the program running on the host to the XMOS device.asid61 wrote: So essentially I use xscope functions normally on the XMOS, then run a program on the computer which will redirect xscope messages to somewhere else?
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Okay, I follewed your advice and got it to make using cygwin! And I made a simple application to connect to the xmos!
However, I need to find the port number of my xmos so I can connect to it. How do I find the port number? And for ip address, can I just use the computer's ip address?
On the xmos, how should I set up xscope? Normally I use the command
xscope_config_io(XSCOPE_IO_BASIC);
but should I use something like
xscope_start(1);
instead?
However, I need to find the port number of my xmos so I can connect to it. How do I find the port number? And for ip address, can I just use the computer's ip address?
On the xmos, how should I set up xscope? Normally I use the command
xscope_config_io(XSCOPE_IO_BASIC);
but should I use something like
xscope_start(1);
instead?
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
You need to run the application using realtime scope:
Example:
For the example, which I have mentioned earlier on host side should run using the following command:
Exampleto configure xscope:
Example:
Code: Select all
xrun --xscope-realtime --xscope-port 127.0.0.1:12346 <bin>.xe
Code: Select all
./packet_analyser -s 127.0.0.1 -p 12346
Code: Select all
void xscope_user_init(void)
{
xscope_register(2,
XSCOPE_CONTINUOUS, "Sample_1", XSCOPE_INT, "n",
XSCOPE_CONTINUOUS, "Sample_2", XSCOPE_INT, "n"
); // xscope_register
xscope_config_io(XSCOPE_IO_BASIC);
}
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Thank you for the example and xrun configuration (seriously, the command line flags are tricky for me).sethu_jangala wrote:You need to run the application using realtime scope:
Example:For the example, which I have mentioned earlier on host side should run using the following command:Code: Select all
xrun --xscope-realtime --xscope-port 127.0.0.1:12346 <bin>.xe
Exampleto configure xscope:Code: Select all
./packet_analyser -s 127.0.0.1 -p 12346
Code: Select all
void xscope_user_init(void) { xscope_register(2, XSCOPE_CONTINUOUS, "Sample_1", XSCOPE_INT, "n", XSCOPE_CONTINUOUS, "Sample_2", XSCOPE_INT, "n" ); // xscope_register xscope_config_io(XSCOPE_IO_BASIC); }
I think I've almost got it working, but I'm getting this error:
ERROR: socket bind.(0)
ERROR: socket listen.(0)
ERROR: socket accept.(0)
Regardless of whether I run it from the command line or from the Composer, this error pops up. Have you seen this happen before?
The realtime server does work though. If I run just the "--xscope-realtime" without "--xscope-port", then it says that a xscope server is created.
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
Can you attach your workspace so that I can try finding out what's causing issue in your case?
Sethu.
Sethu.
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
The forum uploader is glitching up, so I uploaded it to Google Drive here:sethu_jangala wrote:Can you attach your workspace so that I can try finding out what's causing issue in your case?
Sethu.
Inside is my workspace folder.
Inside I have my xmos programs (some other are stored in another folder) and my C programs. The latter is stored in the subdirectory called "Cprograms". "Cprograms" contains the host side applications. Everything is else is xmos programs.
The program on the xmos I'm having touble with is the "Nervewalk_main" program.
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
For testing the application, I just did a small change to the code:
build the code using xmake from the command line and run the binary using the following command:
Run the host application using the following command:
After running both the application you see the host receiving the data that is being sent by the device.
Hope this helps.
Sethu.
Code: Select all
int main() {
xscope_user_init();
unsigned sample=1;
while (1) {
sample++;
xscope_int(0, sample);
}
return 0;
}
Host side, change the hook_data_receive function as shown below:xrun --xscope-realtime --xscope-port 127.0.0.1:12346 Socket_test.xe
Code: Select all
void hook_data_received(int sockfd, int xscope_probe, void *data, int data_len)
{
// Do nothing
int * a= (int *) data;
printf("%d", *(a));
}
Note:First run the host application and then run the binary on the device../dsp_control -s 127.0.0.1 -p 12346
After running both the application you see the host receiving the data that is being sent by the device.
Hope this helps.
Sethu.