Cannot start AN00231 on xCORE-200 MC AUDIO Topic is solved

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Cannot start AN00231 on xCORE-200 MC AUDIO

Postby dsteinwe » Wed Jun 29, 2016 9:16 am

I am new to the XCORE development and I want to start the example AN00231 on the xCORE-200 MC AUDIO. I followed the instruction the pdf on page 16. Unfortunally, the application does not run. I have tried it with Windows and Linux.

Under Linux I got following console output:

Code: Select all

Starting I2S
SR change in lib_audio_codec - 48000
Initializing I2S to 48000Hz and MCLK to 24576000Hz
After it, the application stops immediately. Can you give me a hint what I do wrong?
View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Wed Jun 29, 2016 1:07 pm

Have you definitely got a valid SPDIF stream being sent to the optical input? I check the end of the TOSLINK cable to see the red light in the fibre.

It initialises to 48KHz and then changes SR (if needed) when a valid stream comes in..

I would expect your (above) output when no SPDIF stream is being received.

If this doesn't work, could you expand more about "stops". Where does the debugger say things are?
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jun 30, 2016 10:26 am

I use a cd player with a spdif out and I can see a red light in the fibre. I had connect it to the spdif port with the black flap. So far, I think, it is not a problem of the source or a connection to a wrong spdif port.

I will try to debug it and give you a feedback, if I have new insights. BTW, the application behaves different, if I start it under Windows. I wouldn't expect a difference. But for now, I will try Linux at first.
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Thu Jun 30, 2016 10:28 am

I wouldn't expect a difference.
Me neither. The application is completely stand-alone and does not interact with the host other than print debug info.

You can try flashing it and disconnecting the debug adapter altogether?
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jun 30, 2016 10:49 am

I have started the app inside the debugger. It doesn't run into my breakpoints. Therefore I have removed all my breakpoints. I got following output to the console:
.gdbinit: No such file or directory.
connect --adapter-id 10ThRkSJ --xscope-realtime --xscope-port localhost:10101
0x00040000 in _start ()
load
Loading section .text, size 0x18c lma 0x40000
Loading section .cp.rodata, size 0x18 lma 0x4018c
Loading section .dp.data, size 0x1c lma 0x401a4
Start address 0x40000, load size 448
Transfer rate: 109 KB/sec, 149 bytes/write.
Loading section .text, size 0x40 lma 0x40000
Loading section .cp.rodata, size 0x18 lma 0x40040
Loading section .dp.data, size 0x8 lma 0x40058
Start address 0x40000, load size 96
Transfer rate: 31 KB/sec, 32 bytes/write.
Loading section .text, size 0x6834 lma 0x40000
Loading section .init, size 0x1c lma 0x46834
Loading section .fini, size 0x30 lma 0x46850
Loading section .eh_frame, size 0x24 lma 0x46880
Loading section .cp.rodata, size 0x24 lma 0x468a4
Loading section .cp.rodata.4, size 0x2eb lma 0x468c8
Loading section .cp.const4, size 0x30 lma 0x46bb4
Loading section .cp.rodata.string, size 0x2d lma 0x46be4
Loading section .cp.rodata.cst4, size 0xa4 lma 0x46c14
Loading section .ctors, size 0x48 lma 0x46cb8
Loading section .dtors, size 0x44 lma 0x46d00
Loading section .dp.data, size 0x35f8 lma 0x46d48
Loading section .dp.data.4, size 0x24 lma 0x4a340
Loading section .dp.rodata, size 0x20 lma 0x4a368
Loading section .dp.rodata.4, size 0x44 lma 0x4a388
Start address 0x40000, load size 41920
Transfer rate: 190 KB/sec, 2794 bytes/write.
Loading section .text, size 0x1464 lma 0x40000
Loading section .init, size 0x1c lma 0x41464
Loading section .fini, size 0x30 lma 0x41480
Loading section .eh_frame, size 0x24 lma 0x414b0
Loading section .cp.rodata, size 0x20 lma 0x414d4
Loading section .cp.const4, size 0x30 lma 0x414f4
Loading section .cp.rodata.cst4, size 0xc lma 0x41524
Loading section .cp.rodata.cst16, size 0x10 lma 0x41530
Loading section .ctors, size 0x14 lma 0x41540
Loading section .dtors, size 0x14 lma 0x41554
Loading section .dp.data, size 0x28 lma 0x41568
Loading section .dp.data.4, size 0x10 lma 0x41590
Loading section .dp.rodata.4, size 0x14 lma 0x415a0
Start address 0x40000, load size 5556
Transfer rate: 146 KB/sec, 427 bytes/write.
info program
Program stopped at 0x40000.
It stopped with signal SIGTRAP, Trace/breakpoint trap.
Type "info stack" or "info registers" for more information.
Starting I2S
SR change in lib_audio_codec - 48000
Initializing I2S to 48000Hz and MCLK to 24576000Hz
[Switching to tile[1] core[1] (dual issue)]
... and the debugger stops automatically in this line without a breakpoint:
tile[0] core[0] (Suspended)
5 output_word() i2s_master_impl.h:62 0x000420c4
4 i2s_ratio_n() i2s_master_impl.h:170 0x0004397d
3 i2s_master0() i2s_master_impl.h:204 0x0004397d
2 __main__main_tile_0_task_i2s_master0_15() <synthesized>:118 0x0004397d
1 __start_other_cores() 0x00046290
The versions of my libs are:
lib_gpio - 1.0.1
lib_i2c - 3.1.6
lib_i2s - 2.1.1
lib_logging - 2.0.1
lib_src - 1.0.0
lib_xassert - 2.0.1
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jun 30, 2016 11:08 am

I have flashed the board. The diodes d23, d24 and d20 are lighting. Once or twice a second the diodes turns off.

I have pressed many times button 1. But it doesn't make a difference. Sometimes d22 and d18 flashes.

I have no audio on line out 1-2.
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Thu Jun 30, 2016 11:36 am

OK - I can re-create this using tools 14.2.0. Something has broken during the publishing process..

Can you let me know what tools version you are using?

Here's a working binary for now while I get to the bottom of it - you should expect it to work out of the box.
You do not have the required permissions to view the files attached to this post.
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jun 30, 2016 12:06 pm

I had used Community_14.1.2 (build 17961, Dec-04-2015). Now, I have installed 14.2.0.

I have flashed your bin and can confirm, that the bin works perfectly on my board. Makes fun ;-).
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Thu Jun 30, 2016 12:49 pm

Hi, you will need version 14.2.0 as it has proper support for function pointers in C.

RIght, have found the issue. It is an illegal PC due to an illegal instruction. The assembler is trying to build lib_spdif as dual issue. It's not written in dual issue (it's ASM for spdif rx)..hence the issue.

So what was happening is that the spdif_rx thread threw an exception. The rest of the system was working fine though but just not getting any audio frames. Hence why it looked exactly like disconnecting the SPDIF cable!

Simple work-around is to modify:

Code: Select all

lib_spdif/lib_spdif/module_build_info
as follows:

Code: Select all

MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -g -mno-dual-issue
We'll work on getting it fixed at this end in lib_spdif..

Let me know if the above mod works.

Thanks for reporting the issue!
User avatar
dsteinwe
Active Member
Posts: 36
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jun 30, 2016 2:08 pm

Unfortunally, I can't confirm it. Maybe, I do something wrong. I can create bins and flash it on my own with the tool version "Community_14.2.0". I have modified the line as you have described. After it, I have clicked "Clean project" and after it "Build project". But I cannot run the application without flashing it.

Who is online

Users browsing this forum: No registered users and 2 guests