xSCOPE link fails on xCORE-200

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Posts: 27
Joined: Fri Sep 15, 2017 2:58 pm

xSCOPE link fails on xCORE-200

Postby cl-b » Wed Nov 08, 2017 11:49 am


I try to use xSCOPE to trace data in my application based on xCORE-200 MC AUDIO evaluation board. I would like to use xscope_start() and xscope_stop() functions but application build always fails with the following error

xscope_probe_xlink.S:(.text+0x3e): Error: value 0x00000291 for relocation R_XCORE1_DP_REL6 is out of range
C:\Users\user\AppData\Local\Temp\sod_2: Error: relocation with respect to '__sodEnd'

xSCOPE initialisation

Code: Select all

void xscope_user_init()
            XSCOPE_STARTSTOP, "Function1", XSCOPE_UINT, "Units"

xSCOPE in XN file

Code: Select all

    <Node Id="2" Type="device:" RoutingId="0x8000">
      <Service Id="0" Proto="xscope_host_data(chanend c);">
        <Chanend Identifier="c" end="3"/>
    <Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
      <LinkEndpoint NodeId="0" Link="XL0"/>
      <LinkEndpoint NodeId="2" Chanend="1"/>

If I use xscope_int instead of xscope_start and xscope_stop, compilation is OK

Application is compiled with xTIMEcomposer 14.3.2

XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Postby robertxmos » Thu Nov 09, 2017 10:36 am

Hi cl-b,

Yes, the problem is with the linking.
The linker is trying to fit the relative distance 0x00000291 into an instructions that takes 6bits immediate viz: R_XCORE1_DP_REL6.
This should only be a problem if your data pool (DP) is larger than 2^6*4bytes = 256bytes.
The value 0x291 (word offset) suggest you have at least 657 bytes - very reasonable!

The solution is to either
1. Reorder you data pool so that '__sodEnd' comes early.
    This can be done by including xscope_probe_xlink.S earlier in the list of include files.
    Try adding the following to your Makefile (relative location of xscope_probe_xlink.o may need adjusting - look in your .build directory):

    Code: Select all

    XCC_EXTRA_MAP_FLAGS = -Xmapper --first -Xmapper xscope_probe_xlink.o

2. Fix the underlying problem of using a 6bit immediate.
    I believe the problem may be due to xscope_probe_xlink.S (line 558) doing a 'ldwdp' in dual issues - forcing it to use a smaller instruction/immediate.

    Code: Select all

    {ldw     r2, dp[__sodEnd] ; getr    r3, 2}

    I believe that unbundling the instruction will fix things by allowing the use of a R_XCORE1_DP_REL16 (256K byte offsets) viz:

    Code: Select all

    ldw     r2, dp[__sodEnd]
    getr    r3, 2

I will log your report as a bug.
If you are happy to try #2 out I would be pleased to know if this fixes the bug.

Posts: 27
Joined: Fri Sep 15, 2017 2:58 pm

Postby cl-b » Thu Nov 09, 2017 2:10 pm

Hi Robert,

Thanks for your answer.
Both solutions are not working because I cannot find xscope_probe_xlink.S file. Is it normal ?


Who is online

Users browsing this forum: No registered users and 60 guests