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 can I modify a section to cmd file in Linux environment?

Hi all,

 

I am working DM6446 system with below development envirionment.

 

- DSP : DM6446.

- Montavista, DSPLINK.

- base example : readwrite.

 

I want to add a section to command file. in Windows environment , it is very easy.

But in Linux, I can not solve this problem.

created cmd file in below directory is automatically generated and i can't modify it. 

z:\dvsdk_2_00_00_22\dsplink-1_61_03-prebuilt\packages\dsplink\dsp\BUILD\DM6446GEM_0\RDWR\BIOS_REL\readwritecfg.cmd

 

 

this is my test code. I want to add .mysect to the SECTIONS.

//=======mytest.c

#pragma DATA_SECTION (mybuf, ".mysect")
BYTE mybuf[10];

//=========readwritecfg.cmd

SECTIONS {
        .bss:     {} > DDR2

............................

//==============

 

in another forum in Google, one answered which you make your own cmd file and include it to automatically generated cmd file.

But in my think, cmd file in Linux is erased firstly and then it is generated. thus i can't include my self cmd file to readwritecfg.cmd file.

 

Thank you.

 

 

  • The linker can take multiple .cmd files.   This was not the case a long time back (many, many years).  So, you can add your linker .cmd file to the link line.  No need to include one .cmd within the other.

    -Karl-

  • Thanks Karl. It was cleard.

    This is my working files to give to  other developers who have similar problem.

     

    //source code. fn.c

    #pragma DATA_SECTION (mybuf, ".mysect")
    BYTE mybuf[10];

    // mycmd.cmd file
    SECTIONS{
     .mysect :{}>IRAM
    }

    //z:\dvsdk_2_00_00_22\dsplink-1_61_03-prebuilt\packages\dsplink\dsp\src\samples\readwrite\DspBios\5.XX\DM6446GEM\SOURCES file.

    #   ============================================================================
    #   Linker command file (from component base path)
    #   ============================================================================
    CMD_FILE :=$(TI_DSPLINK_DSPOS)$(DIRSEP)$(TI_DSPLINK_DSPOSVERSION)$(DIRSEP)$(TI_DSPLINK_DSPDEVICE)$(DIRSEP)mycmd.cmd

    CMD_FILE += $(COMP_BUILD)$(DIRSEP)BIOS_$(BUILD_MODE)$(DIRSEP)$(notdir $(COMP_PATH))cfg.cmd

    // result map file.

     ARM_RAM               10008000   00004000  00000000  00004000  RWIX
      IRAM                        11800000   00008000  0000000a  00007ff6  RWIX    <===========
      CACHE_L2             11808000   00008000  00000000  00008000  RWIX
      CACHE_L1P          11e08000   00008000  00000000  00008000  RWIX
      L1DSRAM               11f04000   0000c000  00000000  0000c000  RWIX

    .mysect    0    11800000    0000000a     UNINITIALIZED
                      11800000    0000000a     proc_204va.obj (.mysect)

     

     

     

  • Good morning all,

    Has this problem been solved? I cannot see any solution for the last post and I am experiencing the same problem.

    Thank you,

    Pablo Colodron

  • Can you please open an new post with some info about your problem?    The linker supports multiple .cmd files.  So you can supply multiple .cmd files.  The SECTION defines from the first .cmd file "win" and duplicate placement of same section name are ignored.

    Thanks,
    -Karl-