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 the ARM in 66AK2H12 on EVMK2HX

Other Parts Discussed in Thread: TMS320C6678

Hi,

I was able to get the DSPs to work on the device (only single core) . I have a few questions about the device and the board

1) How do I compile code for Cortex A-15 using CCS i.e the linker command file for ARM and the device to be selected while making the project (TCI6638 seems to compile only for DSP)?

2) My OpenMP binaries that worked on TMS320C6678 do not execute on TCI6638 C66xx CorePac, am I doing anything wrong? Even the example OMP hello world project does not execute on the DSPs.

3) I currently use "Texas Instruments XDS2xx USB Onboard Emulator" instead of "Texas Instruments XDS2xx USB Emulator" as the later requires a license. Could this become an issue later on in my multicore development?
Thank you in advance.
Best regards,

Barath Ramesh

  • Hi Barath,

    1) On CCS, when you create a new CCS project, under Device family, you can pick ARM, then you can pick the right Generic ARM device. However, the Cortex A15 or TCI6638 is not in the drop down menu yet with CCS v5.4. So now the work around is to pick any of the arm variants, but you will need adjust the compiler/linker options to match A15. We will add this into CCS v5.5 in the near future.

    However, if you are not running bare-metal but with Linux, then you can use Linaro tool chain to built the code:

    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Tools#Linaro_toolchain

    More detailed procedure to build kernel, uboot, etc are here:

    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring

    2) The code should be binary compatible in your case, however, I suspect it is because the PLL, DDR settings in existing binary may not work for new device since memory map may be different from device to device. One way is to check your exisitng OpenMP project to match the memory map and PLL, DDR settings. You can find such setings in the GEL file usually goes with the CCS. E.g.:

    C:\ti\ccsv5\ccs_base\emulation\boards\evmtci6638k2k\gel\evmtci6638k2k.gel

    I will also check to see if we have OpenMP examples for TCI6638.

    3) As long as it is working for you now, I don't forsee an issue going forward. Backward compatibility should be maintained.

    best regards,

    David Zhou

     

  • David,

    Thanks for your reply. But I ran into issues when I tried running Linux on the board based on the instructions in

    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring.Linux

    I am able to get uboot up and running using CCS.  I am using the uImage-keystone-evm.bin and uImage-keystone-evm.dtb files provided in the mcsdk_linux_3_00_00_09/images folder. After following the steps provided to run Linux when I try the command

    bootm 0x88000000 - 0x87000000

    I get he following error on the UART console

    "Wrong Image Format for bootm command"

    "Error: can't get kernel image"

    The boot args that I am using is

    setenv bootargs 'console=USB0,115200n8 rootwait=1 earlyprintk rdinit=/sbin/init rw root=/dev/ram0 initrd=0x802000000,68M'

    68M' since the size of tisdk-rootfs.cpio.gz file in the images folder is 68M and USB0 is my COM port.

    Am I doing something wrong?

    regards,

    Barath Ramesh

  • Hello Barath,

    USB0 does not look like a valid serial port bootarg.  If you're using an unmodified Avantech EVM, that console should be pointing to ttyS0 (yes, the EVM interface is USB, but it is via an external RS232->USB driver).  I'm not sure that would be causing your error, however.

    I'm assuming initrd is supposed to be pointing to DDR?  I think there might be an extra '0' in there (initrd=0x8 0200 0000)- I know we can do 36-bit addressing, so perhaps that is what is going, but looking at boot logs, I usually see a 32-bit value specified.

    Also, just in case, the first step you must do when setting up your uboot environment is:

    env default -f -a

    Finally, you may want to consider using the latest version of the MCSDK, if you do not have a dependency on alpha 9.  We're currently on beta 10 which fixes a bug with gdb, among other things.  You will need to get the latest version of the Linaro.

    MCSDK: http://software-dl.ti.com/sdoemb/sdoemb_public_sw/mcsdk/latest/index_FDS.html
    Linaro: https://launchpad.net/linaro-toolchain-binaries/trunk/2013.03/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux.tar.bz2

    Mike

  • Mike,

    I modified loadlin-evm-kern.js file. The provided CFG_INITRD_START 0x85000000 was overlapping with the CFG_KERNEL_ADDRESS 0x88000000 since the size of cpio.gz file is 76MB. I changed it to address CFG_INITRD_START 0x80000000 the kernel starts to load but halts due to a kernel panic shown below:

    Registering SWP/SWPB emulation handler
    [    2.599146] VFS: Cannot open root device "ram0" or unknown-block(0,0): error -6
    [    2.606454] Please append a correct "root=" boot option; here are the available partitions:
    [    2.614790] 1f00            1024 mtdblock0  (driver?)
    [    2.619853] 1f01             512 mtdblock1  (driver?)
    [    2.624901] 1f02          129536 mtdblock2  (driver?)
    [    2.629960] 1f03             512 mtdblock3  (driver?)
    [    2.635003] 1f04           15872 mtdblock4  (driver?)
    [    2.640058] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

    Should my bootargs be as shown below inorder to cater to the CFG_INITRD_START change

    >setenv bootargs 'console=ttyS0,115200n8 rootwait=1 earlyprintk rdinit=/sbin/init 
    rw root=/dev/ram0 initrd=0x80000000,76M'
    >saveenv


    Also please find the attached kernel load script that I am using.
    // Utility to load a kernel and initialize stuff before Linux runs on Simulator
    
    // ----------------------------------------------------------------------------
    //    Required packages
    
    importPackage(Packages.com.ti.debug.engine.scripting)
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    importPackage(Packages.java.lang)
    importPackage(java.awt)
    importPackage(java.io)
    importPackage(java.net)
    importPackage(java.util)
    
    var CFG_KERNEL_ADDRESS  = 0x88000000;
    var CFG_INITRD_START    = 0x80000000;
    var CFG_INITRD_SIZE = 80 * 1024 * 1024;
    var CFG_INITRD_PAD  = 1 * 1024 * 1024;  /* max blank space at the end */
    var CFG_UBOOT_ADDRESS   = 0x0c001000;
    var CFG_SKERN_ADDRESS   = 0x0c030000;
    var CFG_DTB_ADDRESS = 0x87000000;
    
    var PATH_LOADLIN    = "/opt/ti_5_3/mcsdk_linux_3_00_00_10/host-tools/loadlin"
    
    var pathLog     = PATH_LOADLIN + "/tracelog.xml";
    var pathXSL     = PATH_LOADLIN + "/loadlin.xsl";
    var pathCCXML       = PATH_LOADLIN + "/tci6638-evm.ccxml";
    var pathKernel      = PATH_LOADLIN + "/uImage-keystone-evm.bin";
    var pathDtb     = PATH_LOADLIN + "/uImage-tci6638-evm.dtb";
    var pathVmlinux     = PATH_LOADLIN + "/vmlinux";
    var pathInitrd      = PATH_LOADLIN + "/tisdk-rootfs.cpio.gz";
    
    var sessionName       = "Texas Instruments XDS2xx USB Onboard Emulator_0/CortexA15_1";
    
    function RegSetup(session)
    {
        session.memory.writeRegister("R0", 0);
        session.memory.writeRegister("R1", 0xffffffff);
        session.memory.writeRegister("R2", CFG_DTB_ADDRESS);
        session.memory.writeRegister("PC", CFG_KERNEL_ADDRESS);
    }
    
    function UARTWriteInstr(session, pc, reg, val)
    {
        /* mov  r3, #0x38797312   - 0x2500000   */
        session.memory.writeData(0, pc, 0xe3a03625, 32);
        pc += 4;
    
        /* add  r3, r3, #199680   - 0x30c00     */
        session.memory.writeData(0, pc, 0xe2833bc3, 32);
        // session.memory.writeData(0, pc, 0xe2833a31, 32);
        pc += 4;
    
        /* add  r3, r3, #reg */
        session.memory.writeData(0, pc, 0xe2833000 + reg, 32);
        pc += 4;
    
        /* mov  r2, #val */
        session.memory.writeData(0, pc, 0xe3a02000 + val, 32);
        pc += 4;
    
        /* str  r2, [r3] */
        session.memory.writeData(0, pc, 0xe5832000, 32);
        pc += 4;
    
        return pc;
    }
    
    function WriteInfiniteLoop(session, pc)
    {
        /* lab: b lab */
        session.memory.writeData(0, pc, 0xeafffffe, 32);
        return pc;
    }
    
    function UARTSetup(session)
    {
        var pc = 0x0c011000;
    
        session.memory.writeRegister("PC", pc);
            pc = UARTWriteInstr(session, pc, 0x20, 0x5a);   /* DLL */
    
        pc = UARTWriteInstr(session, pc, 0x00, 85);
        pc = UARTWriteInstr(session, pc, 0x00, 65);
        pc = UARTWriteInstr(session, pc, 0x00, 82);
        pc = UARTWriteInstr(session, pc, 0x00, 84);
        pc = UARTWriteInstr(session, pc, 0x00, 32);
        pc = UARTWriteInstr(session, pc, 0x00, 73);
        pc = UARTWriteInstr(session, pc, 0x00, 110);
        pc = UARTWriteInstr(session, pc, 0x00, 105);
        pc = UARTWriteInstr(session, pc, 0x00, 116);
        pc = UARTWriteInstr(session, pc, 0x00, 105);
        pc = UARTWriteInstr(session, pc, 0x00, 97);
        pc = UARTWriteInstr(session, pc, 0x00, 108);
        pc = UARTWriteInstr(session, pc, 0x00, 105);
        pc = UARTWriteInstr(session, pc, 0x00, 122);
        pc = UARTWriteInstr(session, pc, 0x00, 101);
        pc = UARTWriteInstr(session, pc, 0x00, 100);
        pc = UARTWriteInstr(session, pc, 0x00, 13);
        pc = UARTWriteInstr(session, pc, 0x00, 10);
        pc = WriteInfiniteLoop(session, pc);
        session.breakpoint.removeAll();
        session.breakpoint.add(pc);
        session.target.run();
        session.target.waitForHalt();
    }
    
    function SecureSetup(session)
    {
        var pc = 0x0c010000;
    
        session.memory.writeRegister("PC", pc);
        session.memory.writeData(0, pc, 0xe28f0008, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe59f1000, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe12fff11, 32); pc += 4;
        session.memory.writeData(0, pc, 0x00001000, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee110f11, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe3c00001, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee010f11, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee110f10, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe3c00001, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee010f10, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee110f11, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe3800001, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee010f11, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee110f10, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe3c00001, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee010f10, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee110f11, 32); pc += 4;
        session.memory.writeData(0, pc, 0xe3c00001, 32); pc += 4;
        session.memory.writeData(0, pc, 0xee010f11, 32); pc += 4;
        pc = WriteInfiniteLoop(session, pc);
        session.breakpoint.removeAll();
        session.breakpoint.add(pc);
        session.target.run();
        session.target.waitForHalt();
    }
    
    function LoadKernel(session)
    {
        session.memory.loadRaw(0, CFG_KERNEL_ADDRESS, pathKernel, 32, false);
        script.traceWrite("Kernel at " + pathKernel + " loaded at " + CFG_KERNEL_ADDRESS);
    
        session.memory.loadRaw(0, CFG_INITRD_START, pathInitrd, 32, false);
        script.traceWrite("Initrd at " + pathInitrd + " loaded at " + CFG_INITRD_START);
    }
    
    function LoadDtb(session)
    {
        session.memory.loadRaw(0, CFG_DTB_ADDRESS, pathDtb, 32, false);
        script.traceWrite("Dtb at " + pathDtb + " loaded at " + CFG_DTB_ADDRESS);
    }
    
    function RunKernel(session)
    {
        session.breakpoint.removeAll();
        session.breakpoint.add("start_kernel");
    }
    
    function LoadLin(script)
    {
        LoadDtb     (session);
        LoadKernel  (session);
    }
    
    
    var script  = ScriptingEnvironment.instance();
    script.traceBegin(pathLog, pathXSL);
    script.traceWrite("LoadLin Started");
    
    var server = script.getServer("DebugServer.1")
    server.setConfig(pathCCXML);
    script.traceWrite("DebugServer configured");
    
    var session = server.openSession(sessionName);
    
    script.traceWrite("DebugSession opened");
    
    LoadLin(script);
    
    script.traceWrite("LoadLin Complete");
    script.traceEnd();
    quit();
    
    
    
    


    Thanks for your help.

    regards,

    Barath Ramesh

  • Barath,

    Sorry I did not get back with you before the weekend.  I will investigate today.  I do not use the loadin scripts, so I cannot yet comment on your changes. 

    Mike

  • TCI66xx devices are supported through our Field Applications Engineers (FAEs) and are not supported on the E2E forum.  Please work with your local FAE for support on these devices.  If you do not know who your local FAE is, then please contact your local technical sales representative who can put you in touch with your local FAE.

    Best Regards,
    Chad 

  • Hi Barath,
    Please refer below post for ARM A15 hello world project using CCS (Linker Command File).

    e2e.ti.com/.../1538734

    Thank you.