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.

EVMK2H debug ARM assembly

hi,

I want to debug ARM assembly on EVMK2H with ccs6, when I power on the board,then  connect to the first A15 core, and load the .out file to A15 core, but it failed because the .out file place the section of .text ,.data which  start  from  address 0x0, and the address 0 is not useable. Here is the pic:

How can I debug my arm assembly on A15 core? Can anyone help me ? 

Best Regards,

Si

  • Please make sure that you setup your hardware for "No boot" mode ie emulation mode.
    Which example code are you trying to load ?
    Is it your own code or TI provided ?
  • Titus S,

    It's my own code, I set the board as no boot, and load the program,it's the same error with before.
    In my arm project , I have no cmd file like the dsp project, and in the ARM project map, all the data and text section start from address 0x0,I have a doubt about whether I need add a cmd file for arm project, so that it can place the text and data section in a valid address range.

    Best Regards,

    Si
  • Yes, you need to add linker command file to mention about your (.out) program memory segments.

    /*
    * Do not modify this file; it is automatically generated from the template
    * linkcmd.xdt in the ti.targets.elf package and will be overwritten.
    */

    /*
    * put '"'s around paths because, without this, the linker
    * considers '-' as minus operator, not a file name character.
    */


    --retain="*(xdc.meta)"


    --args 0x200
    -heap 0x1000
    -stack 0x1000

    MEMORY
    {
    L2SRAM (RWX) : org = 0x800000, len = 0x80000
    MSMCSRAM (RWX) : org = 0xc000000, len = 0x400000
    DDR3 : org = 0x80000000, len = 0x20000000
    }

    /*
    * Linker command file contributions from all loaded packages:
    */

    /* Content from xdc.services.global (null): */

    /* Content from xdc (null): */

    /* Content from xdc.corevers (null): */

    /* Content from xdc.shelf (null): */

    /* Content from xdc.services.spec (null): */

    /* Content from xdc.services.intern.xsr (null): */

    /* Content from xdc.services.intern.gen (null): */

    /* Content from xdc.services.intern.cmd (null): */

    /* Content from xdc.bld (null): */

    /* Content from ti.targets (null): */

    /* Content from ti.targets.elf (null): */

    /* Content from xdc.rov (null): */

    /* Content from xdc.runtime (null): */

    /* Content from ti.targets.rts6000 (null): */

    /* Content from ti.catalog.c6000 (null): */

    /* Content from ti.catalog (null): */

    /* Content from ti.catalog.peripherals.hdvicp2 (null): */

    /* Content from xdc.platform (null): */

    /* Content from xdc.cfg (null): */

    /* Content from ti.platforms.evm6678 (null): */

    /* Content from configPkg (null): */


    /*
    * symbolic aliases for static instance objects
    */
    xdc_runtime_Startup__RESETFXN__C = 0;
    xdc_runtime_Startup_reset__I = 0;
    xdc_runtime_Startup__EXECFXN__C = 0;
    xdc_runtime_Startup_exec__E = 0;

    SECTIONS
    {
    .text: load >> L2SRAM
    .ti.decompress: load > L2SRAM
    .stack: load > L2SRAM
    GROUP: load > L2SRAM
    {
    .bss:
    .neardata:
    .rodata:
    }
    .cinit: load > L2SRAM
    .pinit: load >> L2SRAM
    .init_array: load > L2SRAM
    .const: load >> L2SRAM
    .data: load >> L2SRAM
    .fardata: load >> L2SRAM
    .switch: load >> L2SRAM
    .sysmem: load > L2SRAM
    .far: load >> L2SRAM
    .args: load > L2SRAM align = 0x4, fill = 0 {_argsize = 0x200; }
    .cio: load >> L2SRAM
    .ti.handler_table: load > L2SRAM
    xdc.meta: load >> L2SRAM, type = COPY

    }
  • I use the cmd you give, it has some error, here it is :

    c:/program files (x86)/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld.exe:../test.cmd: file format not recognized; treating as linker script
    c:/program files (x86)/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld.exe:../test.cmd:12: syntax error
    collect2.exe: error: ld returned 1 exit status
    gmake: *** [test.out] Error 1
    gmake: Target `all' not remade because of errors.
  • Try this,
    I'm able to use the following .cmd and able see the effect in *.map.

    --args 0x200
    -heap 0x1000
    -stack 0x1000

    MEMORY
    {
    L2SRAM (RWX) : org = 0x800000, len = 0x80000
    MSMCSRAM (RWX) : org = 0xc000000, len = 0x400000
    DDR3 : org = 0x80000000, len = 0x20000000
    }


    SECTIONS
    {
    .text: load >> L2SRAM
    .ti.decompress: load > L2SRAM
    .stack: load > L2SRAM
    GROUP: load > L2SRAM
    {
    .bss:
    .neardata:
    .rodata:
    }
    .cinit: load > L2SRAM
    .pinit: load >> L2SRAM
    .init_array: load > L2SRAM
    .const: load >> L2SRAM
    .data: load >> L2SRAM
    .fardata: load >> L2SRAM
    .switch: load >> L2SRAM
    .sysmem: load > L2SRAM
    .far: load >> L2SRAM
    .args: load > L2SRAM align = 0x4, fill = 0 {_argsize = 0x200; }
    .cio: load >> L2SRAM
    .ti.handler_table: load > L2SRAM
    xdc.meta: load >> L2SRAM, type = COPY

    }
  • Titus S.

    it 's the same error, if it 's added to a dsp project,I think it will be ok, but now it's a ARM project,  the cmd  file format not recognized by the arm-linux-gnueabihf/bin/ld.exe, and it treating as linker script,are there some property of the project needed to configure?

     

    Regards,

    Si

  • what cross compiler are you used? I use the gcc-linaro-arm-linux-gnueabihf-4.9-2014.09, does it matter?
  • Apologize, I have provided it for DSP (L2 RAM) :-(

    Use this now and sure it would work as worked for me.

    Now I've used MSMCRAM (it common for both ARM and DSP)

    --args 0x200

    -heap  0x1000

    -stack 0x1000

    MEMORY

    {

       L2SRAM (RWX) : org = 0x800000, len = 0x80000

       MSMCSRAM (RWX) : org = 0xc000000, len = 0x400000

       DDR3 : org = 0x80000000, len = 0x20000000

    }

    SECTIONS

    {

       .text: load >> MSMCSRAM

       .ti.decompress: load > MSMCSRAM

       .stack: load > MSMCSRAM

       GROUP: load > MSMCSRAM

       {

           .bss:

           .neardata:

           .rodata:

       }

       .cinit: load > MSMCSRAM

       .pinit: load >> MSMCSRAM

       .init_array: load > MSMCSRAM

       .const: load >> MSMCSRAM

       .data: load >> MSMCSRAM

       .fardata: load >> MSMCSRAM

       .switch: load >> MSMCSRAM

       .sysmem: load > MSMCSRAM

       .far: load >> MSMCSRAM

       .args: load > MSMCSRAM align = 0x4, fill = 0 {_argsize = 0x200; }

       .cio: load >> MSMCSRAM

       .ti.handler_table: load > MSMCSRAM

       xdc.meta: load >> MSMCSRAM, type = COPY

    }

  • Titus S.

    the same error.

    I create a ccs project, do you create a ccs project or a c project? Here is my project  property:

  • I've created CCS project for K2HK board on CCSv6 and not using generic Cortex A15.

    Also I have CCSv5.5 but I don't have a option for "Generic Cortex A15" to create a ARM project for K2HK board.

    What is your CCS version ?

    If not a CCSv6, could you try it on CCSv6.

    Else attach your project here (or send to me directly x0213399@ti.com)  I will try to build it on CCSv6 and let me update.

  • Titus S.

    Have you received my email? I attach my project in this email.

    Regards,

    Si
  • Yep, I got it and facing some build error (gmake: Target `all' not remade because of errors.).
    Which compiler are you using ?
  • I use gcc-linaro-arm-linux-gnueabihf-4.9-2014.09, which is a window linaro gcc.

    Regards,

    Si
  • Who recommended to use this compiler ?
    Could you share the link where you got downloaded.
  • here is the link: www.linaro.org/downloads

    there are some introduction about the linaro cross compiler.

    Regards,

    Si
  • As you mentioned on the above post, I've tried to build with linaro (v4.9.4) toolchain and able to build but load failed like you and its not recognizing the .cmd file to map the correct RAM (DDR,IRAM etc.,)

    We have to use linker command file to map .out to RAM in CCS IDE.
    You need to use TI GNU ARM compiler to recognize the .cmd file while building.

    I would like to suggest to post your question either CCs forum or compiler forum or both.

    e2e.ti.com/.../81;pi317054=1

    e2e.ti.com/.../343
  • Hi Titus S.

    You said"
    We have to use linker command file to map .out to RAM in CCS IDE.
    You need to use TI GNU ARM compiler to recognize the .cmd file while building. "

    Q1. How can I use the linker command file to map .out to RAM in CCS IDE?
    Q2. Is the TI GNU ARM compiler integrated in CCS IDE? My ccs ARM project compiler is GNU4.7.4, is this one ?

    I have bee troubled for several days, hope I can solve this problem.

    Best Regards,

    Si
  • i ran into the same problem using LINARO in Linux. I wonder has this problem been resolved yet?