Questions on source code of AN00201: a startkit demo

New to XMOS and XCore? Get started here.
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

How to fix those two errors?


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

Post by mon2 »

Create a fresh project, select the xe216-512-tq128 cpu target OR your exact kit, if shown in the list and allow for the ide to create an empty c file. Compile. Any errors? Wondering if the issue is with the selection of the target. Post a zipped project for a review.
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

mon2 wrote:Create a fresh project, select the xe216-512-tq128 cpu target OR your exact kit, if shown in the list and allow for the ide to create an empty c file. Compile. Any errors? Wondering if the issue is with the selection of the target. Post a zipped project for a review.
create a fresh project..It might be too complicated . I have tried before ,but failed because the compiler kept telling me it can't find the "dsp.h" which I had included. So I avoid the error and adapted AN00162 to my own project. Does that matter?
And ...How to upload a zipped file?
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

And fresh project can have an empty can file and then you can add printf for "hello world".

To add anything in your post, see below and click on attachments.
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

I'm afraid that I didn't get you. I certainly can print a "Hello world".
And the following is my zipped project. Could you please run it on your computer and see what will happen?
I would be very appreciated if you could help me find what is on earth wrong with my xSCOPE settings. It just doesn't work .It is very flake. To summarize, I'd say:
1)Debug with printf in real-time
This method, in a word I call which a "redirect stdio",doesn't work. I followed the pdf but didn't get the same result. It seems that once the "printf" is used, the hardwares wouldn't work because it kept printing "0" which is a init value.
2)Using the xSCOPE to debug.
I have been working with this method for the whole day and I met various errors which can make a long story.
I refered to the xTIMEcomposer studio User guide and didn't get the correct result,either.Generally speaking,there are 2 situations:
a. build errors,often like these:
Description Resource Path Location Type
Undefined reference to '__sodEnd' (using xScope without specifying -fxscope?) AN00196_Getting_started_with_real_time_xSCOPE_in_xTIMEcomposer_Studio C/C++ Problem
Description Resource Path Location Type
Undefined reference to '__sodFlag' (using xScope without specifying -fxscope?) AN00196_Getting_started_with_real_time_xSCOPE_in_xTIMEcomposer_Studio C/C++ Problem
b. no build errors,but things go wrong
The desired sound can't be played by the speaker(AN00162) and it just makes a buzz. There are no curves of signals on the display pane. Only two straight lines blinked in the middle of the pane.

Thank you very much !!!!
Attachments
ANC_headphone_V1.0.zip
(455.22 KiB) Downloaded 163 times
ANC_headphone_V1.0.zip
(455.22 KiB) Downloaded 163 times
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Ok. Downloaded the zip file -> extracted to a local folder -> imported into my workspace -> used an existing project folder and the compiler raised an error of missing lib_i2c, lib_gpio, lib_i2s (believe this was the list).

So then clicked on the lib_i2s from the bottom left side of the screen and allowed for the tool to import the lib_i2s library which also imported a mix of others and now those errors are gone. Here is what I see now:


Image

Is this what you see or are you also missing some libraries?
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

mon2 wrote:Ok. Downloaded the zip file -> extracted to a local folder -> imported into my workspace -> used an existing project folder and the compiler raised an error of missing lib_i2c, lib_gpio, lib_i2s (believe this was the list).

So then clicked on the lib_i2s from the bottom left side of the screen and allowed for the tool to import the lib_i2s library which also imported a mix of others and now those errors are gone. Here is what I see now:


Image

Is this what you see or are you also missing some libraries?
This is exactly what I see.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

I think there is some confusion on the target definition. From where did you get the xr-audio-216-mc definition? Not audio developer so not sure why that is there as compared to xk-audio-216-mc. Need to get ready for work but will review again with some free time.

To understand and summarize, you have the XMOS audio kit and you wish to use XSCOPE (for printf in realtime) with it - nothing fancy? I did the same yesterday with the simulator and all was fine. Will test against the XCORE-200 Explorer kit which is similar but it is in the lab at work...bye for now.
cjf1699
Active Member
Posts: 48
Joined: Fri Mar 16, 2018 2:30 pm

Post by cjf1699 »

mon2 wrote:I think there is some confusion on the target definition. From where did you get the xr-audio-216-mc definition? Not audio developer so not sure why that is there as compared to xk-audio-216-mc. Need to get ready for work but will review again with some free time.

To understand and summarize, you have the XMOS audio kit and you wish to use XSCOPE (for printf in realtime) with it - nothing fancy? I did the same yesterday with the simulator and all was fine. Will test against the XCORE-200 Explorer kit which is similar but it is in the lab at work...bye for now.
But..for AN00162 ,Ijust can't build it...correctly
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. I think this example compiled for me ok.


Image

Try the following:

1) Exit your XMOS IDE and relaunch but start with a fresh project folder.

2) Download a fresh copy of the same AN00162 from here:

https://www.xmos.com/support/appnotes/AN00162

Extract this downloaded zip file to a local folder.

3) Select File -> Import -> General -> Existing Projects into Workspace -> Browse to the folder that has the expanded file from the code example.

4) Proceed to allow for the code example to download the support library files, etc. Proceed to compile and all should be good.

Image


Image
Post Reply