Signal 'ET_ILLEGAL_RESOURCE' received??

Technical questions regarding the XTC tools and programming with XMOS.
muntablues
Active Member
Posts: 34
Joined: Tue Dec 20, 2011 2:45 pm

Signal 'ET_ILLEGAL_RESOURCE' received??

Post by muntablues »

Hi there

The first boards (http://www.xcore.com/forum/viewtopic.php?f=21&t=2355) have arrived and look good.

I tested all voltages and they look good and stable.

I started the first SW test, but there is something wrong!
I use reference design SW package (6.10) but if I start degubbing I get

stdcore[0] core[0] (Suspended: Signal 'ET_ILLEGAL_RESOURCE' received. Description: Resource exception.)
1 main() 0x00014470

That is all I get, I can't see where is something wrong and its really hard to find a error. I didn't change any code and so it is quite strange wor me. I think it should work fine on my custom design...

I anyone could give me a hint it would be really great!

Thanks MB


peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

The first thing I'd do to debug that is to run:

Code: Select all

xgdb <YOUR_BINARY> -ex "attach"
If you've got multiple XTAGs then use:

Code: Select all

xgdb <YOUR_BINARY> -ex "attach --adapter-id <ID>"
Then the following to give you a list of all the active logical cores:

Code: Select all

info threads
Find the one which is in _DoException() and switch to it by doing:

Code: Select all

thread <NUMBER>
Get the status of the thread using:

Code: Select all

info reg
That will show you the Saved Program Counter (spc) which is the Program Counter of the instruction that caused the exception. It also tells you which function that is in. The output will also give you the Exception Data (ed) which in the case of an ILLEGAL_RESOURCE is the resource ID of the resource being accessed by the instruction at spc which caused the exception.

The disassembly of the function in which the exception was and the info reg output would both be helpful in debugging the issue. The disassembly can be obtained by:

Code: Select all

  disass <FUNCTION_NAME>
That's about all I can say without more information.
muntablues
Active Member
Posts: 34
Joined: Tue Dec 20, 2011 2:45 pm

Post by muntablues »

Hi peter

Thanks for your answer!

Here is what i get:

Code: Select all

C:\Users\Holzi>xgdb C:\Users\Holzi\Documents\XMOS\Audio\app_usb_aud_su1\bin\2iox
s\app_usb_aud_su1_2ioxs.xe -ex "attach"
GNU gdb (XGDB) 12.2.0 (build 7741)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.
..
0x00014cd4 in _DoException ()
(gdb) info threads
* 1  stdcore[0] core[0]  0x00014cd4 in _DoException ()
(gdb) thread 1
[Switching to thread 1 (stdcore[0] core[0])]#0  0x00014cd4 in _DoException ()
(gdb) info reg
r0             0x0      0
r1             0x2      2
r2             0x0      0
r3             0x0      0
r4             0x13     19
r5             0xff     255
r6             0x1302   4866
r7             0x0      0
r8             0x1      1
r9             0x0      0
r10            0x1ae70  110192
r11            0x1fef0  130800
cp             0x17328  95016
dp             0x1755c  95580
sp             0x1fef0  130800
lr             0x143f6  82934
pc             0x14cd4  85204
sr             0x10     16
spc            0x14470  83056
ssr            0x0      0
et             0x4      4
ed             0x2      2
sed            0x0      0
kep            0x10080  65664
ksp            0x0      0
(gdb) disass _DoException()

Program received signal ET_ILLEGAL_RESOURCE, Resource exception.
0x00014470 in main ()
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (_DoException) will be aban
doned.
(gdb)
Note: If I reset the device, all these commands does not work. It works only if I start debugging in TIMEcomposer, stop debugging. After that I get upper results. I am not sure if that is correct?!

MB
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

That is a start, but there isn't enough information there. First of all, the address at which the exception occurred is:

Code: Select all

spc            0x14470  83056
So, you need the disassembly of the function that this PC is in. "info threads" has told you that the core is in _DoException(), but that is the exception handler. You can try to get the backtrace to see whether that gives you more information about the call stack at the time of the exception:

Code: Select all

bt
But that isn't always too informative. In order to understand what instruction is causing the exception then you can use the following command-line tool (open the command-prompt and change to your project folder):

Code: Select all

xobjdump -D YOUR_BINARY  > objdump.txt
You can then open the objdump.txt file in an editor and find which function PC 0x14470 is in and what instruction it was executing at the time.

From the Exception Data (ed) value of 0x2 it is a channel operation. Resource Identifiers are 32-bit values of which bits [3:0] are the resource type and [15:8] are the resource number. The bits [31:16] identify the tile on which the resource is located.

Usually when an exception occurs on a channel then it is a protocol violation on that channel. Channels can carry both data tokens and control tokens. If a control token is sent and the other end of the channel expects a data token then an exception (ILLEGAL_RESOURCE) will occur.

So, have a look at the code that is executing at the time of the exception and see whether that helps.
muntablues
Active Member
Posts: 34
Joined: Tue Dec 20, 2011 2:45 pm

Post by muntablues »

Thank you very much!

I have created the dump file and here is the relevant part. For me it is very hard to understand what is going on, but maybe you can find mistake.

As I mentioned in the first post. It is the orig. source code from 6.10 package and my HW is more or less the same as XMOS USB Audio 2.0 DJ Kit!

Code: Select all

<main>:
             0x00014396: 42 77:       entsp (u6)      0x2
.label457    0x00014398: c2 86:       getr (rus)      r0, 0x2
             0x0001439a: 02 74:       bt (ru6)        r0, -0x2 <.label457>
             0x0001439c: 9f 68:       ldc (ru6)       r2, 0x1f
             0x0001439e: c1 68:       ldc (ru6)       r3, 0x1
             0x000143a0: 04 f0 40 68: ldc (lru6)      r1, 0x100
             0x000143a4: 00 f0 06 6c: ldw (lru6)      r0, cp[0x6]
             0x000143a8: 01 10:       add (3r)        r0, r0, r1
.label458    0x000143aa: e0 17:       freer (1r)      res[r0]
             0x000143ac: 01 10:       add (3r)        r0, r0, r1
             0x000143ae: 4e 30:       eq (3r)         r4, r3, r2
             0x000143b0: 3d 90:       add (2rus)      r3, r3, 0x1
             0x000143b2: 05 7d:       bf (ru6)        r4, -0x5 <.label458>
             0x000143b4: 39 f0 c5 62: ldaw (lru6)     r11, dp[0xe45]
             0x000143b8: 14 69:       ldc (ru6)       r4, 0x14
             0x000143ba: fc f3 c0 69: ldc (lru6)      r7, 0xff00
             0x000143be: 00 68:       ldc (ru6)       r0, 0x0
.label460    0x000143c0: 90 32:       eq (3r)         r5, r0, r4
             0x000143c2: 47 71:       bt (ru6)        r5, 0x7 <.label459>
             0x000143c4: c6 86:       getr (rus)      r1, 0x2
             0x000143c6: 9c f9 ec 07: stw (l3r)       r1, r11[r0]
             0x000143ca: 67 42:       or (3r)         r2, r1, r7
             0x000143cc: d9 16:       setd (r2r)      res[r1], r2
             0x000143ce: 01 90:       add (2rus)      r0, r0, 0x1
             0x000143d0: 09 77:       bu (u6)         -0x9 <.label460>
.label459    0x000143d2: 81 77:       extsp (u6)      0x1
             0x000143d4: 00 f0 46 6c: ldw (lru6)      r1, cp[0x6]
             0x000143d8: 0c f0 fa 62: ldaw (lru6)     r11, dp[0x33a]
.label465    0x000143dc: 8c 09:       ldw (2rus)      r0, r11[0x0]
             0x000143de: 3d fa ec 9f: ldaw (l2rus)    r11, r11[0x1]
             0x000143e2: 01 f0 03 78: bf (lru6)       r0, 0x43 <.label461>
             0x000143e6: 40 6a:       ldc (ru6)       r9, 0x0
             0x000143e8: 81 b0:       eq (2rus)       r8, r0, 0x1
             0x000143ea: 02 72:       bt (ru6)        r8, 0x2 <.label462>
             0x000143ec: d1 16:       setd (r2r)      res[r1], r0
             0x000143ee: 02 73:       bu (u6)         0x2 <.label463>
.label462    0x000143f0: 39 f0 85 62: ldaw (lru6)     r10, dp[0xe45]
.label463    0x000143f4: 37 d0:       bl (u10)        0x37 <.label464>
             0x000143f6: ac 09:       ldw (2rus)      r2, r11[0x0]
             0x000143f8: 80 54:       stw (ru6)       r2, sp[0x0]
             0x000143fa: 3d fa ec 9f: ldaw (l2rus)    r11, r11[0x1]
             0x000143fe: 92 7c:       bf (ru6)        r2, -0x12 <.label465>
             0x00014400: 3d 86:       ld16s (3r)      r3, r11[r9]
             0x00014402: 3e 92:       add (2rus)      r11, r11, 0x2
.label475    0x00014404: c9 7c:       bf (ru6)        r3, -0x9 <.label463>
             0x00014406: 01 72:       bt (ru6)        r8, 0x1 <.label466>
             0x00014408: c5 ae:       out (r2r)       res[r1], r1
.label466    0x0001440a: 4d 86:       ld16s (3r)      r4, r11[r9]
             0x0001440c: 3e 92:       add (2rus)      r11, r11, 0x2
             0x0001440e: 74 a7:       mkmsk (rus)     r5, 0x8
             0x00014410: a0 ad:       shr (2rus)      r6, r4, 0x8
             0x00014412: 66 3b:       and (3r)        r6, r5, r6
             0x00014414: 76 33:       eq (3r)         r7, r5, r6
             0x00014416: c7 79:       bf (ru6)        r7, 0x7 <.label467>
             0x00014418: 41 3b:       and (3r)        r4, r4, r5
             0x0001441a: 24 d0:       bl (u10)        0x24 <.label464>
             0x0001441c: ec 09:       ldw (2rus)      r6, r11[0x0]
             0x0001441e: 7c 94:       add (2rus)      r11, r11, 0x4
             0x00014420: 15 72:       bt (ru6)        r8, 0x15 <.label468>
             0x00014422: 09 af:       out (r2r)       res[r1], r6
             0x00014424: 0e 73:       bu (u6)         0xe <.label469>
.label467    0x00014426: 01 72:       bt (ru6)        r8, 0x1 <.label470>
             0x00014428: 09 af:       out (r2r)       res[r1], r6
.label470    0x0001442a: 61 3b:       and (3r)        r6, r4, r5
             0x0001442c: 79 33:       eq (3r)         r7, r6, r5
             0x0001442e: 80 ad:       shr (2rus)      r4, r4, 0x8
             0x00014430: c5 79:       bf (ru6)        r7, 0x5 <.label471>
             0x00014432: 18 d0:       bl (u10)        0x18 <.label464>
             0x00014434: 7c 94:       add (2rus)      r11, r11, 0x4
             0x00014436: 14 72:       bt (ru6)        r8, 0x14 <.label472>
             0x00014438: 80 69:       ldc (ru6)       r6, 0x0
             0x0001443a: 03 73:       bu (u6)         0x3 <.label469>
.label471    0x0001443c: 80 5c:       ldw (ru6)       r2, sp[0x0]
             0x0001443e: aa 4a:       ldw (3r)        r6, r2[r6]
             0x00014440: 05 72:       bt (ru6)        r8, 0x5 <.label468>
.label469    0x00014442: 09 af:       out (r2r)       res[r1], r6
             0x00014444: d5 4e:       outct (rus)     res[r1], 0x1
             0x00014446: d7 ce:       chkct (rus)     res[r1], 0x3
             0x00014448: d5 ce:       chkct (rus)     res[r1], 0x1
             0x0001444a: 0a 73:       bu (u6)         0xa <.label472>
.label468    0x0001444c: 30 a7:       mkmsk (rus)     r0, 0x8
             0x0001444e: 40 32:       eq (3r)         r0, r0, r4
             0x00014450: 04 78:       bf (ru6)        r0, 0x4 <.label473>
             0x00014452: 08 d0:       bl (u10)        0x8 <.label464>
             0x00014454: 8c 09:       ldw (2rus)      r0, r11[0x0]
             0x00014456: 7c 94:       add (2rus)      r11, r11, 0x4
             0x00014458: 01 73:       bu (u6)         0x1 <.label474>
.label473    0x0001445a: c8 4b:       ldw (3r)        r0, r10[r4]
.label474    0x0001445c: 81 79:       bf (ru6)        r6, 0x1 <.label472>
             0x0001445e: 18 17:       setd (r2r)      res[r0], r6
.label472    0x00014460: 3d 98:       sub (2rus)      r3, r3, 0x1
             0x00014462: 30 77:       bu (u6)         -0x30 <.label475>
.label464    0x00014464: 83 68:       ldc (ru6)       r2, 0x3
             0x00014466: 3f 92:       add (2rus)      r11, r11, 0x3
             0x00014468: 4e 2f:       andnot (2r)     r11, r2
             0x0001446a: c0 77:       retsp (u6)      0x0
.label461    0x0001446c: c1 66:       ldaw (ru6)      r11, sp[0x1]
             0x0001446e: fb 2f:       set (1r)        sp, r11
             0x00014470: e1 17:       freer (1r)      res[r1]
             0x00014472: 39 f0 c5 62: ldaw (lru6)     r11, dp[0xe45]
             0x00014476: c1 69:       ldc (ru6)       r7, 0x1
             0x00014478: fc f3 00 6a: ldc (lru6)      r8, 0xff00
             0x0001447c: 1c d0:       bl (u10)        0x1c <buildRegArg>
             0x0001447e: 0c 90:       add (2rus)      r0, r3, 0x0
             0x00014480: 1a d0:       bl (u10)        0x1a <buildRegArg>
             0x00014482: 1c 90:       add (2rus)      r1, r3, 0x0
             0x00014484: 18 d0:       bl (u10)        0x18 <buildRegArg>
             0x00014486: 2c 90:       add (2rus)      r2, r3, 0x0
             0x00014488: 16 d0:       bl (u10)        0x16 <buildRegArg>
             0x0001448a: 90 77:       extsp (u6)      0x10
             0x0001448c: 81 66:       ldaw (ru6)      r10, sp[0x1]
             0x0001448e: 10 69:       ldc (ru6)       r4, 0x10
             0x00014490: 40 69:       ldc (ru6)       r5, 0x0
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am
Contact:

Post by segher »

(FWIW, "disas main" or "disas 0x14470" should work within GDB).

Curious. The code is trying to free channel end #0, which is
not already free it seems; which then means there is pending
data on it, or some other thread is using it?

Something went really badly wrong :-)
muntablues
Active Member
Posts: 34
Joined: Tue Dec 20, 2011 2:45 pm

Post by muntablues »

I tried disass command (main shows only 250 rows) so I use start end now. Maybe someone can find the problem...

Code: Select all

C:\Users\Holzi>xgdb C:\Users\Holzi\Documents\XMOS\Audio\app_usb_aud_skc_su1\bin\
2ioxs\app_usb_aud_skc_su1_2ioxs.xe -ex "attach"
GNU gdb (XGDB) 12.2.0 (build 7741)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.
..
0x00014492 in _DoException ()
(gdb) info threads
* 1  stdcore[0] core[0]  0x00014492 in _DoException ()
(gdb) disass 0x00014292 0x00014492
Dump of assembler code from 0x14292 to 0x14492:
0x00014292 <XUD_Manager+1542>:  add (2rus)      r0, r9, 0x0
0x00014294 <XUD_Manager+1544>:  add (2rus)      r1, r6, 0x0
0x00014296 <XUD_Manager+1546>:  add (2rus)      r2, r7, 0x0
0x00014298 <XUD_Manager+1548>:  add (2rus)      r3, r5, 0x0
0x0001429a <XUD_Manager+1550>:  bl (u10)        0xac
0x0001429c <XUD_Manager+1552>:  add (2rus)      r3, r10, 0x0
0x0001429e <XUD_Manager+1554>:  add (2rus)      r2, r7, 0x0
0x000142a0 <XUD_Manager+1556>:  add (2rus)      r1, r4, 0x0
0x000142a2 <XUD_Manager+1558>:  add (2rus)      r0, r8, 0x0
0x000142a4 <XUD_Manager+1560>:  bl (u10)        0xa7
0x000142a6 <XUD_Manager+1562>:  add (2rus)      r3, r5, 0x0
0x000142a8 <XUD_Manager+1564>:  add (2rus)      r1, r6, 0x0
0x000142aa <XUD_Manager+1566>:  add (2rus)      r0, r9, 0x0
0x000142ac <XUD_Manager+1568>:  ldc (ru6)       r7, 0x2
0x000142ae <XUD_Manager+1570>:  add (2rus)      r2, r7, 0x0
0x000142b0 <XUD_Manager+1572>:  bl (u10)        0xa1
0x000142b2 <XUD_Manager+1574>:  add (2rus)      r0, r8, 0x0
0x000142b4 <XUD_Manager+1576>:  add (2rus)      r1, r4, 0x0
0x000142b6 <XUD_Manager+1578>:  add (2rus)      r2, r7, 0x0
0x000142b8 <XUD_Manager+1580>:  add (2rus)      r3, r10, 0x0
0x000142ba <XUD_Manager+1582>:  bl (u10)        0x9c
0x000142bc <XUD_Manager+1584>:  ldw (ru6)       r10, sp[0x1a]
0x000142be <XUD_Manager+1586>:  ldw (ru6)       r9, sp[0x1b]
0x000142c0 <XUD_Manager+1588>:  ldw (ru6)       r8, sp[0x1c]
0x000142c2 <XUD_Manager+1590>:  ldw (ru6)       r7, sp[0x1d]
0x000142c4 <XUD_Manager+1592>:  ldw (ru6)       r6, sp[0x1e]
0x000142c6 <XUD_Manager+1594>:  ldw (ru6)       r5, sp[0x1f]
0x000142c8 <XUD_Manager+1596>:  ldw (ru6)       r4, sp[0x20]
0x000142ca <XUD_Manager+1598>:  ldc (ru6)       r0, 0x0
0x000142cc <XUD_Manager+1600>:  retsp (u6)      0x21
0x000142ce:     add (2rus)      r0, r0, 0x0
0x000142d0 <tx_readyout.ctor+0>:        ldc (lru6)      r1, 0x6
0x000142d4 <tx_readyout.ctor+4>:        ldw (lru6)      r0, cp[0x3d]
0x000142d8 <tx_readyout.ctor+8>:        setc (ru6)      res[r0], 0x8 *
0x000142da <tx_readyout.ctor+10>:       setclk (lr2r)   res[r0], r1
0x000142de <tx_readyout.ctor+14>:       retsp (u6)      0x0
0x000142e0 <tx_readyout.dtor+0>:        ldw (lru6)      r0, cp[0x3d]
0x000142e4 <tx_readyout.dtor+4>:        setc (ru6)      res[r0], 0x0 *
0x000142e6 <tx_readyout.dtor+6>:        retsp (u6)      0x0
0x000142e8 <tx_readyin.ctor+0>: ldc (lru6)      r1, 0x6
0x000142ec <tx_readyin.ctor+4>: ldw (lru6)      r0, cp[0x3c]
0x000142f0 <tx_readyin.ctor+8>: setc (ru6)      res[r0], 0x8 *
0x000142f2 <tx_readyin.ctor+10>:        setclk (lr2r)   res[r0], r1
0x000142f6 <tx_readyin.ctor+14>:        retsp (u6)      0x0
0x000142f8 <tx_readyin.dtor+0>: ldw (lru6)      r0, cp[0x3c]
0x000142fc <tx_readyin.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x000142fe <tx_readyin.dtor+6>: retsp (u6)      0x0
0x00014300 <p_usb_txd.ctor+0>:  ldc (ru6)       r1, 0x20
0x00014302 <p_usb_txd.ctor+2>:  ldw (lru6)      r0, cp[0x37]
0x00014306 <p_usb_txd.ctor+6>:  setc (ru6)      res[r0], 0x8 *
0x00014308 <p_usb_txd.ctor+8>:  setc (lru6)     res[r0], 0x200f *
0x0001430c <p_usb_txd.ctor+12>: settw (lr2r)    res[r0], r1
0x00014310 <p_usb_txd.ctor+16>: ldc (lru6)      r1, 0x6
0x00014314 <p_usb_txd.ctor+20>: setclk (lr2r)   res[r0], r1
0x00014318 <p_usb_txd.ctor+24>: retsp (u6)      0x0
0x0001431a:     add (2rus)      r0, r0, 0x0
0x0001431c <p_usb_txd.dtor+0>:  ldw (lru6)      r0, cp[0x37]
0x00014320 <p_usb_txd.dtor+4>:  setc (ru6)      res[r0], 0x0 *
0x00014322 <p_usb_txd.dtor+6>:  retsp (u6)      0x0
0x00014324 <p_usb_rxd.ctor+0>:  ldc (ru6)       r1, 0x20
0x00014326 <p_usb_rxd.ctor+2>:  ldw (lru6)      r0, cp[0x38]
0x0001432a <p_usb_rxd.ctor+6>:  setc (ru6)      res[r0], 0x8 *
0x0001432c <p_usb_rxd.ctor+8>:  setc (lru6)     res[r0], 0x200f *
0x00014330 <p_usb_rxd.ctor+12>: settw (lr2r)    res[r0], r1
0x00014334 <p_usb_rxd.ctor+16>: ldc (lru6)      r1, 0x6
0x00014338 <p_usb_rxd.ctor+20>: setclk (lr2r)   res[r0], r1
0x0001433c <p_usb_rxd.ctor+24>: retsp (u6)      0x0
0x0001433e:     add (2rus)      r0, r0, 0x0
0x00014340 <p_usb_rxd.dtor+0>:  ldw (lru6)      r0, cp[0x38]
0x00014344 <p_usb_rxd.dtor+4>:  setc (ru6)      res[r0], 0x0 *
0x00014346 <p_usb_rxd.dtor+6>:  retsp (u6)      0x0
0x00014348 <rx_rdy.ctor+0>:     ldc (lru6)      r1, 0x6
0x0001434c <rx_rdy.ctor+4>:     ldw (lru6)      r0, cp[0x3e]
0x00014350 <rx_rdy.ctor+8>:     setc (ru6)      res[r0], 0x8 *
0x00014352 <rx_rdy.ctor+10>:    setclk (lr2r)   res[r0], r1
0x00014356 <rx_rdy.ctor+14>:    retsp (u6)      0x0
0x00014358 <rx_rdy.dtor+0>:     ldw (lru6)      r0, cp[0x3e]
0x0001435c <rx_rdy.dtor+4>:     setc (ru6)      res[r0], 0x0 *
0x0001435e <rx_rdy.dtor+6>:     retsp (u6)      0x0
0x00014360 <flag0_port.ctor+0>: ldc (lru6)      r1, 0x6
0x00014364 <flag0_port.ctor+4>: ldw (lru6)      r0, cp[0x39]
0x00014368 <flag0_port.ctor+8>: setc (ru6)      res[r0], 0x8 *
0x0001436a <flag0_port.ctor+10>:        setclk (lr2r)   res[r0], r1
0x0001436e <flag0_port.ctor+14>:        retsp (u6)      0x0
0x00014370 <flag0_port.dtor+0>: ldw (lru6)      r0, cp[0x39]
0x00014374 <flag0_port.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x00014376 <flag0_port.dtor+6>: retsp (u6)      0x0
0x00014378 <flag1_port.ctor+0>: ldc (lru6)      r1, 0x6
0x0001437c <flag1_port.ctor+4>: ldw (lru6)      r0, cp[0x3a]
0x00014380 <flag1_port.ctor+8>: setc (ru6)      res[r0], 0x8 *
0x00014382 <flag1_port.ctor+10>:        setclk (lr2r)   res[r0], r1
0x00014386 <flag1_port.ctor+14>:        retsp (u6)      0x0
0x00014388 <flag1_port.dtor+0>: ldw (lru6)      r0, cp[0x3a]
0x0001438c <flag1_port.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x0001438e <flag1_port.dtor+6>: retsp (u6)      0x0
0x00014390 <flag2_port.ctor+0>: ldc (lru6)      r1, 0x6
0x00014394 <flag2_port.ctor+4>: ldw (lru6)      r0, cp[0x3b]
0x00014398 <flag2_port.ctor+8>: setc (ru6)      res[r0], 0x8 *
0x0001439a <flag2_port.ctor+10>:        setclk (lr2r)   res[r0], r1
0x0001439e <flag2_port.ctor+14>:        retsp (u6)      0x0
0x000143a0 <flag2_port.dtor+0>: ldw (lru6)      r0, cp[0x3b]
0x000143a4 <flag2_port.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x000143a6 <flag2_port.dtor+6>: retsp (u6)      0x0
0x000143a8 <p_usb_clk.ctor+0>:  ldc (lru6)      r1, 0x6
0x000143ac <p_usb_clk.ctor+4>:  ldw (lru6)      r0, cp[0x36]
0x000143b0 <p_usb_clk.ctor+8>:  setc (ru6)      res[r0], 0x8 *
0x000143b2 <p_usb_clk.ctor+10>: setclk (lr2r)   res[r0], r1
0x000143b6 <p_usb_clk.ctor+14>: retsp (u6)      0x0
0x000143b8 <p_usb_clk.dtor+0>:  ldw (lru6)      r0, cp[0x36]
0x000143bc <p_usb_clk.dtor+4>:  setc (ru6)      res[r0], 0x0 *
0x000143be <p_usb_clk.dtor+6>:  retsp (u6)      0x0
0x000143c0 <tx_usb_clk.ctor+0>: ldc (lru6)      r0, 0x506
0x000143c4 <tx_usb_clk.ctor+4>: setc (ru6)      res[r0], 0x8 *
0x000143c6 <tx_usb_clk.ctor+6>: retsp (u6)      0x0
0x000143c8 <tx_usb_clk.dtor+0>: ldc (lru6)      r0, 0x506
0x000143cc <tx_usb_clk.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x000143ce <tx_usb_clk.dtor+6>: retsp (u6)      0x0
0x000143d0 <rx_usb_clk.ctor+0>: ldc (lru6)      r0, 0x406
0x000143d4 <rx_usb_clk.ctor+4>: setc (ru6)      res[r0], 0x8 *
0x000143d6 <rx_usb_clk.ctor+6>: retsp (u6)      0x0
0x000143d8 <rx_usb_clk.dtor+0>: ldc (lru6)      r0, 0x406
0x000143dc <rx_usb_clk.dtor+4>: setc (ru6)      res[r0], 0x0 *
0x000143de <rx_usb_clk.dtor+6>: retsp (u6)      0x0
0x000143e0 <XUD_UIFM_PwrSigFlags+0>:    entsp (u6)      0x1
0x000143e2 <XUD_UIFM_PwrSigFlags+2>:    ldc (ru6)       r2, 0x24
0x000143e4 <XUD_UIFM_PwrSigFlags+4>:    mkmsk (rus)     r1, 0x1
0x000143e6 <XUD_UIFM_PwrSigFlags+6>:    ldw (lru6)      r3, cp[0x3f]
0x000143ea <XUD_UIFM_PwrSigFlags+10>:   add (2rus)      r0, r1, 0x0
0x000143ec <XUD_UIFM_PwrSigFlags+12>:   bl (lu10)       0x1130
0x000143f0 <XUD_UIFM_PwrSigFlags+16>:   retsp (u6)      0x1
0x000143f2:     add (2rus)      r0, r0, 0x0
0x000143f4 <drain+0>:   mkmsk (rus)     r11, 0x1
0x000143f6 <drain+2>:   entsp (u6)      0x2
0x000143f8 <drain+4>:   lss (3r)        r11, r1, r11
0x000143fa <drain+6>:   stw (ru6)       r4, sp[0x1]
0x000143fc <drain+8>:   stw (ru6)       r5, sp[0x0]
0x000143fe <drain+10>:  bt (ru6)        r11, 0x1f
0x00014400 <drain+12>:  ldc (ru6)       r11, 0x0
0x00014402 <drain+14>:  bt (ru6)        r2, 0xd
0x00014404 <drain+16>:  bu (u6)         0x3
0x00014406 <drain+18>:  add (2rus)      r11, r11, 0x1
0x00014408 <drain+20>:  eq (3r)         r2, r11, r1
0x0001440a <drain+22>:  bt (ru6)        r2, 0x19
0x0001440c <drain+24>:  ldw (3r)        r2, r3[r11]
0x0001440e <drain+26>:  eq (2rus)       r2, r2, 0x4
0x00014410 <drain+28>:  bt (ru6)        r2, -0x6
0x00014412 <drain+30>:  ldw (3r)        r2, r0[r11]
0x00014414 <drain+32>:  outct (rus)     res[r2], 0x1 *
0x00014416 <drain+34>:  bu (u6)         -0x9
0x00014418 <drain+36>:  ldw (3r)        r4, r0[r11]
0x0001441a <drain+38>:  chkct (rus)     res[r4], 0x1 *
0x0001441c <drain+40>:  bu (u6)         0xd
0x0001441e <drain+42>:  ldw (3r)        r4, r3[r11]
0x00014420 <drain+44>:  eq (2rus)       r4, r4, 0x4
0x00014422 <drain+46>:  bt (ru6)        r4, 0xa
0x00014424 <drain+48>:  eq (2rus)       r4, r2, 0x2
0x00014426 <drain+50>:  bt (ru6)        r4, -0x8
0x00014428 <drain+52>:  eq (2rus)       r4, r2, 0x1
0x0001442a <drain+54>:  bf (ru6)        r4, 0x6
0x0001442c <drain+56>:  ldw (3r)        r4, r0[r11]
0x0001442e <drain+58>:  testct (2r)     r5, res[r4] *
0x00014430 <drain+60>:  bt (ru6)        r5, 0x3
0x00014432 <drain+62>:  int (2r)        r5, res[r4] *
0x00014434 <drain+64>:  testct (2r)     r5, res[r4] *
0x00014436 <drain+66>:  bf (ru6)        r5, -0x3
0x00014438 <drain+68>:  add (2rus)      r11, r11, 0x1
0x0001443a <drain+70>:  lss (3r)        r4, r11, r1
0x0001443c <drain+72>:  bt (ru6)        r4, -0x10
0x0001443e <drain+74>:  ldw (ru6)       r5, sp[0x0]
0x00014440 <drain+76>:  ldw (ru6)       r4, sp[0x1]
0x00014442 <drain+78>:  retsp (u6)      0x2
0x00014444 <ERR_BadCrc+0>:      entsp (u6)      0x2
0x00014446 <ERR_BadCrc+2>:      stw (ru6)       r4, sp[0x1]
0x00014448 <ERR_BadCrc+4>:      add (2rus)      r4, r1, 0x0
0x0001444a <ERR_BadCrc+6>:      bl (lu10)       0x4d6
0x0001444e <ERR_BadCrc+10>:     mkmsk (rus)     r0, 0x10
0x00014450 <ERR_BadCrc+12>:     bl (lu10)       0x4d7
0x00014454 <ERR_BadCrc+16>:     add (2rus)      r0, r4, 0x0
0x00014456 <ERR_BadCrc+18>:     bl (lu10)       0x4d0
0x0001445a <ERR_BadCrc+22>:     bu (u6)         -0x1
0x0001445c <ERR_OutDataTimeout+0>:      retsp (u6)      0x0
0x0001445e:     add (2rus)      r0, r0, 0x0
0x00014460 <ERR_EndIn4+0>:      retsp (u6)      0x0
0x00014462:     add (2rus)      r0, r0, 0x0
0x00014464 <ERR_EndIn5+0>:      retsp (u6)      0x0
0x00014466:     stw (2rus)      r0, r0[0x0]
0x00014468 <XUD_SetDevAddr+0>:  entsp (u6)      0x4
0x0001446a <XUD_SetDevAddr+2>:  add (2rus)      r3, r0, 0x0
0x0001446c <XUD_SetDevAddr+4>:  stw (ru6)       r4, sp[0x3]
0x0001446e <XUD_SetDevAddr+6>:  ldc (ru6)       r4, 0x8
0x00014470 <XUD_SetDevAddr+8>:  stw (ru6)       r5, sp[0x2]
0x00014472 <XUD_SetDevAddr+10>: mkmsk (rus)     r5, 0x1
0x00014474 <XUD_SetDevAddr+12>: add (2rus)      r0, r5, 0x0
0x00014476 <XUD_SetDevAddr+14>: add (2rus)      r1, r5, 0x0
0x00014478 <XUD_SetDevAddr+16>: add (2rus)      r2, r4, 0x0
0x0001447a <XUD_SetDevAddr+18>: bl (lu10)       0x10e9
0x0001447e <XUD_SetDevAddr+22>: add (2rus)      r0, r5, 0x0
0x00014480 <XUD_SetDevAddr+24>: ldaw (ru6)      r3, sp[0x1]
0x00014482 <XUD_SetDevAddr+26>: add (2rus)      r2, r4, 0x0
0x00014484 <XUD_SetDevAddr+28>: add (2rus)      r1, r5, 0x0
0x00014486 <XUD_SetDevAddr+30>: bl (lu10)       0x10b7
0x0001448a <XUD_SetDevAddr+34>: ldw (ru6)       r5, sp[0x2]
0x0001448c <XUD_SetDevAddr+36>: ldw (ru6)       r4, sp[0x3]
0x0001448e <XUD_SetDevAddr+38>: retsp (u6)      0x4
0x00014490 <_DoException+0>:    clre (0r)
End of assembler dump.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

So it is trapping in the main when freeing a channel:

Code: Select all

             0x00014470: e1 17:       freer (1r)      res[r1]
This is usually caused by boot mode selection issues. Can you confirm that when you reset the board, and then run:

Code: Select all

xgdb -ex "connect" -ex "info threads"
You get the PCs at the right location. Something like this:

Code: Select all

0xffffc070 in ?? ()
  2  tile[1] core[0]  0xffffc070 in ?? ()
* 1  tile[0] core[0]  0xffffc070 in ?? ()
muntablues
Active Member
Posts: 34
Joined: Tue Dec 20, 2011 2:45 pm

Post by muntablues »

this is what I get:

Code: Select all

C:\Users\Holzi>xgdb -ex "connect" -ex "info threads"
GNU gdb (XGDB) 12.2.0 (build 7741)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.

0xffffc070 in ?? ()
* 1  tile[0] core[0]  0xffffc070 in ?? ()
(gdb)
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Does your binary still run on the DJ Kit (XP-SKC-SU1)? If not, then could you send the binary and I can try to debug it on my SU1.
Post Reply