"WARNING: .. There could be API incompatibilities" BUILDING AN00122_using_webserver_library

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
aclassifier
Respected Member
Posts: 332
Joined: Wed Apr 25, 2012 8:52 pm

"WARNING: .. There could be API incompatibilities" BUILDING AN00122_using_webserver_library

Postby aclassifier » Thu Dec 14, 2017 7:23 pm

--- Update, inserted here in front of the post ---

Could this be the right bird's eye view of the situation when I want to run a webserver served over the Ethernet cable on an xCORE-200 eXplorerKIT:

eXplorerKIT has RGMII with its PHY. I can find AN00199 "XMOS Gigabit Ethernet application note", but it handles ICMP pings. No webserver.

The lib_webserver uses lib_xtcp (>=4.0.0) and I only find 6.0.x which is too new, since testing it is by Application note AN00122 "Using the XMOS embedded webserver library".

In any case lib_xtcp uses the MII interface (not RGMII) with the PHY since it’s developed for the sliceKIT with boards plugged onto it.

I have got the XMOS WiFi sliceCard running with the supplied webserver in the eXplorerKIT. It’s only using SPI and it works. But it’s not stable enough since the TI CC3000 has been parked. So I have been testing with a board with the Atmel/Microchip ATWINC1500 module, which seems to be updated, on an ARM Arduino Zero variant. It seems extremely stable.

Now, whether I should, on the eXplorerKIT, hope for a webserver with RGMII cabled or the ATWINC1500 WiFi is an open question.

Any suggestions?

Much of this is described in (overview) http://www.teigfam.net/oyvind/home/tech ... os_matters (disclaimer: no ads, money, gifts. Just a hobby, ie just expenses and fun)

--- Update end ---

I try to do

Code: Select all

**** Incremental Build of configuration Default for project AN00122_using_webserver_library ****
with TARGET = XCORE-200-EXPLORER instead of TARGET = SLICEKIT-L16. This doesn't make any difference to the below:

I'll just throw in the whole buildlog here (bottom), but it's probably the WARNING that's the problem. What can I do about it?

Code: Select all

WARNING: Required version of lib_xtcp is >=4.0.0 and actual version has greater major version: 6.0.0. There could be API incompatibilities.
According to AN00122.pdf I'm using AN00122 (2.0.1). I took it from https://www.xmos.com/support/appnotes/AN00122

Here is the full buidlog:

Code: Select all

xmake CONFIG=Default all 
Checking build modules
WARNING: Required version of lib_xtcp is >=4.0.0 and actual version has greater major version: 6.0.0. There could be API incompatibilities.
Using build modules: lib_webserver(2.0.1) lib_xtcp(6.0.0) lib_ethernet(3.3.0) lib_otpinfo(2.0.1) lib_gpio(1.1.0) lib_locks(2.0.3) lib_logging(2.1.0) lib_xassert(3.0.0)
Analyzing web_server.c
/Users/teig/workspace/lib_webserver/src/web_server.c:93:3: warning: implicit declaration of function 'xtcp_listen' is invalid in C99 [-Wimplicit-function-declaration]
  xtcp_listen(c_xtcp, WEB_SERVER_PORT, XTCP_PROTOCOL_TCP);
  ^
/Users/teig/workspace/lib_webserver/src/web_server.c:241:11: warning: implicit declaration of function 'xtcp_abort' is invalid in C99 [-Wimplicit-function-declaration]
          xtcp_abort(c_xtcp, conn);
          ^
/Users/teig/workspace/lib_webserver/src/web_server.c:276:15: warning: implicit declaration of function 'xtcp_init_send' is invalid in C99 [-Wimplicit-function-declaration]
              xtcp_init_send(c_xtcp, conn);
              ^
/Users/teig/workspace/lib_webserver/src/web_server.c:478:10: error: use of undeclared identifier 'XTCP_ALREADY_HANDLED'
    case XTCP_ALREADY_HANDLED:
         ^
/Users/teig/workspace/lib_webserver/src/web_server.c:492:11: warning: implicit declaration of function 'xtcp_set_connection_appstate' is invalid in C99 [-Wimplicit-function-declaration]
          xtcp_set_connection_appstate(c_xtcp, conn, (unsigned) st);
          ^
/Users/teig/workspace/lib_webserver/src/web_server.c:498:19: warning: implicit declaration of function 'xtcp_recv' is invalid in C99 [-Wimplicit-function-declaration]
        int len = xtcp_recv(c_xtcp, inbuf);
                  ^
/Users/teig/workspace/lib_webserver/src/web_server.c:503:12: error: use of undeclared identifier 'XTCP_REQUEST_DATA'; did you mean 'XTCP_RESEND_DATA'?
      case XTCP_REQUEST_DATA:
           ^~~~~~~~~~~~~~~~~
           XTCP_RESEND_DATA
/Users/teig/workspace/lib_xtcp/api/xtcp.h:121:3: note: 'XTCP_RESEND_DATA' declared here
  XTCP_RESEND_DATA,     /**<  This event occurs when the server has failed to
  ^
/Users/teig/workspace/lib_webserver/src/web_server.c:506:11: warning: implicit declaration of function 'xtcp_complete_send' is invalid in C99 [-Wimplicit-function-declaration]
          xtcp_complete_send(c_xtcp);
          ^
/Users/teig/workspace/lib_webserver/src/web_server.c:510:11: warning: implicit declaration of function 'xtcp_close' is invalid in C99 [-Wimplicit-function-declaration]
          xtcp_close(c_xtcp, conn);
          ^
/Users/teig/workspace/lib_webserver/src/web_server.c:518:13: warning: implicit declaration of function 'xtcp_send' is invalid in C99 [-Wimplicit-function-declaration]
            xtcp_send(c_xtcp, st->current_data, st->current_data_len);
            ^
/Users/teig/workspace/lib_webserver/src/web_server.c:532:12: error: duplicate case value 'XTCP_RESEND_DATA'
      case XTCP_RESEND_DATA:
           ^
/Users/teig/workspace/lib_webserver/src/web_server.c:503:12: note: previous case defined here
      case XTCP_REQUEST_DATA:
           ^
/Users/teig/workspace/lib_webserver/src/web_server.c:546:19: error: use of undeclared identifier 'XTCP_ALREADY_HANDLED'
    conn->event = XTCP_ALREADY_HANDLED;
                  ^
8 warnings and 4 errors generated.
xmake[1]: *** [.build/_l_webserver/src/web_server.c.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2
Last edited by aclassifier on Fri Dec 15, 2017 11:04 pm, edited 1 time in total.
User avatar
aclassifier
Respected Member
Posts: 332
Joined: Wed Apr 25, 2012 8:52 pm

Postby aclassifier » Fri Dec 15, 2017 1:28 pm

Compiling AN00122_using_webserver_library:

In webserver.c (older version of xtcp.h seems to a chanend parameterised):

Code: Select all

xtcp_listen(c_xtcp, WEB_SERVER_PORT, XTCP_PROTOCOL_TCP);
This is what the compiler complains about.

There is an older three-param xtcp_listen but it's not used by AN00122_using_webserver_library.
It's in file xtcp_client.h in module_wifi_tiwsl:

Code: Select all

void xtcp_listen(chanend tcp_svr, int port_number, xtcp_protocol_t p) 
xtcp.h: (XTCP (6.0.0) has no chanend at all:

Code: Select all

void listen(int port_number, xtcp_protocol_t protocol);
xtcp_listen -> No such function in there.

Does XMOS have any plans to upgrade AN00122_using_webserver_library?

I'd rather not downgrade lib_xtcp. Also, since I can't find any older version at https://www.xmos.com/support/libraries/lib_xtcp. And Wayback Engine didn't seem to have it either.

Here are the interface changes, plus some constants etc. plus most probably the semantics. I am basically stopped from going on along this path:

Code: Select all

Compile of web_server.c	

As used in web_server.c
-> Defined in xtcp.h

xtcp_listen(c_xtcp, WEB_SERVER_PORT, XTCP_PROTOCOL_TCP);
-> void listen(int port_number, xtcp_protocol_t protocol);

xtcp_abort(c_xtcp, conn);
-> void abort(const xtcp_connection_t &conn);

xtcp_init_send(c_xtcp, conn);
-> Cant' find anything similar

xtcp_set_connection_appstate(c_xtcp, conn, (unsigned) st);
-> Cant' find anything similar

xtcp_complete_send(c_xtcp);
   One of these?
-> void send(const xtcp_connection_t &conn, char data[], unsigned len);
-> void send_packet(pbuf_p p);

xtcp_close(c_xtcp, conn);
-> void close(const xtcp_connection_t &conn)

xtcp_send(c_xtcp, st->current_data, st->current_data_len);
   One of these?
-> xtcp_send is mentioned in a comment to "unsigned int mss;", so everything hasn't been cleaned up
-> void send(const xtcp_connection_t &conn, char data[], unsigned len);
-> void send_packet(pbuf_p p);

Who is online

Users browsing this forum: No registered users and 1 guest