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.

Building a hex file for C6713

Hi,

I have been trying to convert .out file to hex file in ccsv3.1.

While using the hex6x to convert the .out file i get error " Cannot open input file,  No such file or directory" 

C:\CCStudio_v3.1\c6000\cgtools\bin\hex6x C:\Program Files\SoftwareDesignSolutions\FlashBurnDSK\examples\DSK6713\BlinkDSK6713\BlinkDSK6713_ahex.cmd

But all my files are present in the file. I am not sure why do we get this kind error.

Thanks & Regards

Navaneeth

  • Navaneeth Karthikeyan said:
    I have been trying to convert .out file to hex file in ccsv3.1.

    Do you have this specified as a post build step in CCS?

    Does it help if you place the hex command file in a path with no spaces? If that does not help, please provide the contents of the hex.cmd file.

  • I tried with no spaces ,i get the following error
    "The Filename, directory name, or volume label syntax is incorrect"
    I am using CCS_v3.1
  • Navaneeth Karthikeyan said:
    I tried with no spaces ,i get the following error
    "The Filename, directory name, or volume label syntax is incorrect"

    Does the command file actually exist in that directory? My suggestion was to move the hex .cmd file to a directory that does not contain any spaces in its path and then try the hex conversion command. It might be best to try the command first via command line to confirm that it works, and then add it to the CCS post build step.

    Please also note that CCS 3.1 is very old so there is limited support we can provide.

  • Yes command file exits in that directory. I also tried moving the hex.cmd file to no space directory, still i see the same error.

    Have attached the screen shot

  • The command line:

    C:\MyProjects\led\hex6x C:\MyProjects\led\FlashBlink_ahex.cmd

    is throwing an error at line 17 of the .cmd file saying: "cannot open input file ..."

    That line most likely specifies the path to the .out file. Please check that the .out file exists in that path and is named correctly, and that the path to the .out file does not contain spaces.

  • .out file file dos not have any spaces. i still get the same error.
  • Please attach your hex command file here and provide the exact command line you are invoking.
  • Have attached the project file along

    and command line is C:\tone>hex6x FlashBlink_ahex.cmd

    Kindly check if this file works from your end.tone.zip

  • I cannot reproduce your error. Please see my screenshot below. There are warnings during the hex conversion however the command itself is invoked fine.

    The warnings occur when the executable contains sections whose load addresses fall outside the memory range defined by the ROMS directive. In this case you can check the linker map file to confirm where all the sections are being placed and make sure those address ranges are defined within the ROMS directive. Please refer to the Hex conversion chapter in the Assembly Language Tools Users Guide.

  • I had a look at the map file,

    ********************************************************************************
    TMS320C6x COFF/Hex Converter v5.1.0
    ********************************************************************************

    INPUT FILE NAME: <tone.out>
    OUTPUT FORMAT: ASCII-Hex

    PHYSICAL MEMORY PARAMETERS
    Default data width : 8
    Default memory width : 8
    Default output width : 8


    OUTPUT TRANSLATION MAP
    --------------------------------------------------------------------------------
    90000000..902fffff Page=0 Memory Width=8 ROM Width=8 "FLASH"
    --------------------------------------------------------------------------------
    OUTPUT FILES: tone.hex [b0..b7]

    memory allocation look write to me. Not sure what to check

  • This is the hex conversion map file. I was referring to the link map file.
  • This is the linker map file

    /*******************************************************************************
    * Copyright 2004-2005 - Software Design Solutions, Inc. All rights reserved.
    *
    * Portions of this work have been provided under license with Texas
    * Instruments Inc.
    *
    * $RCSfile: BlinkDSK6713.cmd,v $
    * $Revision: 1.2 $
    *
    * Linker command file for BlinkDSK6713
    ******************************************************************************/

    MEMORY
    {
    vecs: o = 00000000h l = 00000200h
    boot: o = 00000200h l = 00000200h
    IRAM: o = 00000400h l = 0000FA00h
    CE0: o = 80000000h l = 01000000h
    FLASHBOOT: o = 90000000h l = 00000400h
    FLASH: o = 90000400h l = 0007FC00h

    }

    SECTIONS
    {
    "vectors" : {} > FLASHBOOT run = vecs
    "bootload" : {} > FLASHBOOT run = boot
    .text : {} > FLASH run = IRAM, LOAD_START(FLASH_TEXT_START), RUN_START(RAM_TEXT_START), SIZE(TEXT_SIZE)
    .cinit : {} > FLASH run = IRAM, LOAD_START(FLASH_CINIT_START), RUN_START(RAM_CINIT_START), SIZE(CINIT_SIZE)
    .const : {} > FLASH run = IRAM, LOAD_START(FLASH_CONST_START), RUN_START(RAM_CONST_START), SIZE(CONST_SIZE)
    .switch : {} > FLASH run = IRAM, LOAD_START(FLASH_SWITCH_START), RUN_START(RAM_SWITCH_START), SIZE(SWITCH_SIZE)
    .tables : {} > FLASH run = IRAM, LOAD_START(FLASH_TABLES_START), RUN_START(RAM_TABLES_START), SIZE(TABLES_SIZE)
    .stack : {} > IRAM
    .bss : {} > IRAM
    .data : {} > IRAM
    .far : {} > IRAM
    .sysmem : {} > IRAM
    .cio : {} > IRAM
    }
  • Navaneeth Karthikeyan said:
    This is the linker map file

    This is not the linker map file, it is the linker command file. Also since this is a BIOS project, there is an additional linker command file auto-generated by BIOS that defines certain memory regions and allocates BIOS sections to those regions. 

    The sections listed in the hex conversion process as falling in unconfigured memory are mostly BIOS sections. If you generate a link map file as part of your project build (not the hex conversion process), then you can see where all these BIOS sections are getting allocated. Once you have that information you can add those memory regions to the ROMS directive in your hex conversion command file. 

    If you are new to the compiler/linker build process, I would strongly suggest reading through the Compiler and Assembler Users Guides. 
    http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals

    Also note that CCS 3.1 is very old and no longer supported. The good news is that there is a good amount of online help and lots of searchable information on these forums that should serve as useful resources.

  • I have been getting similar error even with CCv5.

    Could you build the project and check if this code can be converted to hex format.

    #include "dsk6713.h"
    #include "dsk6713_aic23.h"
    #define beta 1E-12 //rate of convergence
    #define N 30
    short int adaptive_filter(short int ,short int );
    float delay[N];
    float w[N];


    //union{unsigned int uint; short channel[2];} AIC23_data;

    DSK6713_AIC23_Config config = {\
    0x001C, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
    0x00C3, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
    0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
    0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
    0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
    0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
    0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
    0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
    0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
    0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
    };


    /*
    * main() - Main code routine, initializes BSL and generates tone
    */
    void main()
    {
    DSK6713_AIC23_CodecHandle hCodec;

    int l_input, r_input;
    int l_output, r_output, T;

    /* Initialize the board support library, must be called first */
    DSK6713_init();

    /* Start the codec */
    hCodec = DSK6713_AIC23_openCodec(0, &config);

    DSK6713_AIC23_setFreq(hCodec, 1);

    for (T = 0; T < 30; T++)
    {
    w[T] = 0; //init buffer for weights
    delay[T] = 0; //init buffer for delay samples
    }

    while(1)
    {

    /* Read a sample to the left channel */
    while (!DSK6713_AIC23_read(hCodec,&l_input));

    /* Read a sample to the right channel */
    while (!DSK6713_AIC23_read(hCodec, &r_input));

    l_output=(short int)adaptive_filter(l_input,r_input);
    r_output=l_output;

    /* Send a sample to the left channel */
    while (!DSK6713_AIC23_write(hCodec, -l_output));

    /* Send a sample to the right channel */
    while (!DSK6713_AIC23_write(hCodec, -r_output));
    }

    /* Close the codec */
    //DSK6713_AIC23_closeCodec(hCodec);
    }
    short int adaptive_filter(short l_input1,short r_input1) //ISR
    {
    short i,output;
    float yn=0, E=0, dplusn=0, desired=0, noise=0;

    desired = l_input1;
    noise = r_input1;
    dplusn = -(desired + noise); //desired+noise
    delay[0] = noise; //noise as input to adapt FIR

    for (i = 0; i < N; i++) //to calculate out of adapt FIR
    yn += (w[i] * delay[i]); //output of adaptive filter
    E = (desired + noise) - yn; //"error" signal=(d+n)-yn
    for (i = N-1; i >= 0; i--) //to update weights and delays
    {
    w[i] = w[i] + beta*E*delay[i]; //update weights
    delay[i] = delay[i-1]; //update delay samples
    }
    output=((short)E); //error signal as overall output

    //output=((short)dplusn);//output (desired+noise)
    //overall output result
    return(output);
    }

  • Navaneeth Karthikeyan said:
    Could you build the project and check if this code can be converted to hex format.

    The C source file attached alone is not enough to build it and I currently do not have all the required dependencies installed. 

    I see that you are also working the same issue in this other thread: https://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/t/418531

    The folks in that forum are more familiar with the examples you are working and can give you more specific pointers and verify things easier than we can. So I think it is best that you continue the discussion there.