I have had a really hard time debugging with the example , AN00162 ,on my board:
xCORE-200 Multichannel Audio Platform. This example creates a digital audio loopback on the XMOS multicore microcontroller. What I want to do is to observe the value of sample read and sent by i2s bus, which is really simple. However, I have tried a few different ways under the help of various documents on XMOS site, including
A:debug with real-time printing;
B: the offline mode of the xscope;
C: the real-time mode of the xscope, and even xgdb using the command line.
Unfortunately, these listed methods all failed. The following is the related code section:
When I tried to use method A, the console kept outputting 0 and the input music couldn’t be looped back. We could hear nothing from the speaker, and the output result was wrong, either.
When I tried to use method B, again, we can hear nothing from the speaker but a buzz . When I stopped the project, the trace perspective showed below:
When I tried to use method C, except for the trace perspective after pressing the stop button(showed below), everything was the same: nothing but a buzz could be heard , which seems to mean that the music can’t be looped back with no matter what debug method being used.
In the picture above, 2 straight lines whose values were both 0 , were blinking.
The other day it occurred to me that the maybe I could use the LED arrays on the board to examine the value of “sample”. I added "if" conditions like this in the case receive and send:
Code: Select all
case i2s.receive(size_t index, int32_t sample):
samples[index] = sample;
if(sample != 0){ //turn on D25
led_row <: 0x7;
led_col <: 0x8;
}
// xscope_int(0, sample);
break;
case i2s.send(size_t index) -> int32_t sample:
sample = samples[index];
if(sample != 0){ //turn on D10
led_row <: 0xE;
led_col <: 0x1;
}
break;
Now, I don’t know what to do. What’s wrong on earth? I attached the project and I would be grateful if anyone can help me.
Thanks a lot!
cjf