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.

Halcogen and linker file

Other Parts Discussed in Thread: HALCOGEN
Hi,

I'm trying to modify the linker file produced by Halcogen, but the only way I know of to get what I need is to modify the halcogen code as opposed to putting my code inside of a user code block.  This means that any time I re-generate halcogen code it gets written over.

 

Is there any way to add my own user section, or perhaps another way I can modify the linker to get the same result?

Halcogen produced code is:

 

/* Section Configuration                                                      */

SECTIONS
{
    .intvecs : {} > VECTORS
    .text    : {} > FLASH0 | FLASH1
    .const :   {} > FLASH0 | FLASH1
    .cinit   : {} > FLASH0 | FLASH1
    .pinit   : {} > FLASH0 | FLASH1
    .bss     : {} > RAM
    .data    : {} > RAM
	.sysmem  : {} > RAM
	
}

/* USER CODE BEGIN (5) */
/* USER CODE END */


But what I want to do is:

/* Section Configuration                                                      */

SECTIONS
{
    .intvecs : START( ulFlashStartAddr ) {} > VECTORS
    .text    : {} > FLASH0 | FLASH1
    .const : END( ulFlashEndAddr ) 	{} > FLASH0 | FLASH1
    .cinit   : {} > FLASH0 | FLASH1
    .pinit   : {} > FLASH0 | FLASH1
    .bss     : {} > RAM
    .data    : {} > RAM
	.sysmem  : {} > RAM
	
}

/* USER CODE BEGIN (5) */
/* USER CODE END */


Thanks

 

  • David,

    The linker command file generated by HALCoGen is very generic, we recommend customers to take it as reference and use it according to their need. 

    Two suggestions I have for you, ( I recommend first one).

    1) Do the Linker changes that you want and save the file with different Name and include in your CCS project and exclude the one generated by HALCoGen.

    2) You can use the user code inside Linker command file and try #if 0. 

    /* USER CODE BEGIN (3) */

    #if 0
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration */

    SECTIONS
    {
    .intvecs : {} > VECTORS
    .text : {} > FLASH0 | FLASH1
    .const : {} > FLASH0 | FLASH1
    .cinit : {} > FLASH0 | FLASH1
    .pinit : {} > FLASH0 | FLASH1
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (5) */

    #endif

    SECTIONS
    {
        .intvecs : START( ulFlashStartAddr ) {} > VECTORS
        .text    : {} > FLASH0 | FLASH1
        .const : END( ulFlashEndAddr ) 	{} > FLASH0 | FLASH1
        .cinit   : {} > FLASH0 | FLASH1
        .pinit   : {} > FLASH0 | FLASH1
        .bss     : {} > RAM
        .data    : {} > RAM
    	.sysmem  : {} > RAM
    	
    }

    /* USER CODE END */