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.

AM2434: AM243x

Part Number: AM2434
Other Parts Discussed in Thread: CCSTUDIO,

Tool/software:

Hi there,

How can I download application to the RAM of the second sitara AM243x. I have two AM243x in the daisy chain configuration to XDS110v2. I can download application to the first one.
Then I used a modified target configuration (set as active configuration). However, I cannot connect to the second via jtag. 
Best,
Jinlong

  • I have some problem to update the target configuration file, which I set as active configuration  and bypasses all items for the first sitara am243x wherever possible. 

  • Hi Shen,

    Please make sure you have bypassed the first AM243x SOC and are trying to connect with second AM243x SOC. 

    Also make sure the second AM243x SOC is initialized properly with SBL binaries and the boot mode configurations are also correct.

    Please refer TROUBLESHOOT_ISSUES

    Regards,

    Tushar

  • Hi Tushar,

    I can connect to sitara-2 (the second and last in daisy chain configuration). I adapted ccs scripts since it needs to find the file on my computer and needs to connect to the r5f0-0 which is r50_2 in the target configuration file.

    Here is the command and output on js console: (I did not specify the serial number)

    js:> loadJSFile "/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk/tools/ccs_load/am243x/load_dmsc_hsfs_sitara2.js"
    sdkPath: /home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk
    [OK] File /home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk/tools/ccs_load/am243x/sciclient_ccs_init.release.out found !!!
    Connecting to sitara-2 MCU Cortex_R5_0!
    Writing While(1) for R5F
    Running the board configuration initialization from R5!
    Error loading "/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk/tools/ccs_load/am243x/sciclient_ccs_init.release.out": Timed out after 20000ms while waiting for target to halt after an auto-run to "main (/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk/tools/ccs_load/am243x/load_dmsc_hsfs_sitara2.js#118)



    Here is the script.


    Please refer to my message before this message. Here is the ccs script that I adapted:

    function updateScriptVars()
    {
    //Open a debug session
    dsMCU2_0 = debugServer.openSession( ".*MAIN_Cortex_R5_0_2" );
    }

    function connectTargets()
    {
    /* Set timeout of 20 seconds */
    script.setScriptTimeout(20000);
    updateScriptVars();

    //Init_M4()
    print("Connecting to sitara-2 MCU Cortex_R5_0!");

    // Connect the MCU R5F
    dsMCU2_0.target.connect();

    dsMCU2_0.memory.fill(0x78000000, 0, 0x2000, 0);
    print("Writing While(1) for R5F")
    dsMCU2_0.memory.writeWord(0, 0x78000000, 0xE59FF004); /* ldr pc, [pc, #4] */
    dsMCU2_0.memory.writeWord(0, 0x78000004, 0x38); /* Address 0x38 */
    dsMCU2_0.memory.writeWord(0, 0x78000038, 0xEAFFFFFE) /* b #0x38 */

    // Halt the R5F and re-run.
    dsMCU2_0.target.halt();

    // Reset the R5F and run.
    dsMCU2_0.target.reset();

    print("Running the board configuration initialization from R5!");
    // Load the board configuration init file.
    dsMCU2_0.memory.loadProgram(ccs_init_elf_file);

    // Halt the R5F and re-run.
    dsMCU2_0.target.halt();
    // Run Synchronously for the executable to finish
    dsMCU2_0.target.run();

    return 0;
    }

    function disconnectTargets()
    {
    updateScriptVars();
    // Reset the R5F to be in clean state.
    dsMCU2_0.target.reset();
    }

    function doEverything()
    {
    var run = true;

    if(!File(ccs_init_elf_file).isFile())
    {
    print("[ERROR] File "+ccs_init_elf_file+" not found !!!");
    run = false;
    }
    else
    {
    print("[OK] File "+ccs_init_elf_file+" found !!!");
    }

    if(run == true)
    {
    updateScriptVars();
    var connectSuccess = connectTargets();
    if(connectSuccess == 0)
    {
    disconnectTargets();
    print("Happy Debugging!!");
    }
    }
    else
    {
    print("Please read the instructions at top of this file to make sure the paths to the SDK are set correctly !!!")
    }
    }

    // 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);

    var ds;
    var debugServer;
    var script;

    // Check to see if running from within CCSv4 Scripting Console
    var withinCCS = (ds !== undefined);

    var sdkPath = null;

    if (!withinCCS)
    {
    // !!! EDIT THIS !!! Add absolute path to SDK in your environment variables
    // OR set this variable to the absolute path of the SDK
    sdkPath = "/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk";
    }
    else
    {
    sdkPath = System.getenv("MCU_PLUS_SDK_AM243X_PATH");
    if(sdkPath == null)
    {
    // !!! EDIT THIS !!! Add absolute path to SDK in your environment variables
    // OR set this variable to the absolute path of the SDK
    sdkPath = "/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk";
    }
    print("sdkPath: "+sdkPath);
    }

    // path to board config elf
    ccs_init_elf_file = sdkPath+"/tools/ccs_load/am243x/sciclient_ccs_init.release.out";

    // !!! EDIT THIS !!! Add absolute path to the CCXML file here.
    fileCcxml = "/home/shenj23/ti/AM2434_ALX.ccxml"

    // 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");

    // Check if the CCXML file exists.
    if(!File(fileCcxml).isFile())
    {
    print("[ERROR] File "+fileCcxml+" not found !!!");
    print("Seems like the script is not run from within CCS. Please edit the load_dmsc_hsfs.js script to add a path to your CCXML configuration file in this case.")
    }
    else
    {
    debugServer.setConfig(fileCcxml);
    doEverything();
    }
    }
    else // otherwise leverage existing scripting environment and debug server
    {
    debugServer = ds;
    script = env;
    doEverything();
    }

     

    Best,

    Jinlong

  • Hi Jinlong,

    Can you please try once changing the serial number with the serial number of JTAG device you want to connect?

    Please refer below image.

    Regards,

    Tushar

  • Yes, I tried.

    shenj23@u22 ~ $ /home/shenj23/ti/ccs1281/ccs/ccs_base/common/uscif/xds110/xdsdfu -e

    USB Device Firmware Upgrade Utility
    Copyright (c) 2008-2019 Texas Instruments Incorporated. All rights reserved.

    Scanning USB buses for supported XDS110 devices...


    <<<< Device 0 >>>>

    VID: 0x0451 PID: 0xbef3
    Device Name: XDS110 Probe with CMSIS-DAP
    Version: 3.0.0.32
    Manufacturer: Texas Instruments
    Serial Num: NOserial
    Mode: Runtime
    Configuration: Standard

    Found 1 device.

    Since there is only one jtag device - I am not setting the serial number. Should I use xdsdfu to set serial number, which I find on backside of the jtag device.



  • Hi Jinlong,

    Error loading "/home/shenj23/ti/motor_control_sdk_am243x_09_02_00_09/mcu_plus_sdk/tools/ccs_load/am243x/sciclient_ccs_init.release.out": Timed out after 20000ms while waiting for target to halt after an auto-run to "main

    I can see you are getting an error to load the sciclient_ccs_init.release.out binary to R5F core. Are you able run the script without error on first AM243x SOC?

    Regards,

    Tushar

  • Yes, I have it repeatedly working with TI AM243-LP. It always works with sitara-1, the first target in daisy chain.

  • It is my end of day. 

    The result above is obtained in the debug view, where target is R5 0_2 (which is r5f core 0-0 0f sitara-2).

    I repeated it in a different way.
    I use the target Config file for daisy chain where sitara-1 is bypassed and sitara-2 not bypassed

    DIRECTLY in load_dmsc_hsfs_sitara2.js (a different version of this same named file)
    This way, I directly executed the script in script console: see output on bottom right. I am not trusting the output - although gui showed that the soc initialization binary was being downloaded to target, I never saw it executed. 

    I then downloaded led example to r5f-core0-0 by adapting the same script (just replaced the binary in the same script) and led is not blinking on sitara-2 while it should be.


    Sitara-1 is always working.

  • Hi Jinlong

    I then downloaded led example to r5f-core0-0 by adapting the same script (just replaced the binary in the same script) and led is not blinking on sitara-2 while it should be.

    The output of the script looks okay. Have you also seen some logs coming on the CCS console?

    Also can you please tell, by gpio_led not working do you mean the example does not execute? Are you seeing any error messages?

    Please share error logs if any. Or is it just the led not blinking?

    Regards,

    Tushar

  • This is the console output:
    MAIN_Cortex_R5_0_2: GEL Output: CPU reset (soft reset) has been issued through GEL.

    I made some progress in-between. My program apparently is successfully loaded to RAM of sitara-2.
    However, run() seems not working.

    // Halt the R5F and re-run.
    dsMCU2_0.target.halt();
    // Run Synchronously for the executable to finish
    dsMCU2_0.target.run();

    I am checking disassembly and entry function. c_init00? 

    About led, it is the next step which is being used as extra experimental method to check if soc initialization has worked. With the progress aforementioned, we can forget led for now. 

  • Hi Jinlong,

    Thanks for the update. Are there any other open queries?

    Regards,

    Tushar

  • Yes, in disassembly. I see this: 

    _c_int00 at 0x700ce3f4
    I wish to call _c_int00, how should I adapt the javascript to repair dsMCU2_0.target.run();? 


    We created a separate daisy chain - it seems to be working.