Link Error : Immediate out of range for instrution mkmsk

Technical questions regarding the XTC tools and programming with XMOS.
kd89
Newbie
Posts: 1
Joined: Sat Nov 26, 2011 1:55 am

Link Error : Immediate out of range for instrution mkmsk

Post by kd89 »

Hi everyone,
I am trying to run the following code (from github) to see the working of xscope. I am using an XC-1A development kit. My current project is to develop a digital tanpura en.wikipedia.org/wiki/Tambura. To observe the output sound patterns, I am using xscope.

Code: Select all

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

void wait ( int delay ){
   timer t ;
   int i ;
   t :> i;
   t when timerafter ( i + delay ) :> i ;
}
unsigned int memory_used = 0;

void allocate_memory ( unsigned int size ) {
           memory_used += size ;
           xscope_probe_data (0 , memory_used );
}

int main ( void ) {
    int i = 0;
    xscope_register (1 , XSCOPE_DISCRETE , " Memory Allocated " ,
         XSCOPE_UINT , " Bytes " );
    for ( i = 1; i < 10; i ++) {
      // Do something
      wait (1000);
      // Allocate memory
      allocate_memory ( i *100);
    }
    return 0;
}

Makefile is as follows

Code: Select all

TARGET = XC-1A
XCC_FLAGS =  -O2 -lxscope

include ../xcommon/module_xcommon/build/Makefile.common
all: $(BIN_DIR)/$(APP_NAME).xe
        @echo Build Complete

clean: clean_common
I have added the following code to between Packages and ExternalDevices tags in XC-1A.xn file as follows,

Code: Select all

(...)
        <Links>
          <Link Encoding="2wire" Delays="4,4" Flags="SOD">
            <LinkEndpoint NodeId="0" Link="X0LA" />
            <LinkEndpoint RoutingId="0x8000" Chanend="1" />
          </Link>
        </Links>
(...)
The problem is that I am getting a link error.
  • /tmp/sod_JjJOIU:32: Error: A00048 Immediate out of range for instruction: 'mkmsk'. Value is 0. Allowed ranges are: 32..32, 1..8, 16..16, 24..24.
    xmap: Error: Failed to assemble SOD support.
    xmake: *** [test_xscope_Debug.xe] Error 1
My xrun version is 11.2.2. I hope I have given most of the information. Thanks in advance. :)


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

Post by Bianco »

Hi kd89,

Xscope is not supported on XS1-G devices.

To use Xscope you will need to debug with an XTAG2 adapter instead of a FTDI-based device such as the one on the XC-1A. The XTAG2 is based on a XS1-L device and you can only use Xscope for XS1-L devices because the XMOS Link implementation between XS1-G and XS1-L slightly differ (G does not support the 'HELLO' token).

Bianco