Simple Xscope project example for XK-1A?

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
Post Reply
maxtorque
Junior Member
Posts: 4
Joined: Mon Mar 18, 2013 5:51 pm

Simple Xscope project example for XK-1A?

Post by maxtorque »

Hi all, I'm a newbie round here so go easy on me ;-)

I've just dug a XK-1A/XTAG2 out of a drawer and am having a play around with it. So far so, good, but i'm having a silly issue with getting Xscope to work! So, to cut a long story short, is there a published XDE project anywhere that just sends somehthing simple up to the environment? Something basic like a counter for example.

I've attempted to follow the multitudenous instructions in the documentation area, but tbh, for a newby like me, it's all a bit confusing. So i have several questions:

1) I have "imported" XK-1A.n from the library repository, and updated the links section with:

Code: Select all

<Links>
<Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
  <LinkEndpoint NodeId="0" Link="X0LD"/>
  <LinkEndpoint RoutingId="0x8000" Chanend="1"></LinkEndpoint>
</Link>
 </Links>
But do i need to "unlink" the original library .xn source somehow. i.e. tell the complier to use my modified version in it's place?


2)I have appended the Makefile with -fxscope (some documents suggest -lxscope, what is the difference?)

Code: Select all

XCC_FLAGS_Debug = -g -O0 -fxscope
XCC_FLAGS_Release = -g -O3 -fxscope
(does xscope run in both Release & debug modes?)

3) My main looks like this

Code: Select all

#include <xs1.h>
#include <xscope.h>

#define FLASH_PERIOD 10000000

out port led = XS1_PORT_4F;

void xscope_user_init(void) {
  xscope_register(1,
    XSCOPE_CONTINUOUS, "testvalue",  XSCOPE_INT, "cnt"
  );
}


int main() {
  timer tmr;
  int t,test;
  tmr :> t;

  while (1) {
    led <: 0x3;
    t += FLASH_PERIOD;
    tmr when timerafter(t) :> void;
    led <: 0x0;
    test+=test;
    xscope_probe_data_pred(0, test);
    t += FLASH_PERIOD;
    tmr when timerafter(t) :> void;
  }
 }
Build error is

Code: Select all

XK-1A.xn:43 Error: XN11156 A normal Link node may not contain a sod endpoint.
Many thanks in advance for any help!


maxtorque
Junior Member
Posts: 4
Joined: Mon Mar 18, 2013 5:51 pm

Post by maxtorque »

Anyone?

Pulling my hair out now!

Tried everywhich way of combinations of:

Flags="SOD" & Flags="XSCOPE"
Link="X0LD" & Link="X0LC"
-fxscope & -lxscope


And about a thousand other ways.

All either error on "Error: XN11156 A normal Link node may not contain a sod endpoint" or compile but no data arrives in XDE

tried the UART version too, no difference

So, if anyone has a simple, working XSCOPE project for XDE / XK-1A i'd be grateful!

(if not, i'm filling the kit under B1N and going back to ARM like everyone else ;-)
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Try

Code: Select all

  <Links>
  <Link Encoding="2wire" Delays="4,4" Flags="SOD">
    <LinkEndpoint NodeId="0" Link="X0LC"/>
    <LinkEndpoint RoutingId="0x8000" Chanend="1"/>
  </Link>
  </Links>
Compile with -lxscope for 11.x and -fxscope for 12.x

And the Link should be C, not D for XK-1A

Flags="XSCOPE" is supported from 12.x, it used to be "SOD", but "SOD" still works for backwards compatibility
maxtorque
Junior Member
Posts: 4
Joined: Mon Mar 18, 2013 5:51 pm

Post by maxtorque »

Ok, thanks for confirming those values!

(Is it worth updating to the latest XDE s/w level?)


So, now i compile ok, but nothing happens on screen in the real time scope view?

It shows the channel in a purple coloured box, but has "disconnected" in red in the top right hand side of the left pane?

Am i missing something else important?

Thanks !
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Maybe you can give Offline Scope in run configurations a try.
It seems to work better here than the real-time scope.
Offline scope saves the trace to a file. You can import it in the Offline Scope window by clicking the folder icon.

I usually use the command-line tools only and capture it to a file and then use the Offline Scope in XDE for viewing.

Oh and you did not initialize the test variable in your code.
Attachments
xscope.png
(165.28 KiB) Not downloaded yet
xscope.png
(165.28 KiB) Not downloaded yet
maxtorque
Junior Member
Posts: 4
Joined: Mon Mar 18, 2013 5:51 pm

Post by maxtorque »

Ok, it's working now, but very flakey. I suspect my pc is having a bit of a moment tbh, because it seems to start, captures and works, but if you pause it, it doesn't restart. I will try the offline version, which tbh is probably more use to capture the data anyway,

Thanks for you help BTW! (always a bit of a struggle with first time users lol ;-)
User avatar
Kabron
New User
Posts: 2
Joined: Sat May 04, 2013 10:26 am

Post by Kabron »

Exactly the same thing.
I could see activity on IXUx-IXDx pins during RUN but XSCope stayed disconnected.
Under cmd I saw:

Code: Select all

D:\Users\Evi\workspace\Test_LCD\bin\Debug>xrun --xscope-file "test.xmt" --xscope
-limit 5 --verbose Test_LCD_Debug.xe
0x00010000 in main ()
Loading setup image to XCore 0
Loading section .text, size 0x124 lma 0x10000
Loading section .globcode, size 0x22 lma 0x10124
Loading section .cp.const4, size 0x4 lma 0x10148
Loading section .ctors, size 0x4 lma 0x1014c
Loading section .dp.data, size 0x18 lma 0x10150
Start address 0x10000, load size 358
Transfer rate: 174 KB/sec, 71 bytes/write.
Enable xscope on core 0 at address 0x10160
First stage multi-node boot completed
Loading application image to XCore 0
Loading section .text, size 0x574 lma 0x10000
Loading section .init, size 0x5c lma 0x10574
Loading section .fini, size 0x3a lma 0x105d0
Loading section .text.__call_exitprocs_impl, size 0x2 lma 0x1060c
Loading section .text._cleanup_impl, size 0x2 lma 0x10610
Loading section .rodata, size 0x4 lma 0x10614
Loading section .eh_frame, size 0x4 lma 0x10618
Loading section .cp.rodata.cst4, size 0x8 lma 0x1061c
Loading section .ctors, size 0x1c lma 0x10624
Loading section .dtors, size 0x18 lma 0x10640
Loading section .dp.data, size 0x1c lma 0x10658
Loading section .dp.rodata, size 0x2e lma 0x10674
Start address 0x10000, load size 1692
Transfer rate: 137 KB/sec, 141 bytes/write.
Enable xscope on core 0 at address 0x1066c
But it does not stopind aftre 5 cycles. If I made Ctrl+C, I got:

Code: Select all

Program received signal SIGINT, Interrupt.
wait (ticks=500000) at ../src/LCD.xc:20
20          t when timerafter(ts+2*ticks) :> int _;
Outputting xscope file test.xmt
but no .xmt file occured.
Do I need to check "Run XScope output server" in RUN configuration? I tried it with no success.
Attachments
XK-1A.xn.txt
(1.92 KiB) Downloaded 755 times
XK-1A.xn.txt
(1.92 KiB) Downloaded 755 times
Test_LCD.xc
(609 Bytes) Downloaded 752 times
Test_LCD.xc
(609 Bytes) Downloaded 752 times
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

maxtorque wrote:Ok, thanks for confirming those values!

(Is it worth updating to the latest XDE s/w level?)


So, now i compile ok, but nothing happens on screen in the real time scope view?

It shows the channel in a purple coloured box, but has "disconnected" in red in the top right hand side of the left pane?

Am i missing something else important?

Thanks !
May I ask how did you fix the error:
XN11156 A normal Link node may not contain a sod endpoint.
I encountered the same problem as yours. Thank you very much!
Post Reply