AVB5.2.1+xtcp3.1.2-> compile error

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
theeddielam
Junior Member
Posts: 4
Joined: Sat Oct 30, 2010 2:55 pm

AVB5.2.1+xtcp3.1.2-> compile error

Post by theeddielam »

I would like to use tcp/ip together with AVB.
Then, I tried to add xtcp module into AVB5.2.1.
But compile error occurred.
Please kindly suggest how to solve it.

Eddie
1.png
You do not have the required permissions to view the files attached to this post.


User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

Hi Eddie,

Make sure you define in your xtcp_conf.h

Code: Select all

#define XTCP_SEPARATE_MAC 1
and use xtcp_server() from module_xtcp/src/standalone_xtcp_server.h
theeddielam
Junior Member
Posts: 4
Joined: Sat Oct 30, 2010 2:55 pm

Post by theeddielam »

Hi Andy,

1. I found the xtcp_conf_derived.h in the module_xtcp. Is it correct?
2. We would like to add the xtcp module into the avb demo, is it sufficient?

Thanks.
Regards,
Eddie
螢幕快照 2013-12-02 下午4.07.50.png
13-11-26 AVB+UDP.png
You do not have the required permissions to view the files attached to this post.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

Hi Eddie,

You need to create xtcp_conf.h in your app_*/src/ directory.
User avatar
williamc1014
Junior Member
Posts: 4
Joined: Thu Apr 03, 2014 10:54 am

Post by williamc1014 »

Hi,

Here is the steps how I work on this, please advice if everything I have done is correct or not.

(1) I add a header file named xtcp_conf.h in my application source and two definitions are added as following.
#define XTCP_SEPARATE_MAC 1
//to fix the redefined mac_custom_filter in module_avb and module_tcp
#define ETHERNET_USE_XTCP_FILTER 0

(2) Import module_xtcp.
(3) Add following in main.xc
#include "xtcp.h"
(4) Add and modify the code as following in main.xc
Screen Shot 2014-06-10 at 5.32.02 PM.png
Now it complies success but I still doubt it works or not; my question is;
(1) should I add the filter case in mac_custom_filter for tcp defined in module_avb?
(2) how to use xtcp_server? am I using it right?
(3) is that a correct way to handle the tcp event?

Thanks.

William Chuang
You do not have the required permissions to view the files attached to this post.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

williamc1014 wrote: (1) should I add the filter case in mac_custom_filter for tcp defined in module_avb?
Yes, see here: https://github.com/xcore/sw_avb/blob/5d ... .h#L42-L44
williamc1014 wrote: (2) how to use xtcp_server? am I using it right?
Yes, looks OK.
williamc1014 wrote: (3) is that a correct way to handle the tcp event?
No, the client must be in a separate logical core to the XTCP server. See app_udp_demo here for an example: https://github.com/xcore/sc_xtcp/blob/m ... rc/main.xc
theeddielam
Junior Member
Posts: 4
Joined: Sat Oct 30, 2010 2:55 pm

Post by theeddielam »

Dear all,

I tried to put the TCP/IP 3.1.2 into the AVB5.2.1 with TimeComposer12.2 on AVB-LC.
Compile is OK, but I got a run-time error.

Few questions:
1. xtcp_server should be on Ethernet_default_tile(tile[1]) or can be on tile[0] ?
2. If I put xtcp_server on tile[0], run time error ET_ECALL, Switching to tile[1] Core 5 ..., how to fix it?
3. If I put xtcp_server on tile[1], the Program is too large. How to reduce the size?
4. Can I reduce the program size by disabling the 1722.1 protocols?

Regards,
Eddie
You do not have the required permissions to view the files attached to this post.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

I have followed the application note for adding TCP to AVB:
https://www.xmos.com/support/appnotes/AN01001

I found that despite the fact that I was using the same versions as in the application note I had to change a few things to get it to compile:
  1. In the Makefile I added module_xtcp instead of module_webserver
  2. In the app_avb_lc_demo/src/main.xc I had to copy in the xtcp_config_t ipconfig = ... in addition to the xhttpd(c_xtcp[0]) from the src/tcp_webserver_simple/main.xc. I guess you can use null instead as you have done.
  3. In the app_avb_lc_demo/src/main.xc I had to include xtcp.h and xhttpd.h
  4. The MAX_ETHERNET_CLIENTS define had to be changed in avb_conf.h rather than defined elsewhere.
With those changes I was able to get a program that booted and served up a web page.

In answer to your questions:

1. The xtcp_server can be on either tile. It communicates with the ethernet layer over channels.

2. In terms of debugging the ET_ECALL, it is a bit difficult to debug remotely, but what would help is after the crash has happened then you can on the command line do:

Code: Select all

xgdb bin/app_avb_lc_demo.xc
attach
info threads
bt
info reg
disass
That will give a lot more information about where the crash is happening (the program counter, the instruction at that PC, the register contents). More recent tools releases have made significant improvements in the reporting of errors, so you could try using the version 14 tools. I rebuilt my application with tools 14 and everything worked and the code size reduced:

Code: Select all

Tools 13:
Constraint check for "tile[0]" (node "0", tile 0):
  Cores available:            8,   used:          6 .  OKAY
  Timers available:          10,   used:          7 .  OKAY
  Chanends available:        32,   used:         20 .  OKAY
  Memory available:       65536,   used:      52204 .  OKAY
    (Stack: 6172, Code: 31424, Data: 14608)
Constraints checks PASSED.
Constraint check for "tile[1]" (node "1", tile 0):
  Cores available:            8,   used:          8 .  OKAY
  Timers available:          10,   used:          9 .  OKAY
  Chanends available:        32,   used:         28 .  OKAY
  Memory available:       65536,   used:      64996 .  OKAY
    (Stack: 6304, Code: 41672, Data: 17020)

Code: Select all

Tools 14:
Constraint check for tile[0]:
  Cores available:            8,   used:          6 .  OKAY
  Timers available:          10,   used:          7 .  OKAY
  Chanends available:        32,   used:         20 .  OKAY
  Memory available:       65536,   used:      49356 .  OKAY
    (Stack: 5064, Code: 30378, Data: 13914)
Constraints checks PASSED.
Constraint check for tile[1]:
  Cores available:            8,   used:          8 .  OKAY
  Timers available:          10,   used:          9 .  OKAY
  Chanends available:        32,   used:         28 .  OKAY
  Memory available:       65536,   used:      63352 .  OKAY
    (Stack: 5688, Code: 40804, Data: 16860)
3. Tools 14 might help (see above).

4. If you are happy that you do not require the 1722.1 protocols then you should be able to save code by disabling them. However, it doesn't look like that is an easy fix. I have tried quickly disabling them, but get compile errors that would take more investigation to get to the bottom of.