use uart for debug messages

Technical questions regarding the XTC tools and programming with XMOS.
hamtam
Active Member
Posts: 34
Joined: Wed Jun 28, 2017 7:37 am

use uart for debug messages

Post by hamtam »

I try to get debut messages on the UART inter interface. I use the xCORE-200 Dev Board together with the xTAG3 v1.2. I want to have messages like "printf("Value=%i", var);" but currently I get nothing.

I use "sw_usb_audio-[sw](6.15.2).zip" from the xmos.

I tried the following:
- add "-fxscope" into the Makefile. The whole string is:

Code: Select all

XCC_FLAGS_2i8o8xxxxx_tdm8  = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
								-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
								-DI2S_MODE_TDM=1 -DMAX_FREQ=96000 -DUSE_FRACTIONAL_N=1 -fxscope -DXSCOPE=1 
In the xTime Composer Is set in Debug Configuration "Run UART output server". With printf I get compiler errors, with printstr nothing noting on the console also. I am a bit lost now.


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

Post by mon2 »

Hi hamtam. Good to see you here again.

Can you review and try the suggestions in section 3 of the "Debug with printf in real-time" document?

Debug-with-printf-in-real-time_X1093A.pdf
You do not have the required permissions to view the files attached to this post.
hamtam
Active Member
Posts: 34
Joined: Wed Jun 28, 2017 7:37 am

Post by hamtam »

Okay it was not that easy. But I got it working.
I added in the main.xc form the USB Audio

Code: Select all

...
    par
    {
        on tile[XUD_TILE]:
        par
        {
//added
#ifdef XSCOPE
            //on tile[0]: xscope_user_init();
            on tile[1]: xscope_user_init();
#endif
//added end

#if (XUD_TILE == 0)
            /* Check if USB is on the flash tile (tile 0) */
#ifdef DFU
...
This did the Trick.