modified .xn file to enable xScope debug

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Lorien
Active Member
Posts: 33
Joined: Wed May 19, 2010 9:07 am

modified .xn file to enable xScope debug

Postby Lorien » Fri Aug 21, 2020 1:53 pm

Hello,
after a long process of fighting my lack of knowledge on programming, I finally start learning XC, XMOS and all related stuff!
Really love them with one exception: their documentation is like air: everywhere and yet nowhere!
For a start, I have two Startkit boards and XMOS' early USB 2.0 audio board build around XS1-L01A ... now changed to XS1-L8A (if I recall correctly)!
I'm using USB 2.0 audio board and attached Xtag2 debug adapter with it!
Yesterday I tried to enable xScope to search for a way to debug my code and application!
I also tried JTAG channel and it works with all print options but, as I read on XtimeComposer and saw with my own eyes, JTAG commumincations may disrupt realtime processing! True enough since my USB board is stop running after a printf on the console!

Back to my requirement: I really want to add xscope to my board! How to do that ???
I know I have to add -fxscope in Make file (which I did), I knok I have to import <xscope.h> (which I did) but I do NOT know how to change the .xn file to accommodate for the XSCOPE debugger!
I tried to find documentations before posting this message but none helped me!
FIY, the xscope on startkit worked flawlessly (even though I saw in that example XMOS didn't insert the -fxscope in Makefile)
here's a copy of the default .xn content provided by XMOS for my board:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
<Type>Board</Type>
    <Name>L1 USB Audio Reference Design Board</Name>

    <Declarations>
        <Declaration>core tile[1]</Declaration>
    </Declarations>
    <Packages>
        <Package Id="P1" Type="XS1-L1A-TQ128">
            <Nodes>
                <Node Id="0" Type="XS1-L1A" InPackageId="0" Oscillator="13MHz" SystemFrequency="500MHz">
                    <Boot>
                        <Source Location="SPI:bootFlash"/>
                    </Boot>
                    <Core Number="0" Reference="tile[0]">
                        <!-- SPI Ports -->
                        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO"/>
                        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS"/>
                        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK"/>
                        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI"/>
                        <!-- Standard USB Audio Ports -->
                        <Port Location="XS1_PORT_1A" Name="PORT_I2S_BCLK"/>
                        <Port Location="XS1_PORT_1C" Name="PORT_I2S_LRCLK"/>
                        <Port Location="XS1_PORT_1D" Name="PORT_I2S_DAC0"/>
                        <Port Location="XS1_PORT_1I" Name="PORT_I2S_ADC0"/>
                        <Port Location="XS1_PORT_1J" Name="PORT_MIDI_OUT"/>
                        <Port Location="XS1_PORT_1K" Name="PORT_MIDI_IN"/>
                        <Port Location="XS1_PORT_1L" Name="PORT_SPDIF_OUT"/>
                        <Port Location="XS1_PORT_1M" Name="PORT_MCLK_IN"/>
                        <Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
                    
                        <!-- USB ports -->
                        <Port Location="XS1_PORT_32A" Name="PORT_USB_RESET"/>
                    </Core>
                </Node>
            </Nodes>
        </Package>
    </Packages>
    
    <ExternalDevices>
        <Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="AT25FS010">
            <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO"/>
            <Attribute Name="PORT_SPI_SS"   Value="PORT_SPI_SS"/>
            <Attribute Name="PORT_SPI_CLK"  Value="PORT_SPI_CLK"/>
            <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI"/>
        </Device>
    </ExternalDevices>

    <JTAGChain>
        <JTAGDevice NodeId="0"/>
    </JTAGChain>
</Network>
If anyone can instert whatever lines I need in it to enable xScope it will be heavily appreciated!

Thank you!
User avatar
mon2
XCore Legend
Posts: 1849
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Fri Aug 21, 2020 3:51 pm

Hi.

Launch the IDE -> left side pane -> Examples -> Enter "xscope" in the search bar to view the many examples that should function properly. This is the best learning tool as the projects will auto-correct the project for the latest versions of the dependencies. Double-click any of the examples and proceed to Project -> Clean -> Build to test.

xscope_examples.png
You do not have the required permissions to view the files attached to this post.
Lorien
Active Member
Posts: 33
Joined: Wed May 19, 2010 9:07 am

Postby Lorien » Fri Aug 21, 2020 4:35 pm

Hello! I'll definitely try it (as it seems for me it's the only path I can take for now!)
Edit: I just found a solution to my 'problem' to which XMOS compiler is avoiding sending me errors so far... (by following your advice and load on the XMOS examples)
the lines that are working are (at least on the compilation stages):

Code: Select all

<Links>
	    <Link  Encoding="2wire" Delays="4,4" Flags="XSCOPE">
	    	<LinkEndpoint  NodeId="0" Link="X0LD"/>
	    	<LinkEndpoint  RoutingId="0x8000" Chanend="1"/>
	    </Link>
    </Links>
Document is here ... and infos I look for are posted on first page

I'll see if I'll eventually get access to the xcore but so far so good!

Thank you very much for your input!

Who is online

Users browsing this forum: No registered users and 6 guests