Headset noise when printing

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
akp
XCore Expert
Posts: 579
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

OK. JTAG I/O server is much slower than xscope I/O, and stops the core for a substantial length of time. You will need to rebuild your whole project for the xscope to work, and you might need to try some other things. You definitely should never use JTAG I/O server in a real time application.

I also noted an error in my config.xscope that I have corrected in my previous post. That might help you.


User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

I wish I'd get this to work. But I don't. I use xTIMEcomposer 14.4.1 on a mac mini from 2010 on macOS Sierra 10.12.6 through a virtual screen on a newer machine. The 14.4.1 likes it there, no fuzz. I bought that old machine just for that usage. I was tired of fighting with outdated Java. I will proceed with the newer development platform one of these days.

I have now done complete rebuilds with different configs, including yours of course, and it's only the JTAG server that greets me with results from prints in the code. Else the screen is blank.

Here is my config-xscope (with remains from some I/O)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xSCOPEconfig ioMode="none" enabled="true">
    <Probe name="VALUE" type="CONTINUOUS" datatype="INT" units="VAL" enabled="true"/>
</xSCOPEconfig>
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
akp
XCore Expert
Posts: 579
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

Refer to https://www.xmos.com/download/xTIMEcomp ... (14_x).pdf Sec 25 (Debug with printf in real-time). It is clear that JTAG will not allow real time operation.

Here are three other things to look at to see if you can get it working:

1. Per Para 25.2, ensure to add the option -fxscope in your build flags.

2. Ensure your xn file supports xscope. Here is an example from my xn file showing the Nodes and Links section that works for me. You might need something a little different.

Code: Select all

  <Nodes>
    <Node Id="2" Type="device:" RoutingId="0x8000">
      <Service Id="0" Proto="xscope_host_data(chanend c);">
        <Chanend Identifier="c" end="3"/>
      </Service>
    </Node>
  </Nodes>
  <Links>
    <Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
      <LinkEndpoint NodeId="0" Link="0"/>
      <LinkEndpoint NodeId="2" Chanend="1"/>
    </Link>
  </Links>
The way I understand this, it adds a NodeId 2 in addition to the NodeId 0 which is my processor. I believe this NodeId 2 is actually my xtag. And I set up a link to the xtag to send characters using 2 wire xCONNECT.

You can also refer to https://www.xcore.com/viewtopic.php?t=7970 to see if you can get your xscope working with an example program -- and you can try different boards if you have them -- before getting it working in your application.

3. You can check if your xCONNECT wires are too long. I use an adapter cable from the big 20 pin xSYS connector to a much smaller connector on my board. However, if that cable is too long (longer than about 5 cm) then the xscope output will not work.

If all of this doesn't get you working with xscope output, you should most likely just disable printf output unless you need it for some very specific debugging.
User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

Thank you akp, thank you!

It might read 2024 before this is treated. A long thread gets longer, fine!

I am very interested to get this up and running! Very.

Øyvind
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

I now got the XScope output server to run. "Run XScope output server" ticked on, plus the stuff mentioned above.

Strange, because I still get the strange sounds during printing, which I think is from the TDM inputs from mic or the headset, where the mic chip or the haadset DAC invent values when time is not met. Just a hypothesis.

Plus I see this, but it may not be relevant:
When I print out text and 16 non-const numbers, expanding to 80 chars, I still get about 250 ms halt on the scope.
This is with lib_logging.
xTAG3 and xCORE-200 eXplorer board.
xTIMEcomposer 14.4.1

Is there a way to tell whether I _really_ run that server? By looking at the Activty monitor (macOS) or some terminal command?
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
Pickron
Newbie
Posts: 1
Joined: Mon Apr 22, 2024 10:01 am

Post by Pickron »

I have now done complete rebuilds with different configs, including yours of course, and it's only the JTAG server that greets me with results from prints in the code. Else the screen is blank.
__________
https://www.seppermotor has a rich product line, and each motor has its own unique advantages and characteristics, which can meet the needs of different customers and different applications.
User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

Are you indicating that the JTAG server (for xTIMEcomposer 14.4.1) seems to be always running, even if I tell it to use the XScope output server?
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
akp
XCore Expert
Posts: 579
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

One thing I see different is my config.xscope has ioMode="basic" whereas yours is "none"
User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

I have tested. I am running this and then scoping it on a real scope. See attached.

For me iomode="basic" prints nothing and printing 100 packets takes hugely longer time than one packet of the same print.

Chan 3 (blue) on the scope's screen clips.

Using lib_logging.

By the way, my headset noise is gone since I moved an I2C port to tile[1].

Code: Select all

void test_xscope_iomode (
    unsigned            &po_4X_scope_val,
    out buffered port:4 po_4_scope_a)
{
    /* 
    === In xTIMEcomposer 14.4.1 debugger:
        XTAG-3
        "Run XScope output server"
    === In config.xscope 
        <xSCOPEconfig ioMode="none" enabled="true">
                            "basic" no prints
    === In XCORE-200-EXPLORER.xn
        <Nodes>
            <Node Id="2" Type="device:" RoutingId="0x8000">
            <Service Id="0" Proto="xscope_host_data(chanend c);">
                <Chanend Identifier="c" end="3"/>
            </Service>
            </Node>
        </Nodes>
        <Links>
            <Link Encoding="2wire" Delays="4,4" Flags="XSCOPE">
            <LinkEndpoint NodeId="0" Link="XL0"/>
            <LinkEndpoint NodeId="2" Chanend="1"/>
            </Link>
        </Links>
    */
    po_4X_scope_val xor_eq 0x04; // Toggle BIT3 is J1.51 (D08)
    po_4_scope_a <: po_4X_scope_val;

    // TIME 0 ms 
    
    for (unsigned ix=0; ix<100; ix++) {
        debug_print ("%u%s", ix, (((ix+1)%25)==0) ? "\n" : " ");
    }

    po_4X_scope_val xor_eq 0x04; // Toggle BIT3 is J1.51 (D08)
    po_4_scope_a <: po_4X_scope_val;

    // TIME +5.38 sec (ioMode="none")(100 packets) See "..323.png" v09540
    // TIME +512  us  (ioMode="basic")(no print)   See "..325.png" v09540

    const char print_str[] = // Same as it prints out above
        "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24\n"
        "25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\n"
        "50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74\n"
        "75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99\n";
    
    debug_print ("%s", print_str);

    po_4X_scope_val xor_eq 0x04; // Toggle BIT3 is J1.51 (D08)
    po_4_scope_a <: po_4X_scope_val;

    // TIME +50 ms (ioMode="none")(probably only one packet) See "..324.png" v09540
    // TIME +68 us (ioMode="basic")(no print)                See "..326.png" v09540
}
Last edited by aclassifier on Tue Apr 23, 2024 9:59 am, edited 1 time in total.
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
aclassifier
Respected Member
Posts: 487
Joined: Wed Apr 25, 2012 8:52 pm

Post by aclassifier »

I did add the screen clips, but I didn't see them, so I add them here again. 3 of 4 here:
2024 04 23 10.02 v09540 xscope iomode none test_xscope_iomode SDS00323.png
2024 04 23 10.02 v09540 xscope iomode none test_xscope_iomode SDS00324.png
2024 04 23 10.31 v09540 xscope iomode basic test_xscope_iomode SDS00325.png
You do not have the required permissions to view the files attached to this post.
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/