Custom debugging for U8A-FB96

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
ast8346
Active Member
Posts: 39
Joined: Mon Jan 05, 2015 12:58 am

Custom debugging for U8A-FB96

Post by ast8346 »

Hello

I'm doing a project designing AD-DA stereo converter based on USB reference design (with U8A-FB96), which is similar in terms of function ability but different in content.

My question is regarding how to print between the board and the console.
I can see that I can choose between JTAG or xCOPE and I have found excellent post by infiniteimprobability explaining pros and cons of both. However, as far as I can see external XTAG-2 adapter is required in both cases for data transfer to occur.
I wonder if can I do it without external adapter, I mean interfacing directly from xTimeComposer into U8A-FB96 via USB PHY?
If no, may I also ask why?

Also, I have a programmable DAC chip on board and I was thinking to provide a debugging route to it in order to change the register (to customize digital filter basically). I wonder what would be the best way to do it? Can I connect it to XTAG-2 somehow in such a way that use of different software will be possible unless xTimeComposer can do it too? Or it has to be something completely different in that case?

Essentially using XTAG-2 is not a problem at all, but I was trying to think about different ways of doing it?

Hope for you assistance,
Kind Regards,
Anthony


krishnabalan
Member++
Posts: 24
Joined: Thu Aug 14, 2014 10:55 am

Post by krishnabalan »

Hi,

You can connect the XTAG-2 to your board and make use of the XSCOPE feature of it.
There is a host library available to send and receive data through XSCOPE at this link https://github.com/xcore/sc_xscope_support
And you can checkout this link https://github.com/xcore/sw_startkit_ex ... st_dsp_gui for how to use the XSCOPE host library. Using XSCOPE is the easiest way for you, as you can use the existing 'print' functions in the device side.

Another option would be to use the USB as Virtual serial port. This link has the application note on it https://www.xmos.com/support/appnotes/an00124.

Hope it helps!

Cheers,

Krishna
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

I'd second Krishna's idea to use bi-direction xScope. It's fast and not very intrusive at all..
There's an appnote to show how it's done here http://cognidox/vdocs/XM-006673-AN-8-AN ... dpoint.pdf

Regarding
I wonder if can I do it without external adapter, I mean interfacing directly from xTimeComposer into U8A-FB96 via USB PHY? If no, may I also ask why?
Interesting thought. Well obviously you need the usb bit for you USB soundcard, but USB supports composite devices. For example, the UAC2 ref design already supports a HID device at the same time as audio. So why not add the Virtual serial port interface in there too? The appnote linked above shows that.. Then just use a terminal on the host - that could be made to work from the console window in the GUI.

However, using a single tile device, you'll soon run out of cores - at most you only have one free in USB audio, but that's probably all you need.

However, if this is only ever a debug requirement, then adding the VCP to the production code probably doesn't really make sense, in which case bi-directional xSCOPE sounds like a good bet.

Some history - we used to use something like this in the "old days" pre-xscope - a UART debug out which could catch messages from any thread. https://github.com/xcore/sc_xlog/
Now pretty much defunct and it was only ever one way (out) and consumed a core.. xSCOPE only needs a channel end, a link to the XTAG and some channel bandwidth, so has much less impact on user resources.

Further point - you can actually do scanf over JTAG to get values from the console already. However, beware that, being JTAG, it does a system call which breaks real time. So it might be usable at startup.. Definitely not once the app has started
krishnabalan
Member++
Posts: 24
Joined: Thu Aug 14, 2014 10:55 am

Post by krishnabalan »

And here is the public link to the app note suggested by 'infiniteimprobability' on bi-directional xSCOPE https://www.xmos.com/download/public/AN ... 0.0%29.pdf
ast8346
Active Member
Posts: 39
Joined: Mon Jan 05, 2015 12:58 am

Post by ast8346 »

Hello again
It has been nearly 2 weeks now and I still can't decide really :)
Virtual Serial Port seems like a very reasonable solution as I do have a spare core and it will provide me more flexibility in terms of debugging in non-laboratory conditions.
But I don't think I really understand how to ...how to. Would you mind to help me to break down the process of creating Virtual Serial Port into a few simple steps that I will be able to follow? (assuming that my programming skills are poor).
I will start with what I seem to be able to understand so far:
1. I need to create a new application in Xtime Composer and call it xrun app_usb_cdc_demo.xe, for example
2. Inside app_usb_cdc_demo.xe I need to create files main.xc, xud_cdc.xc, xud_cdc.h, xud_conf.h and fill them accordingly to VSP datasheet. Do I need to change anything in terms of my custom design? How do I assign a core to VSP? Also, how do I integrate it with the main application (app_usb_aud_xk_u8_2c), can I run them simultaneously?
3. On the physical board I need to connect usb_dp, usb_dn, usb_vbus pins from usb connector to ... usb_dp, usb_dn, usb_vbus pins on XMOS, right? Nothing else?
4. In terms if I want VSP to talk not only to XMOS, but to my ESS chips as well, how that may work? Would it be possible to split usb signals and direct them to control pins on chips, so I can choose in software with what device I wish to talk? Or can I make XMOS to send commands into ESS chips via SDA\SCL? Assuming I will activate 'software mode' on chips first by sending ADDR pin to 'high'. This is an optional step and I am quite confused with it myself to be honest.
5. When running software, I will be simply sending commands to XMOS via command prompt to read\write the data? like > xrun app_usb_cdc_demo.xe and it will work?
ps. I am actually considering to make provisions for XTAG even if I will be using VSP. Thus, if I will fail to figure out how to use one of them, maybe I will have success with another? :D