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.

How to get rid of following error? Error: Illegal opcode (00000040) at pc = 0x0000000c Illegal opcode at pc = 0x0000000c

I am using ccsv4. I am trying to implement sum of products. Attached is the c code that i have generated. I also made target configuration file.  My target configuration is c6713 device cycle accurate simulator, little endian. But I am getting this error: 

Error: Illegal opcode (00000040) at pc = 0x0000000c Illegal opcode at pc = 0x0000000c

I am not even able to create hello word project following the example given in getting started, there too i get the same error.

Thanking you in advance 

  • Hi,

    Is the error you are getting when you try to running the code ?

    Do you have hw (XDS510 or XDS560 etc.,) emulator and DSKC6713 board with you ?

    I have tested your code on TI C6748 LCDK board and got the result is 30.

  • Yeah i get this error when i run the code. No, i don't have emulator and hardware board. Even the simple hello world program gives the same error though i am just following the example given in getting started section(hello world example)

  • Hi,

    I don't aware about this issue and this is device specific forum,

    Use http://e2e.ti.com/support/development_tools/code_composer_studio/default.aspx  this forum for CCS and simulator issues.

    Have you linked the command file into this project (linker.cmd or C6713.cmd) ?

    Please refer the following TI e2e posts.

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/145185.aspx

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/157856.aspx

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/65710.aspx

  • Hi Arora,

    I'm able to run the hello world DSP project on C6713 simulator on CCSv5.4.

    I would like to suggest to use the CCS version 5.4 for simulator support.

  • No, I did not include linker file. Now, I included the linker file but getting a new error:

    TMS320C6713: Error:   Memory Map Error: READ access by CPU to address 0x40000, which is RESERVED in Hardware.

    Please see the attached linker file that i included in my project.

  • Hi Arora,

    You don't want to include separate "linker.cmd" file into your new hello world project.

    It will create automatically project and you should mention about your target & CPU type while you create new hello world CCS project.

    Note: I don't see any linker cmd file in your reply.

  • /****************************************************************************/
    /* lnk.cmd v##### */
    /* Copyright (c) 1996@%%%% Texas Instruments Incorporated */
    /* Usage: lnk6x <obj files...> -o <out file> -m <map file> lnk.cmd */
    /* cl6x <src files...> -z -o <out file> -m <map file> lnk.cmd */
    /* */
    /* Description: This file is a sample linker command file that can be */
    /* used for linking programs built with the C compiler and */
    /* running the resulting .out file on a C620x/C670x */
    /* simulator. Use it as a guideline. You will want to */
    /* change the memory layout to match your specific C6xxx */
    /* target system. You may want to change the allocation */
    /* scheme according to the size of your program. */
    /* */
    /* Notes: (1) You must specivy a directory in which rts6x00.lib is */
    /* located. either add a -i"<directory>" line to this */
    /* file or use the system environment variable C_DIR to */
    /* specify a search path for the libraries. */
    /* */
    /* (2) If the run-time library you are using is not named */
    /* rts6200[e].lib, rts6400[e].lib, or rts6700[e].lib, be */
    /* sure to use the correct name here. */
    /* */
    /****************************************************************************/
    -c
    -heap 0x2000
    -stack 0x4000

    /* Memory Map 1 - the default */
    MEMORY
    {
    PMEM: o = 00000020h l = 0000ffe0h
    EXT0: o = 00400000h l = 01000000h
    EXT1: o = 01400000h l = 00400000h
    EXT2: o = 02000000h l = 01000000h
    EXT3: o = 03000000h l = 01000000h
    BMEM: o = 80000000h l = 00010000h
    }

    /* Memory Map 0 */
    /*
    MEMORY
    {
    EXT0: o = 00000000h l = 01000000h
    EXT1: o = 01000000h l = 00400000h
    PMEM: o = 01400000h l = 00010000h
    EXT2: o = 02000000h l = 01000000h
    EXT3: o = 03000000h l = 01000000h
    BMEM: o = 80000000h l = 00010000h
    }
    */

    SECTIONS
    {
    .text > PMEM
    .stack > BMEM
    .bss > BMEM
    .cinit > BMEM
    .cio > BMEM
    .const > BMEM
    .data > BMEM
    .switch > BMEM
    .sysmem > BMEM
    .far > EXT2
    .ppdata > EXT2
    }

    This is the linker command file i've included. And the error I am getting this time is:

    TMS320C6713: Error: Memory Map Error: READ access by CPU to address 0x40000, which is RESERVED in Hardware.

  • Hi Arora,

    /* Description: This file is a sample linker command file that can be */
    /* used for linking programs built with the C compiler and */
    /* running the resulting .out file on a C620x/C670x */
    /* simulator. Use it as a guideline. You will want to */

    Your linker command file seems to be belongs to different SoC C670x and not C6713 or C671x

    This is my C6713.cmd (linker command)  file.

    /****************************************************************************/
    /*  C6713.cmd                                                               */
    /*  Copyright (c) 2010 Texas Instruments Incorporated                       */
    /*  Author: Rafael de Souza                                                 */
    /*                                                                          */
    /*    Description: This file is a sample linker command file that can be    */
    /*                 used for linking programs built with the C compiler and  */
    /*                 running the resulting .out file on an TMS320C6713        */
    /*                 device.  Use it as a guideline.  You will want to        */
    /*                 change the memory layout to match your specific C6xxx    */
    /*                 target system.  You may want to change the allocation    */
    /*                 scheme according to the size of your program.            */
    /*                                                                          */
    /****************************************************************************/
    
    MEMORY
    {
        IRAM     o = 0x00000000  l = 0x00030000  /* 192kB - Internal RAM */
        L2RAM    o = 0x00030000  l = 0x00010000  /* 64kB - Internal RAM/CACHE */
        EMIFCE0  o = 0x80000000  l = 0x10000000  /* SDRAM in 6713 DSK */
        EMIFCE1  o = 0x90000000  l = 0x10000000  /* Flash/CPLD in 6713 DSK */
        EMIFCE2  o = 0xA0000000  l = 0x10000000  /* Daughterboard in 6713 DSK */
        EMIFCE3  o = 0xB0000000  l = 0x10000000  /* Daughterboard in 6713 DSK */
    }
    
    SECTIONS
    {
        .text          >  IRAM
        .stack         >  IRAM
        .bss           >  IRAM
        .cio           >  IRAM
        .const         >  IRAM
        .data          >  IRAM
        .switch        >  IRAM
        .sysmem        >  IRAM
        .far           >  IRAM
        .args          >  IRAM
        .ppinfo        >  IRAM
        .ppdata        >  IRAM
      
        /* COFF sections */
        .pinit         >  IRAM
        .cinit         >  IRAM
      
        /* EABI sections */
        .binit         >  IRAM
        .init_array    >  IRAM
        .neardata      >  IRAM
        .fardata       >  IRAM
        .rodata        >  IRAM
        .c6xabi.exidx  >  IRAM
        .c6xabi.extab  >  IRAM
    }
    

  • I used your linkernfile, but still getting this error:

    TMS320C6713: Error: Illegal opcode (0a646c72) at pc = 0x00000008 Illegal opcode at pc = 0x00000008

  • Hi Arora,

    Sorry for the bad luck.

    Please try to use CCSv5.5 or CCSv5.4.

    Let us know if any issues comes even you use CCSv5.4

  • Hi,

    Thanks for your help.

    My program is running. What I did was: include rts6700.lib in my project and I am not including any linker file. This way I am not getting any error.

    But is this the right way to do?? guide me

  • Hi Arora,

    Yes, You can use this method.

    In CCSv5, We will get these library linked to our project automatically.

  • hello,
    i am using ccs v5.5 and i am using ccs as a simulator for dsk6713 and i am getting the same error it says :-
    TMS320C671X: Error: Illegal opcode (ef1e1479) at pc = 0x000003ac
    plz help
  • When you are getting this error ?
    While loading or running the code on simulator core ?

    I would like to suggest to post new question for this issue as this post may not get attention by other experts.