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.

CCS/TMDX654IDKEVM: IPC ping example

Part Number: TMDX654IDKEVM
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi All,

I am trying to upload and execute the ex11_ping example for the AM65X with BIOS. The example is located within C:\ti\ipc_3_50_03_05\examples\AM65XX_bios_elf. The following is true for my setup:

- CCS 910

- ipc_3_50_03_05

- pdk_am65xx_1_0_5

- processor_sdk_rtos_am65xx_6_00_00_07

Firsty, I am just attempting to upload the output binaries (built from the makefiles) onto the A53, R5f_0 and R5F_1 of the EVM, and execute it just in order to observe the expected output. For this, I know that the R5 core should be in split mode. I thus added the following line to my launch.js file:

...

...

// Connect targets
    dsDMSC_0.target.connect();
	
	//Add this to configure R5 cores in split mode
	dsDMSC_0.expression.evaluate("Change_MCUSS_to_SplitMode()");
	
    print("Loading DMSC Firmware...");

...

...

Now I can successfully upload the output binaries to the A53 and R5F_0 cores and the cores halts at the main() functions. However, when attempting to upload the output binaries onto the R5F_1 core, the core immediate goes into the "Suspended" state after the binaries have been uploaded, with some xdc error functions running:

A cant find source error is also displayed:

What can be the cause of this error? I have not yet rebuilt the IPC examples, thus the output binaries came standard with the IPC component installation. I believe the error may be with incorrect board initialization and setup? Otherwise it might be incompatible versions of XDCtools/PDK/IPC etc. Could anyone please assist? Unfortunately there is only reference for uploading this example on the AM537X IDK, which I have referred to.

I then tried to import the source of the examples into a CCS project, and tried to get it building from there (I did this successfully with the MessageQ example). This would be the ideal way to go rather than the makefiles. With this method I get all three cores to build successfully, however,I have only been successful in uploading the A53 core output onto the EVM. When uploading the output binaries onto the R5F_0 and R5F_1 cores, the application simply executes immediately and never halts at the main() function. Thus I seem to not be able to configure my project correctly for these cores. Is it possible for someone to prepare a CCS project for this example, so that this can be used as baseline for development of our IPC application? Otherwise, please advise as to what might be the cause of the core never halting at main?

Here are some steps I applied to get the project to build from within CCS:

- Imported all the .c, .h, .cmd, and .cfg files related to the specific cores into a CCS project specific to that core. I also imported the files located it the "shared" folder of the example

-added profile="debug" as cfgArgs at Project Properties->XDCtools->Advanced options

- changed the include declarations to include the header files from the correct dictory ( #include "SvrMsg.h" instead of #include "..Shared/SvrMsg.h" for example)

- within the shared configuration file, I commented out the proclist.toUpperCase.split() command, and rather defined the array manually:

/* configure processor names */
//var procNameAry = MultiProc.getDeviceProcNames();
var procNameAry = [ "HOST","R5F-0", "R5F-1" ];
//var procNameAry = cfgArgs.procList.toUpperCase().split(/\s+/);

From here the projects builds successfully, however uploading and execution fails (The MessageQ example however executes successfully). Here I have also attached the CCS projects I have managed to create thus far, with successful build:

IPC_ping_example.zip

Any assistance would be greatly appreciated.

Regards,

Johnny

  • Hi Johnny,

    Please make sure you are using the versions of XDCtools, SYSBIOS, and IPC that come bundled with Processor SDK RTOS. 

    For converting to CCS projects, I recommend looking at the makefile in ~\ipc_3_50_03_05\examples\AM65XX_bios_elf\ex11_ping\r5f-x to see what compiler/linker options need to be added to the project. For example, you can see on line 72 that the platform needs to be ti.platforms.cortexR:AM65X.

    Additionally, please refer to the following guide for running the IPC examples on AM65xx if you haven't already.

    Run IPC Examples on AM65XX

    Regards,
    Sahin

  • Hi Sahin,

    Thanks, I appreciate your reply, however I do not think you are answering my inititial question regarding the prebuilt R5F_1 core output binaries that cannot upload and executed successfully on the R5_1 core (I can upload, but execution is not good as you can see in the initial post). The prebuilt binaries for the A53 core and R5_0 core however uploads and executes successfully. Thus I believe there is a mistake with the initialization of my EVM for the R5F_1 core somewhere, which I can not figure out. Is there other scripts I should execute to configure the EVM? I am also booting in no boot mode (all switches OFF).

    The link you provded to run IPC examples on the AM65X, I have studied before already, however that only illustrates how to run the MessageQ example on the R5F_0 core, which as stated, I can execute successfully. I can also import that example into CCS and successfully build and execute it from there. However, there is now explanation of how to upload execute the example on the R5F_1 core, which I cannot do successfully.

    Then regarding the ex11_ping build from CCS, yes I have studies the makefiles and looked at all linkage/compiler settings. I have tried to include all settings within the CCS build, however I have not yet had much success thus far, which is why I created this thread after a few hours of no progress.

    I hope you can assist further with getting the prebuilt binaries uploaded and executed onto the R5_1 core, as well as try and identify where my linkage is wrong for the CCS build. In the meantime I am also investigating the CCS build.

    Kind regards,

    Johnny

  • Hi Sahin,

    Found the linkage error in my CCS project. My project was setup as debug version, however it appears as if it should be set to the release version. It can now upload onto the R5_0 core successfully.

    However, I am still unsuccessful with uploading the binaries on the R5_1 core. The output goes straight to the abort() function after uploading it onto the core:

    This is why I believe there is an error with my EVM initialization, seeing that both the prebuild binaries and my CCS build output cannot execute successfully on R5_1

  • Hi Johnny,

    I should have read your post more thoroughly - sorry about that. 

    It appears you're performing the steps correctly to get the code running on the R5F-1 core. I suspect this may be a bug on our end but I don't have access to my AM65x EVM today so I can't reproduce this issue just yet to confirm. 

    There was a bug reported in the thread below where the R5F-1 core was hanging after loading and running the IPC Linux example. I'm not sure if this bug is related to the issue you're seeing, but this bug was fixed in the 6.1 release so it might be worth trying with the 6.1 version.

    https://e2e.ti.com/support/processors/f/791/t/834165

    If that doesn't work, can you please open ROV in CCS (Tools > ROV Classic) after the program has aborted and open LoggerBuf and paste the logs here?

    I'm going to try to reproduce this on my EVM tomorrow, but if I'm unable to get to it I won't be able to look at this again until early next week due to the U.S holiday. I apologize for any inconvenience. 

    Regards,
    Sahin

  • Hi Johnny,

    Just wanted to give you a quick update - I was able to reproduce this issue on my board. I'm currently working on getting workaround/fix for you and should have an update for you soon. I appreciate your patience.

    Regards,
    Sahin

  • Johnny,

    You will need to add the function "Change_MCUSS_to_SplitMode" to launch.js so that the R5Fs can be changed to split mode before loading the DMSC firmware and connecting to R5F-0. Please see the code snippet of launch.js with this fix below.

    // Connect targets
    dsDMSC_0.target.connect();
    // Add switch to split mode 
    dsDMSC_0.expression.evaluate("Change_MCUSS_to_SplitMode()");
    print("Loading DMSC Firmware...");
    // Load the DMSC firmware
    dsDMSC_0.memory.loadRaw(0, 0x40000, thisJsFileDirectory +"/../../soc/V0/ti-sci-firmware-am65x-gp.bin", 32, false);

    I'm also attaching my launch.js below.

    launch.js
    /*
     * Copyright (c) 2017-2018, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    //
    //File Name: launch_am65xx.js
    //Description:
    //   Launch the DMSC firmware and board configuration from R5F.
    //
    //Usage:
    //
    //From CCS Scripting console
    //  1. loadJSFile "C:\\ti\\launch_am65xx.js"
    //     <Ignore the error observed on the CCS scripting console
    //     "Wrapped java.io.IOException: The handle is invalid (<location_of_script>\
    //     launch_am65xx.js#93)">
    //
    //Note:
    //  1. Search for "edit this" to look at changes that need to be edited
    //     for your usage.
    //
    
    
    //<!!!!!! EDIT THIS !!!!!>
    // Set this to 1 to allow loading the GEL files directly from the ccxml file.
    disableGelLoad = 1;
    if (disableGelLoad == 0)
    {
        //Path to GEL files
        gelFilePath = "C:/ti/ccsv8/ccs_base/emulation/boards/am65x/gel/";
    }
    // Path to the directory in which this file would be residing. CCS expects
    // absolute paths to load the binaries.
    thisJsFileDirectory = "C:/ti/am65xx-6.1/pdk_am65xx_1_0_6/packages/ti/drv/sciclient/tools/ccsLoadDmsc";
    //<!!!!!! EDIT THIS !!!!!>
    
    // Import the DSS packages into our namespace to save on typing
    importPackage(Packages.com.ti.debug.engine.scripting)
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    importPackage(Packages.java.lang)
    importPackage(java.io);
    importPackage(java.lang);
    
    function updateScriptVars()
    {
        //Open a debug session
        dsMCU1_0 = debugServer.openSession( ".*MCU_PULSAR_Cortex_R5_0" );
        dsDMSC_0 = debugServer.openSession( ".*DMSC_Cortex_M3_0" );
    }
    
    function printVars()
    {
        updateScriptVars();
    }
    
    function connectTargets()
    {
        /* Set timeout of 20 seconds */
        script.setScriptTimeout(20000);
        updateScriptVars();
        sysResetVar=dsDMSC_0.target.getResetType(1);
        sysResetVar.issueReset();
        print("Connecting to DMSC_Cortex_M3_0!");
        if (disableGelLoad == 0)
        {
            // Load the GEL. This can be removed if the GEL is already linked with the target ccxml
            dsDMSC_0.expression.evaluate('GEL_LoadGel("'+gelFilePath+'/AM65xEVM.gel")');
        }
        // Connect targets
        dsDMSC_0.target.connect();
    	// Add switch to split mode 
        dsDMSC_0.expression.evaluate("Change_MCUSS_to_SplitMode()");
        print("Loading DMSC Firmware...");
        // Load the DMSC firmware
        dsDMSC_0.memory.loadRaw(0, 0x40000, thisJsFileDirectory +"/../../soc/V0/ti-sci-firmware-am65x-gp.bin", 32, false);
        print("DMSC Firmware Load Done...");
        // Set Stack pointer and Program Counter
        stackPointer = dsDMSC_0.memory.readWord(0, 0x40000);
        progCounter = dsDMSC_0.memory.readWord(0, 0x40004);
        dsDMSC_0.memory.writeRegister("SP", stackPointer);
        dsDMSC_0.memory.writeRegister("PC", progCounter);
        print( "DMSC Firmware run starting now...");
        // Run the DMSC firmware
        dsDMSC_0.target.runAsynch();
        print("Connecting to MCU Cortex_R5_0!");
    
        // Connect the MCU R5F
        dsMCU1_0.target.connect();
        if (disableGelLoad == 0)
        {
            // Load the GEL. This can be removed if the GEL is already linked with the target ccxml
            dsMCU1_0.expression.evaluate('GEL_LoadGel("'+gelFilePath+'/M4_DDR39SS/M4_R5orA53_Startup.gel")');
        }
    	print("Running the board configuration initialization from R5!");
        // Load the board configuration init file.
        dsMCU1_0.memory.loadProgram(thisJsFileDirectory +"/am65xx/sciclient_ccs_init_mcu1_0_release.xer5f");
        // Halt the R5F and re-run.
        dsMCU1_0.target.halt();
        dsMCU1_0.target.reset();
        dsMCU1_0.target.restart();
        // Run Synchronously for the executable to finish
        dsMCU1_0.target.run();
    }
    
    function disconnectTargets()
    {
        updateScriptVars();
    
        // Disconnect targets
        dsDMSC_0.target.disconnect();
        // Reset the R5F to be in clean state.
        dsMCU1_0.target.reset();
    	print("Initializing DDR!");
        // Execute DDR initialization script from R5F.
        try
        {
            dsMCU1_0.expression.evaluate("DDR4_800MHz_Initialization_for_EVM()");
    		dsMCU1_0.expression.evaluate("timer0_cleanup()");
        }
        catch(e)
        {
            print("Some error in GEL execution for DDR4_CONFIG");
        }
    }
    
    function doEverything()
    {
        printVars();
        connectTargets();
        disconnectTargets();
    }
    
    var ds;
    var debugServer;
    var script;
    
    // Check to see if running from within CCSv4 Scripting Console
    var withinCCS = (ds !== undefined);
    
    // Create scripting environment and get debug server if running standalone
    if (!withinCCS)
    {
        // Import the DSS packages into our namespace to save on typing
        importPackage(Packages.com.ti.debug.engine.scripting);
        importPackage(Packages.com.ti.ccstudio.scripting.environment);
        importPackage(Packages.java.lang);
    
        // Create our scripting environment object - which is the main entry point into any script and
        // the factory for creating other Scriptable ervers and Sessions
        script = ScriptingEnvironment.instance();
    
        // Get the Debug Server and start a Debug Session
        debugServer = script.getServer("DebugServer.1");
    }
    else // otherwise leverage existing scripting environment and debug server
    {
        debugServer = ds;
        script = env;
    }
    
    doEverything();
    
    

    I will submit documentation feedback to address this. I apologize for any inconvenience. 

    Regards,
    Sahin

  • Hi Sahin,

    As you can note in my very first post in this thread, I have already added the function "Change_MCUSS_to_SplitMode". Without that, you cannot even connect to the R5_1. My problem occurs after uploading the binaries onto the R5_1 core, that the program does not halt at main() and rather goes to the abort() functon.

    Can you successfully load the binaries onto the R5_1 core such that it halts at main()? Can you execute the complete ping example with all three cores' binaries uploaded?

    If so, what Processor SDK RTOS version are you using? I also noted from your launch.js file that you are using a different PDK version than me, so I will try installing the Processor SDK RTOS version you have and test if that changes anything.

    Kind regards,

    Johnny

  • Hi Johnny,

    Ah I see. I was calling the "Change_MCUSS_to_SplitMode" function AFTER connecting to R5F-0 via the CCS scripts menu. This method resulted in the same abort error you were getting. I didn't realize you were already hard-coding it, sorry about that once again!

    I successfully ran the ex11_ping example using Processor SDK RTOS v6.1. Please try with this version and let me know how it goes. It can be downloaded from here: http://software-dl.ti.com/processor-sdk-rtos/esd/AM65X/latest/index_FDS.html

    Regards,
    Sahin