This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using JTAG and DSS to communicate with a DSP

Other Parts Discussed in Thread: TMS320F28035

Hello,

I am trying to develop a simple communication link between a host machine and a running DSP. I have written a JAVA application that uses DSS to read and write the memory of the DSP using the memory.readData and memory.writeData functions available in the DebugSession class. This works fine if I halt the DSP before calling these function (using target.halt()), otherwise they throw an exception. Is there a way to read and write the memory of the DSP without halting the target? I am currently targetting a simutated C6416 but our final target is the C6472 multicore DSP with a XDS100.

I have looked at RTDX which seems to be able to do what we need but it doesn't seem to be supported by the XDS100. We could consider using an XDS560 but we are running our own RTOS on the DSP and I am not sure if the RTDX functions running on the DSP will be compatible with it. Are the sources for these functions available somehow?

Another question, using a XDS100 or XDS560, is there a way for the DSP to interrupt the host via the JTAG emulator?

Thanks

  • My recommendation would be for you to use the real time access features of C647x. When this debug option in enabled, your DSS reads will be performed without halting the target.

    Earlier releases of CCSv4 did not have real time accesses enabled for C647x devices using XDS100. I checked the configuration files in the CCS 4.1 beta and confirmed it is supported in this release for XDS100. 

    For your last question, perhaps polling a target location with real time reads would suffice for your use case? If not, perhaps you could provide some additional details on what your use case is?

  • I'm now using CCSv4.01 beta in which the real-time option should be enabled. However, when I tried to set it to true I get this error: "SEVERE: Option is disabled or readonly; unable to set value."

    I use the following code to set it: "m_debugSession.options.setBoolean("AllowInterruptsWhenHalted",true);"

    I am still targetting the simulation of C6472, not real hardware. Is this option available with the simulator?

    Once we can set this option, do I need to do something with my code running on the DSP? Must I set-up the interrupts in a particular way? I could find examples on how to use the CCS GUI to use the real-time mode but I am not clear about what I need to do when I don't use the CCS GUI.  Is there documentation I have missed?

    I was asking if the DSP could interrupt the host via the JTAG emulator in case it wouldnt' be possible to poll it without halting it.

  • The real time options don't apply to simulation. They don't really make sense there as it is not "real time" anyway.

    After setting the option, you don't need to do anything special. Target accesses will occur without halting the target CPU.

    I don't think you've missed any documentation. We will be adding some material to the CCS wiki to better explain the options and how to use them.

     

  • Hi,

    Ok, thanks. I am now using the TI EVM for the C6472 instead of the simulator. It has an onboard XDS100 which I am using.

    Setting the Real-Time option doesn't seem to work with it either.

    I am calling m_debugSession.options.setBoolean("AllowInterruptsWhenHalted",true);

    And I get this error: "SEVERE: Option is disabled or readonly; unable to set value."

    Any idea?

    JP

  • Could you check two things for me:

    (1) Open the target configuration you are using in the target configuration editor. Along the bottom of the editor you'll see three tabs: Basic, Advanced, and Source. Click on the Source tab and ensure there is a line that looks like this:

    <instance XML_version="1.2" href="drivers\tixds100c674x.xml" id="drivers" xml="tixds100c674x.xml" xmlpath="drivers"/>

    (2) Next, open the file <install dir>\ccsv4\common\targetdb\drivers\tixds100c674x.xml in a text editor and ensure it has this line in it:

    <property Type="hiddenfield" Value="true" id="realtimeEnabled" />

    I want to be sure the configuration you are using has the property enabled in your install.

  • I have the following two lines that seem to match:

                <instance XML_version="1.2" href="drivers\tixds100icepick_c.xml" id="drivers" xml="tixds100icepick_c.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers\tixds100c64xp.xml" id="drivers" xml="tixds100c64xp.xml" xmlpath="drivers"/>

    tixds100icepick_c.xml doesn't seem to have anything about 'realtime;

    tixds100c64xp.xml: <property Type="hiddenfield" Value="true" id="realtimeEnabled" />

  • Just wondering if there was any progress on this issue?

    I have also tried with an XDS510 from SEED, but I get the same result.

    I have modified file seedxds510plusc6400_plus.xml to add the 'realtime' line as follows, but it doesn't work either...

    <?xml version="1.0"?>
    <drivers id="TMS320C64XX">
       <isa Type="TMS320C64XP" ProcID="0x50019348">
          <driver file="..\..\..\emulation\drivers\tixds6400_plus.dvr">
             <property Type="hiddenfield" Value="true" id="realtimeEnabled" />
             <connectionType Type="SEEDEMU"/>
          </driver>
       </isa>
    </drivers>

  • Hi,

    Can you tell me which core on the C6472 you are trying to set the real time option for? There was a bug in versions of CCS before 4.1 that only allowed the user to modify real time options on the first core of a multicore device, even if all cores supported real time mode. I think you mention you are using 4.0.1, and therefore this might be the problem you are running into.

    I don't have an older version of CCS handy to test the exact behaviour, but the expected behaviour for the bug should be:

    "Texas Instruments XDS100v1 USB Emulator_0/C64XP"

    - will allow you to set real time options via: options.setBoolean("AllowInterruptsWhenHalted",true);

    - you will also see that the option is enabled in the GUI (Right click on the core, and choose "Edit Texas Instruments XDS100v1 USB Emulator_0/C64XP" -> Target )

    "Texas Instruments XDS100v1 USB Emulator_0/C64XP_1" to "Texas Instruments XDS100v1 USB Emulator_0/C64XP_5"

    - will not allow you to set real time options via: options.setBoolean("AllowInterruptsWhenHalted",true);

    - you will also see that the option is disabled in the GUI

     

    Can you confirm if this is the bug you are seeing (by trying to set the realtime option on the first core)? If it is, I can confirm that this bug has been fixed in CCS4.1; I have tested that I can bring up the C6472 device in CCS, and I was able to set the real time options for all 6 cores.

     

    Thanks.

  • Hi,

    I am always working with the first core: 'Texas Instruments XDS100 USB Emulator_0/C64XP_0'

    I am using CCS Version: 4.1.0.01000.

    Note that I am using the CCXML file EVM6472_XDS100USB.ccxml that was installed with the EVM for C6472. This file refers to Texas Instruments XDS100 USB Emulator_0 and not Texas Instruments XDS100v1 USB Emulator_0 as you mention.

    Is this correct? I am not sure what version of the XDS100 is onboard. The board is labeled SW Rev2.0...

    I can see the Real-Time option in the CCS UI. And I can set it too. However, I am not sure whether it has any effect or not...

    Are you using the EVM for C6472?

    Thanks

  • I actually do not have the hardware, so I am only testing that CCS is allowing me to modify the real time settings for this device.

    Also note that setting it in the location I was pointing to does not actually get applied until the next debug launch. If you modify the setting under Tools -> Debugger Options -> Generic Debugger Options, it should take effect immediately, which will allow you to access the target without halting the target CPU.

     

    As for the issue you noted in DSS for setting this property, I have just discovered a bug in the DSS initialization that is preventing it from reading the <property Type="hiddenfield" Value="true" id="realtimeEnabled" /> properly from the driver XML. This will imply that the real time options will be disabled in DSS for all targets. I have filed a bug for this and will be looked at in the next few days.

    I have also created a workaround for you to try. I have attached a file, PropertiesDB.xml, to this post. This modified file will enable the real time options for all targets, including the C6472, which will allow you to modify this option in DSS. Please also note that the workaround will enable the real time options for devices that do not support it (ie; simulators), and setting this option for those targets will not have any effect.

    Please backup and replace the file in your <installDir>\ccsv4\DebugServer\propertyDB\

     

    Let me know if you have any questions on the workaround, and also let me know if the provided workaround solves the issue you are seeing.

    Thank you very much.

  • Thanks for the work-around, it solves the problem :¬)


  • Hi,

    It the work-around is not implemented with the latest release of CCS4?

    JP

  • Hi,

    The workarounds themselves have not been included in any CCS builds, since they were only meant as a temporary solution to the actual problem.

    The two problems that was noted in this thread:

    1. Real time options only accessible on the first core of a multi-core configuration.

    2. Real time options not modifiable in DSS.

    These two issues have been resolved and should be available in the latest CCS4.1.2 build.

    Thanks.

    Ricky

  • Hi Ricky,

    I have CCS4.1.2 (Code Composer Studio Core Edition  Version: 4.1.2.00027) installed on my PC and I'm trying to modify the Real time options in DSS.

    I can change the "UseLegacyStopMode", but the other real time options (AllowInterruptsWhenHalted, PoliteRealtimeMode) cause an exception, e.g. they are read only.

    debugServer = (DebugServer) env.getServer("DebugServer.1");
    debugServer.setConfig("c:/temp/C28027_XDS100.ccxml");
    debugSession = debugServer.openSession("*", "*");

    System.out.printf("1) UseLegacyStopMode = %b\n", debugSession.options.getBoolean("UseLegacyStopMode"));
    debugSession.options.setBoolean("UseLegacyStopMode", true);
    System.out.printf("2) UseLegacyStopMode = %b\n", debugSession.options.getBoolean("UseLegacyStopMode"));

    System.out.printf("1) AllowInterruptsWhenHalted = %b\n", debugSession.options.getBoolean("AllowInterruptsWhenHalted"));
    try { debugSession.options.setBoolean("AllowInterruptsWhenHalted", true); }
    catch (Exception e){ StatusText.setText("Error setting AllowInterruptsWhenHalted\n"); }
    System.out.printf("2) AllowInterruptsWhenHalted = %b\n", debugSession.options.getBoolean("AllowInterruptsWhenHalted"));

    System.out.printf("1) PoliteRealtimeMode = %b\n", debugSession.options.getBoolean("PoliteRealtimeMode"));
    try { debugSession.options.setBoolean("PoliteRealtimeMode", true); }
    catch (Exception e){ StatusText.setText("Error setting PoliteRealtimeMode\n"); }
    System.out.printf("2) PoliteRealtimeMode = %b\n", debugSession.options.getBoolean("PoliteRealtimeMode"));

    Below is the output from the above code.

    1) UseLegacyStopMode = false
    2) UseLegacyStopMode = true
    1) AllowInterruptsWhenHalted = false
    SEVERE: Option is disabled or readonly; unable to set value.
    2) AllowInterruptsWhenHalted = false
    1) PoliteRealtimeMode = false
    SEVERE: Option is disabled or readonly; unable to set value.
    2) PoliteRealtimeMode = false

    I would like to enable polite mode so I can read/write memory without having to stop the CPU first.

    It looks like the changes for real time mode didn't get in to CCS4.1.2.

    Is this correct, and if so do you know when this will be fixed?

    cheers  Chris

  • Chris,

    You are right in that the realtime mode fix was not included in CCS4.1.2. The current scope of the fix is in CCS4.2, which will be release later in the year.

    In the mean time, you can work around the issue with the attached file PropertiesDB.xml,

    - Please backup and replace the file in your <installDir>\ccsv4\DebugServer\propertyDB\

    Note: The only difference this file will make to CCS is that it will let you modify the "Enable silicon real-time mode" option for all devices, including ones that do not support the functionality.

    Let me know if you have any questions.

    Thanks.

    Ricky

  • Hi  Ricky,

    that worked fine. The only issue I found was I could only set these values after I had connected and performed a reset, eg

    debugServer = (DebugServer) env.getServer("DebugServer.1");
    debugServer.setConfig("c:/temp/C28027_XDS100.ccxml");
    debugSession = debugServer.openSession("*", "*");

    debugSession.target.connect();
    debugSession.target.reset();

    debugSession.options.setBoolean("UseLegacyStopMode", true);
    debugSession.options.setBoolean("AllowInterruptsWhenHalted", true);
    debugSession.options.setBoolean("PoliteRealtimeMode", true);

    If I set these debug options before calling connect, the connect function produced an exception.

    Thank you for your help.

    cheers Chris

  • Hi Ricky,

    after writing more of my code I'm now writing to variables on the piccolo A usb stick. But I notice that each time I changed a variable my interrupt stopped.

    I then realised that I had set UseLegacyStopMode=true which is meant to halt the CPU before memory access. So I just removed this line and then all memory writes stops.

    debugServer = (DebugServer) env.getServer("DebugServer.1");
    debugServer.setConfig("../PiccoloTarget/C28027_XDS100.ccxml");
    debugSession = debugServer.openSession("*", "*");
    debugSession.target.connect();
    debugSession.target.reset();

    //debugSession.options.setBoolean("UseLegacyStopMode", true);
    debugSession.options.setBoolean("AllowInterruptsWhenHalted", true);
    debugSession.options.setBoolean("PoliteRealtimeMode", true);

    debugSession.memory.loadProgram("../PiccoloTarget/PiccoloTarget.out");
    debugSession.target.runAsynch();

    Addr_PwmTicks = debugSession.symbol.getAddress("Gui_PwmTicks");

    debugSession.memory.writeWord(0, Addr_PwmTicks, 300);

    Then I had a look at the debug tab and saw the following errors.

     

    DEBUG:

    SEVERE: C28xx: Real-time switching could not be allowed
    SEVERE: C28xx: Real-time switching could not be allowed

    SEVERE: Errors during memory.writeData(): Address: 0x8842 Error: 0x400000
    SEVERE: Error writing memory: Errors during memory.writeData(): Address: 0x8842 Error: 0x400000

    So I think this means that while I can now set my debug options in DSS, they still don't work.

    cheers  Chris

  • Hi Ricky,

    I've just tried CCS4.1.3 and it seems real time mode still isn't working.

    I've tried the original and your suggested PropertiesDB.xml file. For each file when I try and set the "AllowInterruptsWhenHalted" it returns an error stating it's read only.

                debugSession.options.setBoolean("AllowInterruptsWhenHalted", true); //fails, see error below
                r = debugSession.options.getBoolean("AllowInterruptsWhenHalted"); //returns false

        SEVERE: C28xx: Real-time switching could not be allowed

    Is there anything I can do to get around this?

    cheer

    Chris

  • Chris,

    The DSS real-time mode fix is scheduled to be included in CCS4.2 release, and therefore is not included in the latest CCS4.1.3 build.

    As for why the workaround with the PropertiesDB.xml files not working in CCS4.1.3, I will need to investigate first. I'll update you as soon as I find out anything.

    Thanks.

    Ricky

  • Chris,

    I just re-read your post and I need to clarify with you which error message you are actually getting.

    You stated you are getting a read-only error when you try to set AllowInterruptsWhenHalted, but when you included the actual error message, it is "SEVERE: C28xx: Real-time switching could not be allowed", which is not an read-only error. The read-only error should be something like "Option is disabled or readonly; unable to set value." So, can you clarify which error you are actually getting? The other error is a driver error, and if that is the one you are getting, we have to make sure real-time mode is supported for the device/emulator you are using.

    Some additional information from my investigation you might be interested in:
    I just installed CCS4.1.3 and using the PropertiesDB.xml included in this thread, I was able to set AllowInterruptsWhenHalted after I connected to my F28035 stick via Texas Instruments XDS100v2 USB Emulator. I did notice the included PropertiesDB.xml is a little out of date, so I updated it for CCS4.1.3 if you are interested.

    This is a snippet of code I was testing:

      debugSession.target.connect();

      env.traceWrite(debugSession.options.getBoolean("UseLegacyStopMode"))  // prints false
      env.traceWrite(debugSession.options.getBoolean("AllowInterruptsWhenHalted"))   // prints false
      env.traceWrite(debugSession.options.getBoolean("PoliteRealtimeMode"))   // prints true
      debugSession.options.setBoolean("AllowInterruptsWhenHalted",true)
      debugSession.options.setBoolean("PoliteRealtimeMode",false)
      env.traceWrite(debugSession.options.getBoolean("AllowInterruptsWhenHalted"))  // prints true
      env.traceWrite(debugSession.options.getBoolean("PoliteRealtimeMode"))  // prints false

    Thanks.

    Ricky

  • Hi Ricky,

    When I used the installed PropertiesDB.xml I get

    debugSession.options.setBoolean("AllowInterruptsWhenHalted",true) -> "SEVERE: Option is disabled or readonly; unable to set value." and causes an exception to occur.

    When I use your new PropertiesDB.xml I get

    debugSession.options.setBoolean("AllowInterruptsWhenHalted",true) -> "SEVERE: C28xx: Real-time switching could not be allowed."  env.traceWrite(debugSession.options.getBoolean("AllowInterruptsWhenHalted"))  // prints FALSE

    So I'm guessing I have a driver error??

    My setup is as follows:

    • F28035 stick
    • CCS4.1.3
    • XDS100v2 emulator
    • docking station (with onboard XDS100v1 disabled)
    • xsd100.ccxml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <configurations XML_version="1.2" id="configurations_0">
    <configuration XML_version="1.2" id="Texas Instruments XDS100v2 USB Emulator_0">
            <instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Emulator_0" href="connections\TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Emulator_0" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
            <connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Emulator_0">
                <instance XML_version="1.2" href="drivers\tixds100v2c28x.xml" id="drivers" xml="tixds100v2c28x.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers\tixds100v2cla.xml" id="drivers" xml="tixds100v2cla.xml" xmlpath="drivers"/>
                <platform XML_version="1.2" id="platform_0">
                    <instance XML_version="1.2" desc="TMS320F28035_0" href="devices\f28035.xml" id="TMS320F28035_0" xml="f28035.xml" xmlpath="devices"/>
                </platform>
            </connection>
        </configuration>
    </configurations>

    Is there any extra information I can extract to see why my driver doesn't think real time is enabled?

    cheers

    Chris

  • Hi Ricky,

    I used a clean XP pc and installed CCS4.1.3 (and used your PropertiesDB.xml) with netbeans for java development.

    I found that when I ran your test code without any breakpoints it did print true for "AllowInterruptsWhenHalted". But if I single steped over the code it came back false. This is how I was debugging it before. If you single step your test code does it still print true?

    When I ran my code (without any breakpoints so AllowInterruptsWhenHalted==true) I then found when I accessed memory I got the following errors

    debug:
    Have no FileObject for C:\Program Files\Java\jdk1.5.0_14\jre\lib\i18n.jar
    Have no FileObject for C:\Program Files\Java\jdk1.5.0_14\jre\lib\sunrsasign.jar
    Have no FileObject for C:\Program Files\Java\jdk1.5.0_14\jre\classes
    SEVERE: C28xx: Real-time switching could not be allowed

    SEVERE: C28xx: Real-time switching could not be allowed

    SEVERE: Errors during memory.writeData(): Address: 0x8ac7 Error: 0x400000
    SEVERE: Error writing memory: Errors during memory.writeData(): Address: 0x8ac7 Error: 0x400000

    When I use CCS4 to debug some target code I can set "enable silcon real-time mode" and "enable polite real-time mode" without any problem.

    cheers Chris

  • Chris,

    Thanks for the test case. I did not try out any more scenarios than reading/writing to the option, since I am mainly responsible for the PropertiesDB component; but I can try out your use case and see if I can reproduce it or not. I'll let you know if I find more information.

    Regards,

    Ricky

  • Chris,

    I think I figured out what the problem is. In CCS, when you send the real-time option "Enable silicon real-time mode", you get the following dialog:

    But DSS cannot represent the dialog in your script, and therefore it will default to the choice "No" for the dialog, and therefore, the option does not get applied.

    There are two workarounds:

    1. Set ST1 bit 1 to 0 first before setting the option:

    var st1Val = debugSession.memory.readRegister("ST1");
    var st1ValMod = st1Val & ~2;
    debugSession.memory.writeRegister("ST1",st1ValMod);

    2. Use DSS to modify the default choice of dialogs:

    debugSession.setDefaultDialogResponse("Yes");

     

    Let me know if it works for you or not.

    Thanks.

    Ricky

  • Hi Ricky,

    your are a genius ;-) It now kinda works. There are some restrictions..

    1) This doesn't work, it still gives an error.

    st1Val = debugSession.memory.readRegister("ST1"); //2571
    st1ValMod = st1Val & ~2; //2569
    debugSession.memory.writeRegister("ST1",st1ValMod);debugSession.options.setBoolean("AllowInterruptsWhenHalted",true);
    SEVERE: C28xx: Real-time switching could not be allowed

    2) This does seem to work

    debugSession.setDefaultDialogResponse("Yes");

    3) The order of debugsession command are important, eg

    debugServer = (DebugServer) env.getServer("DebugServer.1");
    debugServer.setConfig("../PiccoloTarget/C28027_XDS100.ccxml");
    debugSession = debugServer.openSession("*", "*");
    debugSession.target.connect();
    debugSession.target.reset();
    debugSession.memory.loadProgram("../PiccoloTarget/PiccoloTarget.out");

    // the next 4 lines must be called after loadProgram
    //Otherwise getAddress fails
    debugSession.setDefaultDialogResponse("Yes");

    debugSession.options.setBoolean("UseLegacyStopMode",false);
    debugSession.options.setBoolean("AllowInterruptsWhenHalted",true);

    //This must also be set to true for memory read/writes to work.
    debugSession.options.setBoolean("PoliteRealtimeMode",true);

    debugSession.target.runAsynch();
    Addr = debugSession.symbol.getAddress("Gui_A");
    debugSession.memory.writeWord(0, Addr, 0x55);
    value = debugSession.memory.readWord(0, Addr);

    Thank you very much for your help.

    cheers Chris

  • I have just started using CCS  Version: 4.2.1.00004  and I have found that our code will work only with the patched version of PropertiesDB.xml mentioned above.

    It seems that the 4.2 release does not include the necessary fix. Is this so or has there been another change that prevents our code from working?

     

  • Peter,

    Can you let me know what exactly is not working (ie; what connection/board you are using, what you are doing in your scripting, what is the error message)? We discussed a few different problems in this thread, and I want to make sure I am addressing the correct one.

    As a simple test, I was able to set the realtime option (AllowInterruptsWhenHalted) on a F28035/XDS100 on CCS4.2.0, so I expect the various fixes to be in the CCS4.2.1 build.

    Thanks.

    Ricky

  • The problem has been resolved.

    I had installed CCS 4.2 from the disc supplied with the EVM6474L. This installation came up with an error (the problem has been reported to eInfochips) which appeared to have nothing to do with CCS directly and seemed to leave it working. After many strange problems (including the PropertiesDB.xml issue and the abject failure of on-line software updates), I decided to remove that installation of CCS 4.2 and use a direct download from the TI site. This installed without error and seems to be working. The PropertiesDB.xml file included in that release does allow memory access without halting the processors.

    Thank you for your investigation.