SPI Async Mode in Example AN00160 won't work Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
MrMcMathew
Junior Member
Posts: 7
Joined: Tue Apr 07, 2015 9:52 pm

SPI Async Mode in Example AN00160 won't work

Post by MrMcMathew »

Hello everyone,

I'm trying to get to grips with SPI and how to use it on an XMOS Device.
I have downloaded the XMos SPI_lib and since this is the first time I'm using code from other people (and therefore functions I have no clue about) I also downloaded the Example AN00160 to play around a little.
Setting all things up and including the lib_spi module worked just fine.
I also can simulate/trace messages in Synchornous mode.
However, when I try to run the example in asynchrounus mode (i.e commenting the sync main function and decommenting the async main function) I'm getting this:

Code: Select all

../src/main.xc: Error: Undefined reference to '_Sspi_master_async_0'
xmake[1]: *** [bin//AN00160_using_SPI_master.xe] Error 1
xmake: *** [bin//AN00160_using_SPI_master.xe] Error 2
I have tried searching for _Sspi_master_async_0 inside the spi_async.xc, the spi.h as well as in the main.xc of AN00160 because I assumed a typo yet I couldnt find that line anywhere.

So if anyone of you guys has any Idea how I could get this to work the he could make an XMOS Newb quite happy.

thanks in advance.

IDE: XTIME Composer Studio 14.1.2
BOARD: (although of no sgnificance since its not beeing used for spi yet) Synapticon c22
OS: Windows 8.1


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

Post by mon2 »

Ok - now that was weird. Imported the same project and compiled fine with the sync mode of the application note. Proceeded to comment out the async version and received the same error as you noted. After some toying with the compiler - the same code now compiles just fine.

Please try the following:

a) Project -> Clean
b) Project -> Build All

Does that work for you ? Believe that is all I did on this side.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

That does look like an issue with the build that should be fixed by:

Code: Select all

make clean
make
There is a known issue in 14.1.x where the dependencies are sometimes not correctly computed and therefore require a clean. This should be fixed in the 14.2 version of the tools when they are released.
MrMcMathew
Junior Member
Posts: 7
Joined: Tue Apr 07, 2015 9:52 pm

Post by MrMcMathew »

Hello again
please excuse the late answer, I had ... reasons

Cleaning and building again has worked like a charm. Thanks a lot for that advice. It looks like this also solves another problem I had when the actual board refused to run any changes done in code but sticked to a former version. Speaking of which:
@peter
These lines you posted are worth a try to spare me all the clicking for cleaning and buiding.
Now this xmos is my first µC and im relatively new to programming too so I hope you can forgive me that question (I'm even a little ashamed that I have to ask) but where do I put those lines?