Page 1 of 1

Why Can't I print data to console

Posted: Thu Feb 02, 2017 3:59 pm
by shaileshwankhede
Hi,

I am not sure if anybody else is facing this issue but I never got success with this.
I am using Mic array kit with and xTAG-3 debugger. When I run simple dsp applications like app_statistics, I can see printf data on console when run on hardware with JTAG mode.
But when I try to check by adding simple printf statement in default application app_usb_aud_mic_array, it doesn''t print anything on console. Application runs perfectly and there is no blocking etc.
What could be wrong? Does it have anything to do with xscope? I just want to see some data in console (signal trace is not required).
I even tried with different xsope settings, but nothing worked.

Thanks,
Shailesh

Re: Why Can't I print data to console

Posted: Thu Feb 02, 2017 6:45 pm
by henk
Hi Shailesh,

It may depend on the config.xscope file; have a check whether they are different.
If so, app_statistics will be right, and app_usb_aud_mic_array will be wrong.

There is also an option that one of those programs has some old xscope_init function that needs to be removed?

Cheers,
Henk

Re: Why Can't I print data to console

Posted: Fri Feb 03, 2017 10:09 am
by shaileshwankhede
Hi Henk,

Thank you for suggestions. Yes problem was my application was having config.xscope (I had put it last time to analyze signal traces).
After removing config.xscope it works. Also need to change xscope mode to 'Offline' in run configuration.

But I can say printing is not consistent. In some other application after adding print, it was working. Just after little modification of print statement, again it stopped working.
When I try to debug at this time, and pause to see where application is stucking, I see error message: Can't find a source file at "xscope_api.c".
Not sure what made working application to cease. Clean build also did not help.

Thanks,
Shailesh

Re: Why Can't I print data to console

Posted: Fri Feb 03, 2017 12:23 pm
by peter
Can you say what the contents of your config.xscope is in the case of it working and not working. There are a number of things that can be controlled from that file and it may be that you have in some cases enabled JTAG I/O.

Regards,

Peter

Re: Why Can't I print data to console

Posted: Fri Feb 03, 2017 2:00 pm
by shaileshwankhede
Hi Peter,

Below is the content of config.xscope when it was not working:

Code: Select all

<xSCOPEconfig ioMode="basic" enabled="true">
    <Probe name="mic_gain" type="CONTINUOUS" datatype="INT" units="Value" enabled="true"/>
    <Probe name="audio_out" type="CONTINUOUS" datatype="INT" units="Value" enabled="true"/>
</xSCOPEconfig>

<Link Encoding="2wire" Delays="4,4" Flags="XSCOPE"> 
	<LinkEndpoint NodeId="0" Link="X0LD"/>
	<LinkEndpoint RoutingId="0x8000" Chanend="1"/> 
</Link>
However after removing this file completely I could see print log in one file (maybe other used module already having its own xscope config file?),
but for other file it worked only once.

Thanks,
Shailesh

Re: Why Can't I print data to console

Posted: Fri Feb 03, 2017 2:22 pm
by peter
Hi Shailesh,

Without a config.xscope, printing will be enabled by default, but it will use JTAG which stops the machine while the I/O happens. A basic configuration to enable printing would be:

Code: Select all

<xSCOPEconfig ioMode="basic" enabled="true">
</xSCOPEconfig>
Using that as a config.xscope file when you compile you should be able to run with

Code: Select all

xrun --xscope BIN
And see your output. Is that the case?

Regards,

Peter

Re: Why Can't I print data to console

Posted: Fri Feb 03, 2017 2:42 pm
by shaileshwankhede
Thanks Peter,

Got the point. Few mistakes I was doing.
Even after putting config.xscope, I was selecting Target I/O option as JTAG, but it should be xSCOPE; and JTAG might be interrupting mic sampling operation earlier.
This saved my lot of work of analysing! :-)

Regards,
Shailesh