Strange Problem with sc_ethernet two port

XCore Project reviews, ideas, videos and proposals.
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Strange Problem with sc_ethernet two port

Post by Interactive_Matter »

Hi,

this is perhaps something more for the sc_ethernet maintainers from XMOS. Nevertheless since I do not know if is an error in the software or an error in my programming I post it here:

I get really strange exceptions in my led tile application:

In ethernet_rx_server.xc:serviceLinkCmd():59 I get an ET_ILLEGAL_RESOURCE exception. The line says:

Code: Select all

  is_cmd = inuchar(link);
tracing through the stack trace I see that link is assigned from the ethernet_rx_server.xc:ethernet_rx_server():306 as

Code: Select all

       case (int i=0;i<num_link;i++) serviceLinkCmd(link[i], i, cmd):
which traces up (or down) to ethernet_server_xc:ethernet_server_two_port():90 as

Code: Select all

    ethernet_rx_server(rx, num_rx);
which traces up to my main as

Code: Select all

        ethernet_server_two_port(mii_0, mii_1, mac_address, rx, 2, tx, 2, smi_0, smi_1, null);
where rx is translated into the link variable and defined as a nice array of two channels:

Code: Select all

  chan rx[2], tx[2];
Even in the debugger in serviceLinkCmd() link is something (it is '132098' - which seems to be some kind of channel address).

Nevertheless my XMOS is convinced that I am accessing an illegal resource. Unfortunately I did not find what inuchar() does or is.

So from logical deduction (don't know if it applicable here) I can only assume that either the variable link is not good (but it is one of my rx channels) or there is something wrong with inuchar - which means it is simply not there. But it compiles & links fine. So I assume it must be there...

Anybody any idea what I am doing wrong?

Thanks

Marcus


User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Post by Interactive_Matter »

Ok,

mystery of inuchar is solved - it reads from the channel, I found this post explaining it.
So obviously the channel is not there/not ready, will investigate it further.
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Post by Interactive_Matter »

Trying to answer my own questions (no, just narrowing it down):

It looks like i got this error:

Code: Select all

case (int i = 0; i < NB_CHAN; i++) c[i] :> data:
            break;
        }
leads to
Program received signal ET_ILLEGAL_RESOURCE, Resource not valid.
0x00010160 in sender1 (c=1026) at chanarray.xc:29
29 c <: 0x1;
and this looks exactly like the code ethernet_rs_server.xc:ethernet_rx-server():306:

Code: Select all

       case (int i=0;i<num_link;i++) serviceLinkCmd(link[i], i, cmd):
Is it possible that it is that bug and this bug is still present?
If the answer is yes I assume that we have to restructure the sc_ethernet to circumvent this bug (seems hard) or fix the bug (seems harder).

Any opinions?