xscope refusing to work

New to XMOS and XCore? Get started here.
Post Reply
wischie
Junior Member
Posts: 4
Joined: Thu Nov 05, 2015 12:03 am

xscope refusing to work

Post by wischie »

Hello,

Iam now trying for several hours to use xscope on my project, because it seems to pose some weired behaviour with the debug prints.

After long experimenting and using several tutorials/forum posts to help (like: https://www.xcore.com/forum/viewtopic.php?f=8&t=2120) I got no direct errors from the compiler anymore, yet it does not work.

I try offline mode, and it won't generate that intermediate file, which I placed in my user folder.
(C:\Users\Flip\Documents\xscope.xmt).

The used Processor is the XEF216-512-TQ128-C20.
and the xTimeComposer: Version: Community_14.1.2 (build 17961, Dec-04-2015)

Link definition:

Code: Select all

      <Links>
        <Link Encoding="5wire">
          <LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk"/>
          <LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk"/>
        </Link>
		<Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
			<LinkEndpoint NodeId="0" Link="XL0"/>
			<LinkEndpoint RoutingId="0x8000" Chanend="1"/>
		</Link>
      </Links>
config.xscope:

Code: Select all

<xSCOPEconfig ioMode="basic" enabled="true">

    <!-- For example: -->
    <!-- <Probe name="Probe Name" type="CONTINUOUS" datatype="UINT" units="Value" enabled="true"/> -->
    <!-- From the target code, call: xscope_int(PROBE_NAME, value); -->
	<!--<Probe name="DataRight" type="CONTINUOUS" datatype="UINT" units="Value" enabled="true"/> -->
</xSCOPEconfig>
Yes, the porobe is deactivated. Declaration down.

Makefile:

Code: Select all

# The TARGET variable determines what target system the application is
# compiled for. It either refers to an XN file in the source directories
# or a valid argument for the --target option when compiling
TARGET = XEF216-512-TQ128-C20

# The APP_NAME variable determines the name of the final .xe file. It should
# not include the .xe postfix. If left blank the name will default to
# the project name
APP_NAME = DiscreteDAC

# The USED_MODULES variable lists other module used by the application.
USED_MODULES = 

# The flags passed to xcc when building the application
# You can also set the following to override flags for a particular language:
# XCC_XC_FLAGS, XCC_C_FLAGS, XCC_ASM_FLAGS, XCC_CPP_FLAGS
# If the variable XCC_MAP_FLAGS is set it overrides the flags passed to
# xcc for the final link (mapping) stage.
XCC_FLAGS = -O2 -g -fxscope

XCC_FLAGS_Debug = -g -O0 -fxscope
XCC_FLAGS_Release = -g -O3 -fxscope
# The XCORE_ARM_PROJECT variable, if set to 1, configures this
# project to create both xCORE and ARM binaries.
XCORE_ARM_PROJECT = 0

# The VERBOSE variable, if set to 1, enables verbose output from the make system.
VERBOSE = 0

XMOS_MAKE_PATH ?= ../..
-include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common

LIB_DIRS = 
and finally the file with the probes (not in the main entry file!)

Code: Select all

#include <xscope.h>

void xscope_user_init ( void ) {
xscope_register (2,
XSCOPE_CONTINUOUS , " Data Left ", XSCOPE_INT , "mV",
XSCOPE_CONTINUOUS , " Data Right ", XSCOPE_INT , "mV"
);
}
[[combinable]]
void ConvertToInternalData(streaming chanend Input, chanend OutputLi, chanend OutputRe, int Mode)
{
    while(1)
    {
        select
        {
            case Input :> int Data:
                switch(Mode)
                {
                    case 0:     //TestDaten
                        OutputLi <: Data;
                        break;
                    case 1:     //S/PDIF
                        if ((Data & 0xf) == FRAME_Y)
                        {
                            Data &= 0x0FFFFFF0;
#ifndef ssrc
                            Data = Data >> 4;
                            Data = Data + 0x00800000;
#else
                            Data = Data << 4;
#endif
                            OutputRe <: Data;
                            xscope_int(1, Data);
                        }
                        else if ((Data & 0x0F) == FRAME_X || (Data & 0x0F) == FRAME_Z)
                        {
                            Data &= 0x0FFFFFF0;
#ifndef ssrc
                            Data = Data >> 4;
                            Data = Data + 0x00800000;
#else
                            Data = Data << 4;
#endif
							//OutputLi <: Data;
                            xscope_int(0, Data);
                        }
                        break;
                }
                break;
        }
    }
}
OutputLi is effectively disabled, because they were interfering with the xConnection pins. they are configured to be available.

I will greatly appreciate any help whatsoever.


wischie
Junior Member
Posts: 4
Joined: Thu Nov 05, 2015 12:03 am

Post by wischie »

Hi again!

The 4 xConnect wires are connectet liko on Page73 in the Datasheet.
XL01out (X0D43) to pin 6 of the xSYS header
XL00out (X0D42) to pin 10 of the xSYS header
XL00in (X0D41) to pin 14 of the xSYS header
XL01in (X0D40) to pin 18 of the xSYS header

On all 4 wires is no activity. Just low.

My programming device is the XTAG V3.0

Best regards!
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

There are actually two ways of setting up xSCOPE:
  1. xscope_user_init and -fxscope
  2. config.xscope
config.xscope is better in that it generates macros from probe names, e.g. DATA_LEFT for "Data Left", that you can use instead of just probe numbers.

Try using one or the other. I am not sure what happens when you try and mix the two.
wischie
Junior Member
Posts: 4
Joined: Thu Nov 05, 2015 12:03 am

Post by wischie »

Hi,

thank you for your reply. I will try again, to explicit separate the 2 configurations. Allthough I thought, that the xscope.config has it's configurations actually disabled.

I will post again, after I fully tried that route.
wischie
Junior Member
Posts: 4
Joined: Thu Nov 05, 2015 12:03 am

Post by wischie »

Thank you, I got it to work.

For reference for future users:
I used the config.xscope .

following declarations got it right for me:

Makefile:

Code: Select all

...
# The flags passed to xcc when building the application
# You can also set the following to override flags for a particular language:
# XCC_XC_FLAGS, XCC_C_FLAGS, XCC_ASM_FLAGS, XCC_CPP_FLAGS
# If the variable XCC_MAP_FLAGS is set it overrides the flags passed to
# xcc for the final link (mapping) stage.
XCC_FLAGS = -O2 -g -fxscope
...
config.xscope:

Code: Select all

<xSCOPEconfig ioMode="basic" enabled="true"> 

    <!-- For example: -->
    <!-- <Probe name="Probe Name" type="CONTINUOUS" datatype="UINT" units="Value" enabled="true"/> -->
    <!-- From the target code, call: xscope_int(PROBE_NAME, value); -->
	<Probe name="Data Right" type="CONTINUOUS" datatype="INT" units="Value" enabled="true"/>
</xSCOPEconfig> 
and the final call: (note the naming change of the probe)

Code: Select all

...
#include <xscope.h>
...
xscope_int(DATA_RIGHT, Data);
and no void xscope_user_init ( void ) {}!

You want to perform a clean+rebuild.
And I didn't had any success when I called the Probe "DataRight" and called it with "DataRight". Even though it compiled.
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

Glad it's solved

You can highlight the post closest to an "answer" by clicking the green tick in the bottom right corner
Post Reply