Why Can't I print data to console Topic is solved

If you have a simple question and just want an answer.
Post Reply
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Why Can't I print data to console

Post 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


View Solution
henk
Respected Member
Posts: 347
Joined: Wed Jan 27, 2016 5:21 pm

Post 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
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post 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
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post 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
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post 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
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post 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
shaileshwankhede
Experienced Member
Posts: 65
Joined: Fri Dec 02, 2016 1:30 pm

Post 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
Post Reply