create binary lib for xcore-200 Topic is solved

If you have a simple question and just want an answer.
Post Reply
User avatar
Sebastian
Active Member
Posts: 39
Joined: Wed Jul 20, 2016 9:15 am

create binary lib for xcore-200

Post by Sebastian »

Hello everyone,

I tried to build binary test lib. So I followed the instructions on

https://www.xmos.com/download/xTIMEcomp ... (14.x).pdf
Chapter: 12 Using XMOS Makefiles to create binary libraries

When I now try to use this lib on a XEF232 CPU, this error code would be displayed.
xmap: Error: Target core mismatch between "XS2" (from "ctype_.c") and "XS1" (from "../src/testlib.xc").

This means that the lib has been compiled for XS1, if I understand it correctly.
Is there something I missed in the Makefile?

testlib is just a clone from
https://github.com/xcore/sc_lib_example

Makefile:

Code: Select all

XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.library
module_build_info

Code: Select all

LIBRARY=testlib
MODULE_XCC_FLAGS = -O3
EXPORT_SOURCE_DIRS = include


A big thanks in advance
Sebastian


View Solution
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. The GitHub post predates the XS2 cpu design.

Revise the makefile to force the compiler to Target your CPU by using the process documented in the attached file.

Another possible work around is to start a fresh project using xtimecomposer IDE and allow this tool to auto generate the makefile, you select the CPU which will then embed your target CPU selection. Use that makefile for compiling.

Please post your update.


User avatar
Sebastian
Active Member
Posts: 39
Joined: Wed Jul 20, 2016 9:15 am

Post by Sebastian »

Hi mon2,

thank you for your post.

I modified the Makefile in this way.

Code: Select all

TARGET  = XEF232-1024-FB374-C40
BUILD_FLAGS = -march=xs2a 
MODULE_LIBRARIES=xud_x200
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.library
But the folder struct still looks like it was compiled for xs1b.
lib_testlib->lib->xs1b->lib_testlib.a

>Another possible work around is to start a fresh project using xtimecomposer IDE and allow this tool to auto generate the makefile, you select the CPU which will then embed your target CPU selection. >Use that makefile for compiling.
I'm not very confirm with the xTimeComposer IDE.
The only generator I found, was new->xTimecomposerProject
But the generated Makefile has always
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
and not
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.library


So in the end, I still get this error
xmap: Error: Target core mismatch between "XS2" (from "ctype_.c") and "XS1" (from "../src/testlib.xc").
User avatar
Sebastian
Active Member
Posts: 39
Joined: Wed Jul 20, 2016 9:15 am

Post by Sebastian »

hei everyone,

I found workaround.

You will find all "upper" Makefiles in:
//xTimecomposer/build/xcommon/module_xcommon/build/

Here I edit:
Makefile.library1

Line 32:
LIB_ARCH := xs1b
to
LIB_ARCH := xs2a

Thats ok, because I onlye use xcore200.
But on the other hand.
A more common way would be nice to know.

Thanks,
Sebastian
Post Reply