'error' messages in xe binaries

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Obtuse
Member++
Posts: 29
Joined: Mon Jul 09, 2012 11:54 pm

'error' messages in xe binaries

Post by Obtuse »

When building Release files for the XS1-L2-124 I get warnings/errors
built into the .xe file.

These messages do not show up in the XDE except that there is a
bug symbol in front of the binaries.

They do show up in the xe file when looking at it with a hex editor.

The manual shows -W switches that should eliminate the problem, but
does not say where to put the switches. At least I can't find where.


User avatar
yamada
Member
Posts: 9
Joined: Wed Nov 02, 2011 2:49 am

Post by yamada »

Hello Obtuse,

I don't understand all of things what you say, but if you want to specify compiler option, I can tell the way.
Just double-click the Makefile in Project Explore and write options in "Xcc flags" section.
If you use the older version of XDE, location of compiler flags are in different place. (maybe in property of project or build. I've forgotten.)
User avatar
Obtuse
Member++
Posts: 29
Joined: Mon Jul 09, 2012 11:54 pm

Post by Obtuse »

Perhaps further explaining is prudent.

The supplied hex.xc file below can be copied and pasted into a new project that uses a two tile chip xn file.

Thanks to LyleHaze I found where to put the -switches (-O1 -w) in the makefile.

However, the problem still exists that 'errors' are showing up in the release (xe) code when viewed in a hex editor. They are at the bottom of the hex.xc file. Notice they are related to the source code and not to any build or logic problem, and they do not show up in xTIMEcomposer. The code does run on the chip and in the Simulator.

What is not right?
What needs to be added/changed/modified to either the source or IDE to prevent this?

Thank You.

Code: Select all

/*
 * hex.xc
 * XS1-L2-124 chip
 * XS1-L12A-128-QF124-I8
 * Two Tile chip
*/

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

#define DELAY 2000

on stdcore [0] : port out port1K = XS1_PORT_1K;
on stdcore [1] : port out port1E = XS1_PORT_1E;

// on core 1.
void boss (chanend ch, out port port1E)
{
	unsigned bossdata;
	unsigned pin1E;
	while (1){
			ch :> bossdata;
			pin1E = peek(port1E);
			port1E <: bossdata;
	 	 }
}

// on core 0.
void worker (chanend ch, out port port1K, int delay)
{
  timer tmr;
  unsigned t;
  unsigned workdata = 0;
  unsigned count = 0;
  while (1)
  	  {
	tmr :> t;
   	tmr when timerafter (t+ delay ) :> void;
    	port1K <: workdata;
    	count++;
        if (count > 6)
    		{
        	ch <: workdata;
        	count = 0;
    		}

    workdata = !workdata;
          }
}

int main (void)
{
	chan ch;
  par {
	on stdcore [0] : worker ( ch, port1K, DELAY);
	on stdcore [1] : boss ( ch, port1E);
      }
  return 0;
}

/*
* These errors appear in Release binary (.xe)
* and can be found with a hex editor using the
* Find Function set to search for " error ".
*
* /src/hex.xc:55: error: previously used here
* /src/hex.xc:56: error: previously used here
* /src/hex.xc:54: error: use of `%s' violates parallel usage rules
* /src/hex.xc:55: error: call to `worker' in `main' makes alias of global 'port1K'
* /src/hex.xc:56: error: call to `boss' in `main' makes alias of global 'port1E'
*/
END