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.

AM2634: SysCf with Mcal driver

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I try to integrate some of the syscfg drivers into my mcal project. Therefore I want to change some line of codes in the generated ti_drivers_open_close.c file. When I always built the project; all changes are away and the generated .c file is back to its first version. 

So my question is; is it possible to change it and how? If no; how can I integrate the syscfg drivers with less effort (The driver from SysCfg is I2C)? 

Thank in advance and best regards

  • Hi

    FIrstly, it is not recommended to use sysconfig or SDK drivers directly into MCAL. The reason being the SDK drivers has dependencies on lot of OS calls and stuff like semaphores etc., which is currently not implemnted in the MCAL drivers, so please integrate the drivers at your own risk.

    is it possible to change it and how?

    Yes, I can surely help on this and it's possible. But the only way to do this is not use CCS to re-build the project after your changes because it triggers a makefile build which cleans the sysconfig files and re-generates them. To override this, go to the workspace where your project is present and go into the Debug/ folder where you'll find a makefile like this, then open a cmd in this folder and run "gmake -s all" this will compile the changed file only and gives you the output.

    I have edited the ti_dpl_config.c file and you could see that only that file is compiled. Hope this helps.

  • Hi Kowshik,

    We have integrate some of your mcal driver into our project amd it works vell. Now we need to integrate a cdd driver which is I2C. When i run the I2C driver in Polling mode then it works well; this means for me semaphore functions are working well. but when I try to interrupt mode, i got the following trap:

    Could you discuss internally and give us any suggestions?

  • Hi

    Integrating freeRtos to the MCAL drivers is not straight forward as we expect. One of the things that I recommend checking is how the interrupt registration is being done? It should be done through the Hwip module instead of the existing vim( ) module. This makes sure the interrupt and handlers are properly registered.

    Can you change this implementation? Also, can I know what's the linker you're using? there are some changes required to the MCAL's linker file as the SDK code is coming into the picture and start by making the following changes

    Add the above section at the bottom of the linker file


    change the BSS linker symbols as shown



    change the intvecs to .vectors to comply the SDK's notation.

    Please increase the size of the SVC stack to 4096 incase you're enabling the interrupt nesting as this can cause stack overflow issues.

    Hope this helps

  • we have already integrated the freertos in our project and it works fine. for the interrupt we have used the vim and this is called only once in our project.

    the changes which are made in i2c sys drivers are

    and vimEnableInterrupt and vimDisableInterrupt is used in transfer function, where needed.

    finally my linker script is shown like this:


    /* This is the stack that is used by code running within main()
    * In case of NORTOS,
    * - This means all the code outside of ISR uses this stack
    * In case of FreeRTOS
    * - This means all the code until vTaskStartScheduler() is called in main()
    * uses this stack.
    * - After vTaskStartScheduler() each task created in FreeRTOS has its own stack
    */
    --stack_size=16384
    /* This is the heap size for malloc() API in NORTOS and FreeRTOS
    * This is also the heap used by pvPortMalloc in FreeRTOS
    */
    --heap_size=512
    -emain /* This is the entry of the application, _vector MUST be plabed starting address 0x0 */

    /* This is the size of stack when R5 is in IRQ mode
    * In NORTOS,
    * - Here interrupt nesting is disabled as of now
    * - This is the stack used by ISRs registered as type IRQ
    * In FreeRTOS,
    * - Here interrupt nesting is enabled
    * - This is stack that is used initally when a IRQ is received
    * - But then the mode is switched to SVC mode and SVC stack is used for all user ISR callbacks
    * - Hence in FreeRTOS, IRQ stack size is less and SVC stack size is more
    */
    __IRQ_STACK_SIZE = 256;
    /* This is the size of stack when R5 is in IRQ mode
    * - In both NORTOS and FreeRTOS nesting is disabled for FIQ
    */
    __FIQ_STACK_SIZE = 256;
    __SVC_STACK_SIZE = 8192; /* This is the size of stack when R5 is in SVC mode */
    __ABORT_STACK_SIZE = 256; /* This is the size of stack when R5 is in ABORT mode */
    __UNDEFINED_STACK_SIZE = 256; /* This is the size of stack when R5 is in UNDEF mode */

    SECTIONS
    {
    /* This has the R5F entry point and vector table, this MUST be at 0x0 */
    .vectors:{} palign(8) > R5F_VECS

    /* This has the R5F boot code until MPU is enabled, this MUST be at a address < 0x80000000
    * i.e this cannot be placed in DDR
    */
    GROUP {
    .text.hwi: palign(8)
    .text.startup: palign(8) // Harbas A. for MCAL
    .text.cache: palign(8)
    .text.mpu: palign(8)
    .text.boot: palign(8)
    .text:abort: palign(8) /* this helps in loading symbols when using XIP mode */
    } > OCRAM

    /* This is rest of code. This can be placed in DDR if DDR is available and needed */
    GROUP {
    .text: {} palign(8) /* This is where code resides */
    .rodata: {} palign(8) /* This is where const's go */
    } > OCRAM

    /* This is rest of initialized data. This can be placed in DDR if DDR is available and needed */
    GROUP {

    .data: {} palign(8) /* This is where initialized globals and static go */
    } > OCRAM

    /* This is rest of uninitialized data. This can be placed in DDR if DDR is available and needed */
    GROUP {
    .bss: {} palign(8) /* This is where uninitialized globals go */
    RUN_START(__BSS_START)
    RUN_END(__BSS_END)
    .sysmem: {} palign(8) /* This is where the malloc heap goes */
    .stack: {} palign(8) /* This is where the main() stack goes */
    } > OCRAM

    /* This is where the stacks for different R5F modes go */
    GROUP {
    .irqstack: {. = . + __IRQ_STACK_SIZE;} align(8)
    RUN_START(__IRQ_STACK_START)
    RUN_END(__IRQ_STACK_END)
    .fiqstack: {. = . + __FIQ_STACK_SIZE;} align(8)
    RUN_START(__FIQ_STACK_START)
    RUN_END(__FIQ_STACK_END)
    .svcstack: {. = . + __SVC_STACK_SIZE;} align(8)
    RUN_START(__SVC_STACK_START)
    RUN_END(__SVC_STACK_END)
    .abortstack: {. = . + __ABORT_STACK_SIZE;} align(8)
    RUN_START(__ABORT_STACK_START)
    RUN_END(__ABORT_STACK_END)
    .undefinedstack: {. = . + __UNDEFINED_STACK_SIZE;} align(8)
    RUN_START(__UNDEFINED_STACK_START)
    RUN_END(__UNDEFINED_STACK_END)
    } > OCRAM

    /* Sections needed for C++ projects */
    GROUP {
    .ARM.exidx: {} palign(8) /* Needed for C++ exception handling */
    .init_array: {} palign(8) /* Contains function pointers called before main */
    .fini_array: {} palign(8) /* Contains function pointers called after main */
    } > OCRAM

    /* General purpose user shared memory, used in some examples */
    .bss.user_shared_mem (NOLOAD) : {} > USER_SHM_MEM
    /* this is used when Debug log's to shared memory are enabled, else this is not used */
    .bss.log_shared_mem (NOLOAD) : {} > LOG_SHM_MEM
    /* this is used only when IPC RPMessage is enabled, else this is not used */
    .bss.ipc_vring_mem (NOLOAD) : {} > RTOS_NORTOS_IPC_SHM_MEM
    }

    MEMORY
    {
    R5F_VECS : ORIGIN = 0x00000000 , LENGTH = 0x00000040
    R5F_TCMA : ORIGIN = 0x00000040 , LENGTH = 0x00007FC0
    R5F_TCMB : ORIGIN = 0x00080000 , LENGTH = 0x00008000

    /* when using multi-core application's i.e more than one R5F/M4F active, make sure
    * this memory does not overlap with other R5F's
    */
    OCRAM : ORIGIN = 0x70040000 , LENGTH = 0x40000 /* Harbas 0x80000 */

    /* This section can be used to put XIP section of the application in flash, make sure this does not overlap with
    * other CPUs. Also make sure to add a MPU entry for this section and mark it as cached and code executable
    */
    FLASH : ORIGIN = 0x60100000 , LENGTH = 0x80000


    /* shared memories that are used by RTOS/NORTOS cores */
    /* On R5F,
    * - make sure there is a MPU entry which maps below regions as non-cache
    */
    USER_SHM_MEM : ORIGIN = 0x701D0000, LENGTH = 0x00004000
    LOG_SHM_MEM : ORIGIN = 0x701D4000, LENGTH = 0x00004000
    /* MSS mailbox memory is used as shared memory, we dont use bottom 32*12 bytes, since its used as SW queue by ipc_notify */
    RTOS_NORTOS_IPC_SHM_MEM : ORIGIN = 0x72000000, LENGTH = 0x3E80}

    and the autosar linker is following:


    /*
    * STACK SIZE MACRO DEFINITIONS
    */
    #define M_USER_STACK_SIZE 0x1800 /* Multiple of 8 bytes - 6KB */
    #define M_PREV_STACK_SIZE 0x10 /* Multiple of 8 bytes - 16B */

    /*
    * LINKER OPTIONS
    */
    --entry_point=_c_int_vector_table /* ENTRY POINT */
    -stack 0x2000 /* SOFTWARE STACK SIZE */
    -heap 0x2000 /* HEAP AREA SIZE */
    --retain="*(.intvecs)"

    /* SPECIFY THE SYSTEM MEMORY MAP */

    MEMORY{
    PAGE 0:
    VECTORS (X) : origin=0x102EF000 length=0x00001000
    /* Reset Vectors base address(RESET_VECTORS) should be 64 bytes aligned */
    RESET_VECTORS (X) : origin=0x00000000 length=0x100
    /* RESET_VECTORS (X) : origin=0x00020000 length=0x100 */
    TCMA_RAM (RX) : origin=0x00000100 length=0x00003F00
    TCMB_RAM (RW) : origin=0x00080000 length=0x00004000
    L2_RAM_BANK0 (RW) : origin=0x70080000 length=0x100000
    /* CPPI descriptor memory */

    L3_RAM (RW) : origin=0x88000000 length=0x00300000
    HWA_RAM (RW) : origin=0x28000000 length=0x00020000

    PAGE 1:
    L3_RAM (RW) : origin=0x88000000 length=0x00300000
    }

    --define=MCAL_CODE1=L2_RAM_BANK0
    --define=MCAL_CODE2=L2_RAM_BANK0
    --define=MCAL_DATA=L2_RAM_BANK0
    --define=MCAL_BSS=L2_RAM_BANK0
    --define=MCAL_NOINIT=L2_RAM_BANK0
    --define=MCAL_CONST=L2_RAM_BANK0
    --define FILL_PATTERN=0xFEAA55EF
    --define FILL_LENGTH=0x100

    /* Stack Sizes for various modes */
    __STACK_SIZE = 0x2000;
    __IRQ_STACK_SIZE = 0x1000;
    __FIQ_STACK_SIZE = 0x1000;
    __ABORT_STACK_SIZE = 0x1000;
    __UND_STACK_SIZE = 0x1000;
    __SVC_STACK_SIZE = 0x1000;

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

    SECTIONS
    {
    .intvecs : {} palign(8) > RESET_VECTORS
    .startup : {} palign(8) > TCMA_RAM
    .systcmsysvimRam : > TCMA_RAM

    .mpu : {} palign(8) > MCAL_CODE1 /*Harbas A.*/
    .hwi : {} palign(8) > MCAL_CODE1 /*Harbas A.*/
    .cache : {} palign(8) > MCAL_CODE1 /*Harbas A.*/
    .boot : {} palign(8) > MCAL_CODE1 /*Harbas A.*/
    .text:abort : palign(8) > MCAL_CODE1 /*Harbas A.*/

    /* TEXT SECTION - Executable Code */
    .text : > MCAL_CODE1, fill=FILL_PATTERN
    {
    .=align(4);
    __linker_text_start = .;
    . += FILL_LENGTH;
    *(.text)
    .=align(4);
    . += FILL_LENGTH;
    __linker_text_end = .;
    }

    /* CONST SECTION - Initialized Global Variables */
    .const : load > MCAL_CONST, fill=FILL_PATTERN
    {
    .=align(4);
    __linker_const_start = .;
    . += FILL_LENGTH;
    *(.const)
    .=align(4);
    . += FILL_LENGTH;
    __linker_const_end = .;
    }

    /* RODATA SECTION - Initialized Static Variables */
    .rodata : load > MCAL_CONST, fill=FILL_PATTERN
    {
    .=align(4);
    __linker_rodata_start = .;
    . += FILL_LENGTH;
    *(.const)
    .=align(4);
    . += FILL_LENGTH;
    __linker_rodata_end = .;
    }

    /* DATA SECTION - Initialized Data */
    .data : load > MCAL_DATA, fill=FILL_PATTERN
    {
    .=align(4);
    __linker_data_start = .;
    . += FILL_LENGTH;
    *(.data)
    .=align(4);
    . += FILL_LENGTH;
    __linker_data_end = .;
    }

    /* BSS SECTION - Contains Uninitialized Global variables */
    .bss : load > MCAL_BSS, fill=FILL_PATTERN
    RUN_START(bss_start)
    RUN_END(bss_end)
    {
    .=align(4);
    __linker_bss_start = .;
    . += FILL_LENGTH;
    *(.bss)
    .=align(4);
    . += FILL_LENGTH;
    __linker_bss_end = .;
    }

    /* This is where the stacks for different R5F modes go */
    /*By Harbas A.*/
    GROUP {
    .irqstack: {. = . + __IRQ_STACK_SIZE;} align(8)
    RUN_START(__IRQ_STACK_START)
    RUN_END(__IRQ_STACK_END)
    .fiqstack: {. = . + __FIQ_STACK_SIZE;} align(8)
    RUN_START(__FIQ_STACK_START)
    RUN_END(__FIQ_STACK_END)
    .svcstack: {. = . + __SVC_STACK_SIZE;} align(8)
    RUN_START(__SVC_STACK_START)
    RUN_END(__SVC_STACK_END)
    .abortstack: {. = . + __ABORT_STACK_SIZE;} align(8)
    RUN_START(__ABORT_STACK_START)
    RUN_END(__ABORT_STACK_END)
    .undefinedstack: {. = . + __UND_STACK_SIZE;} align(8)
    RUN_START(__UNDEFINED_STACK_START)
    RUN_END(__UNDEFINED_STACK_END)
    } load > MCAL_DATA

    /* CINIT SECTION - Tables which initializes global variables */
    .cinit : load > MCAL_DATA

    /* STACK - System Stack */
    /*By Harbas A.*/
    /*.stack : load > MCAL_DATA, fill=FILL_PATTERN
    {
    __STACK_END = .;
    . = . + __STACK_SIZE;
    } palign(8)*/
    /* STACK - System Stack */
    .stack : load > MCAL_DATA, fill=FILL_PATTERN


    /* SYSMEM - Heap Memory */
    .sysmem : load > MCAL_DATA

    /* MCPI Log Buffer */
    .MCPILogBuffer : load > MCAL_DATA
    McalTextSection : fill=FILL_PATTERN, align=4, load > MCAL_CODE1
    {
    .=align(4);
    __linker_dio_text_start = .;
    . += FILL_LENGTH;
    *(DIO_TEXT_SECTION)
    *(DIO_ISR_TEXT_SECTION)
    *(DIO_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_dio_text_end = .;

    .=align(4);
    __linker_gpt_text_start = .;
    . += FILL_LENGTH;
    *(GPT_TEXT_SECTION)
    *(GPT_ISR_TEXT_SECTION)
    *(GPT_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_gpt_text_end = .;

    .=align(4);
    __linker_mcu_text_start = .;
    . += FILL_LENGTH;
    *(MCU_TEXT_SECTION)
    *(MCU_ISR_TEXT_SECTION)
    *(MCU_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_mcu_text_end = .;

    .=align(4);
    __linker_port_text_start = .;
    . += FILL_LENGTH;
    *(PORT_TEXT_SECTION)
    *(PORT_ISR_TEXT_SECTION)
    *(PORT_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_port_text_end = .;

    .=align(4);
    __linker_wdg_text_start = .;
    . += FILL_LENGTH;
    *(WDG_TEXT_SECTION)
    *(WDG_ISR_TEXT_SECTION)
    *(WDG_CALLOUT_TEXT_SECTION)
    .=align(8);
    . += FILL_LENGTH;
    __linker_wdg_text_end = .;

    .=align(4);
    __linker_spi_text_start = .;
    . += FILL_LENGTH;
    *(SPI_TEXT_SECTION)
    *(SPI_ISR_TEXT_SECTION)
    *(SPI_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_spi_text_end = .;

    .=align(4);
    __linker_cdd_text_start = .;
    . += FILL_LENGTH;
    *(CDD_TEXT_SECTION)
    *(CDD_ISR_TEXT_SECTION)
    *(CDD_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_cdd_text_end = .;

    .=align(4);
    __linker_can_text_start = .;
    . += FILL_LENGTH;
    *(CAN_TEXT_SECTION)
    *(CAN_ISR_TEXT_SECTION)
    *(CAN_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_can_text_end = .;

    .=align(4);
    __linker_pwm_text_start = .;
    . += FILL_LENGTH;
    *(PWM_TEXT_SECTION)
    *(PWM_ISR_TEXT_SECTION)
    *(PWM_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_pwm_text_end = .;

    .=align(4);
    __linker_adc_text_start = .;
    . += FILL_LENGTH;
    *(ADC_TEXT_SECTION)
    *(ADC_ISR_TEXT_SECTION)
    *(ADC_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_adc_text_end = .;

    .=align(4);
    __linker_eth_text_start = .;
    . += FILL_LENGTH;
    *(ETH_TEXT_SECTION)
    *(ETH_ISR_TEXT_SECTION)
    *(ETH_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_eth_text_end = .;

    .=align(4);
    __linker_ethtrcv_text_start = .;
    . += FILL_LENGTH;
    *(ETHTRCV_TEXT_SECTION)
    *(ETHTRCV_ISR_TEXT_SECTION)
    *(ETHTRCV_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_ethtrcv_text_end = .;

    .=align(4);
    __linker_fls_text_start = .;
    . += FILL_LENGTH;
    *(FLS_TEXT_SECTION)
    *(FLS_ISR_TEXT_SECTION)
    *(FLS_CALLOUT_TEXT_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_fls_text_end = .;
    }

    McalConstSection : fill=FILL_PATTERN, align=4, load > MCAL_CONST
    {
    .=align(4);
    __linker_dio_const_start = .;
    . += FILL_LENGTH;
    *(DIO_CONST_UNSPECIFIED_SECTION)
    *(DIO_CONST_32_SECTION)
    *(DIO_CONST_16_SECTION)
    *(DIO_CONST_8_SECTION)
    *(DIO_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_dio_const_end = .;

    .=align(4);
    __linker_gpt_const_start = .;
    . += FILL_LENGTH;
    *(GPT_CONST_UNSPECIFIED_SECTION)
    *(GPT_CONST_32_SECTION)
    *(GPT_CONST_16_SECTION)
    *(GPT_CONST_8_SECTION)
    *(GPT_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_gpt_const_end = .;

    .=align(4);
    __linker_mcu_const_start = .;
    . += FILL_LENGTH;
    *(MCU_CONST_UNSPECIFIED_SECTION)
    *(MCU_CONST_32_SECTION)
    *(MCU_CONST_16_SECTION)
    *(MCU_CONST_8_SECTION)
    *(MCU_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_mcu_const_end = .;

    .=align(4);
    __linker_port_const_start = .;
    . += FILL_LENGTH;
    *(PORT_CONST_UNSPECIFIED_SECTION)
    *(PORT_CONST_32_SECTION)
    *(PORT_CONST_16_SECTION)
    *(PORT_CONST_8_SECTION)
    *(PORT_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_port_const_end = .;

    .=align(4);
    __linker_wdg_const_start = .;
    . += FILL_LENGTH;
    *(WDG_CONST_UNSPECIFIED_SECTION)
    *(WDG_CONST_32_SECTION)
    *(WDG_CONST_16_SECTION)
    *(WDG_CONST_8_SECTION)
    *(WDG_CONFIG_SECTION)
    .=align(8);
    . += FILL_LENGTH;
    __linker_wdg_const_end = .;

    .=align(4);
    __linker_spi_const_start = .;
    . += FILL_LENGTH;
    *(SPI_CONST_UNSPECIFIED_SECTION)
    *(SPI_CONST_32_SECTION)
    *(SPI_CONST_16_SECTION)
    *(SPI_CONST_8_SECTION)
    *(SPI_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_spi_const_end = .;

    .=align(4);
    __linker_cdd_const_start = .;
    . += FILL_LENGTH;
    *(CDD_CONST_UNSPECIFIED_SECTION)
    *(CDD_CONST_32_SECTION)
    *(CDD_CONST_16_SECTION)
    *(CDD_CONST_8_SECTION)
    *(CDD_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_cdd_const_end = .;

    .=align(4);
    __linker_can_const_start = .;
    . += FILL_LENGTH;
    *(CAN_CONST_UNSPECIFIED_SECTION)
    *(CAN_CONST_32_SECTION)
    *(CAN_CONST_16_SECTION)
    *(CAN_CONST_8_SECTION)
    *(CAN_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_can_const_end = .;

    .=align(4);
    __linker_pwm_const_start = .;
    . += FILL_LENGTH;
    *(PWM_CONST_UNSPECIFIED_SECTION)
    *(PWM_CONST_32_SECTION)
    *(PWM_CONST_16_SECTION)
    *(PWM_CONST_8_SECTION)
    *(PWM_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_pwm_const_end = .;

    .=align(4);
    __linker_adc_const_start = .;
    . += FILL_LENGTH;
    *(ADC_CONST_UNSPECIFIED_SECTION)
    *(ADC_CONST_32_SECTION)
    *(ADC_CONST_16_SECTION)
    *(ADC_CONST_8_SECTION)
    *(ADC_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_adc_const_end = .;

    .=align(4);
    __linker_eth_const_start = .;
    . += FILL_LENGTH;
    *(ETH_CONST_UNSPECIFIED_SECTION)
    *(ETH_CONST_32_SECTION)
    *(ETH_CONST_16_SECTION)
    *(ETH_CONST_8_SECTION)
    *(ETH_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_eth_const_end = .;

    .=align(4);
    __linker_ethtrcv_const_start = .;
    . += FILL_LENGTH;
    *(ETHTRCV_CONST_UNSPECIFIED_SECTION)
    *(ETHTRCV_CONST_32_SECTION)
    *(ETHTRCV_CONST_16_SECTION)
    *(ETHTRCV_CONST_8_SECTION)
    *(ETHTRCV_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_ethtrcv_const_end = .;

    .=align(4);
    __linker_fls_const_start = .;
    . += FILL_LENGTH;
    *(FLS_CONST_32_SECTION)
    *(FLS_CONST_UNSPECIFIED_SECTION)
    *(FLS_CONFIG_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_fls_const_end = .;
    }

    McalInitSection : align=4, load > MCAL_DATA
    {
    .=align(4);
    __linker_dio_init_start = .;
    . += FILL_LENGTH;
    *(DIO_DATA_INIT_UNSPECIFIED_SECTION)
    *(DIO_DATA_INIT_32_SECTION)
    *(DIO_DATA_INIT_16_SECTION)
    *(DIO_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_dio_init_end = .;

    .=align(4);
    __linker_gpt_init_start = .;
    . += FILL_LENGTH;
    *(GPT_DATA_INIT_UNSPECIFIED_SECTION)
    *(GPT_DATA_INIT_32_SECTION)
    *(GPT_DATA_INIT_16_SECTION)
    *(GPT_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_gpt_init_end = .;

    .=align(4);
    __linker_mcu_init_start = .;
    . += FILL_LENGTH;
    *(MCU_DATA_INIT_UNSPECIFIED_SECTION)
    *(MCU_DATA_INIT_32_SECTION)
    *(MCU_DATA_INIT_16_SECTION)
    *(MCU_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_mcu_init_end = .;

    .=align(4);
    __linker_port_init_start = .;
    . += FILL_LENGTH;
    *(PORT_DATA_INIT_UNSPECIFIED_SECTION)
    *(PORT_DATA_INIT_32_SECTION)
    *(PORT_DATA_INIT_16_SECTION)
    *(PORT_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_port_init_end = .;

    .=align(4);
    __linker_wdg_init_start = .;
    . += FILL_LENGTH;
    *(WDG_DATA_INIT_UNSPECIFIED_SECTION)
    *(WDG_DATA_INIT_32_SECTION)
    *(WDG_DATA_INIT_16_SECTION)
    *(WDG_DATA_INIT_8_SECTION)
    .=align(8);
    . += FILL_LENGTH;
    __linker_wdg_init_end = .;

    .=align(4);
    __linker_spi_init_start = .;
    . += FILL_LENGTH;
    *(SPI_DATA_INIT_UNSPECIFIED_SECTION)
    *(SPI_DATA_INIT_32_SECTION)
    *(SPI_DATA_INIT_16_SECTION)
    *(SPI_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_spi_init_end = .;

    .=align(4);
    __linker_cdd_init_start = .;
    . += FILL_LENGTH;
    *(CDD_DATA_INIT_UNSPECIFIED_SECTION)
    *(CDD_DATA_INIT_32_SECTION)
    *(CDD_DATA_INIT_16_SECTION)
    *(CDD_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_cdd_init_end = .;

    .=align(4);
    __linker_can_init_start = .;
    . += FILL_LENGTH;
    *(CAN_DATA_INIT_UNSPECIFIED_SECTION)
    *(CAN_DATA_INIT_32_SECTION)
    *(CAN_DATA_INIT_16_SECTION)
    *(CAN_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_can_init_end = .;

    .=align(4);
    __linker_pwm_init_start = .;
    . += FILL_LENGTH;
    *(PWM_DATA_INIT_UNSPECIFIED_SECTION)
    *(PWM_DATA_INIT_32_SECTION)
    *(PWM_DATA_INIT_16_SECTION)
    *(PWM_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_pwm_init_end = .;

    .=align(4);
    __linker_adc_init_start = .;
    . += FILL_LENGTH;
    *(ADC_DATA_INIT_UNSPECIFIED_SECTION)
    *(ADC_DATA_INIT_32_SECTION)
    *(ADC_DATA_INIT_16_SECTION)
    *(ADC_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_adc_init_end = .;

    .=align(4);
    __linker_eth_init_start = .;
    . += FILL_LENGTH;
    *(ETH_DATA_INIT_UNSPECIFIED_SECTION)
    *(ETH_DATA_INIT_32_SECTION)
    *(ETH_DATA_INIT_16_SECTION)
    *(ETH_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_eth_init_end = .;

    .=align(4);
    __linker_ethtrcv_init_start = .;
    . += FILL_LENGTH;
    *(ETHTRCV_DATA_INIT_UNSPECIFIED_SECTION)
    *(ETHTRCV_DATA_INIT_32_SECTION)
    *(ETHTRCV_DATA_INIT_16_SECTION)
    *(ETHTRCV_DATA_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_ethtrcv_init_end = .;

    .=align(4);
    __linker_fls_init_start = .;
    . += FILL_LENGTH;
    *(FLS_DATA_INIT_32_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_fls_init_end = .;
    }

    McalNoInitSection : align=4, load > MCAL_NOINIT, type = NOINIT
    {
    .=align(4);
    __linker_dio_no_init_start = .;
    . += FILL_LENGTH;
    *(DIO_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(DIO_DATA_NO_INIT_32_SECTION)
    *(DIO_DATA_NO_INIT_16_SECTION)
    *(DIO_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_dio_no_init_end = .;

    .=align(4);
    __linker_gpt_no_init_start = .;
    . += FILL_LENGTH;
    *(GPT_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(GPT_DATA_NO_INIT_32_SECTION)
    *(GPT_DATA_NO_INIT_16_SECTION)
    *(GPT_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_gpt_no_init_end = .;

    .=align(4);
    __linker_mcu_no_init_start = .;
    . += FILL_LENGTH;
    *(MCU_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(MCU_DATA_NO_INIT_32_SECTION)
    *(MCU_DATA_NO_INIT_16_SECTION)
    *(MCU_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_mcu_no_init_end = .;

    .=align(4);
    __linker_port_no_init_start = .;
    . += FILL_LENGTH;
    *(PORT_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(PORT_DATA_NO_INIT_32_SECTION)
    *(PORT_DATA_NO_INIT_16_SECTION)
    *(PORT_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_port_no_init_end = .;

    .=align(4);
    __linker_wdg_no_init_start = .;
    . += FILL_LENGTH;
    *(WDG_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(WDG_DATA_NO_INIT_32_SECTION)
    *(WDG_DATA_NO_INIT_16_SECTION)
    *(WDG_DATA_NO_INIT_8_SECTION)
    .=align(8);
    . += FILL_LENGTH;
    __linker_wdg_no_init_end = .;

    .=align(4);
    __linker_spi_no_init_start = .;
    . += FILL_LENGTH;
    *(SPI_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(SPI_DATA_NO_INIT_32_SECTION)
    *(SPI_DATA_NO_INIT_16_SECTION)
    *(SPI_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_spi_no_init_end = .;

    .=align(4);
    __linker_cdd_no_init_start = .;
    . += FILL_LENGTH;
    *(CDD_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(CDD_DATA_NO_INIT_32_SECTION)
    *(CDD_DATA_NO_INIT_16_SECTION)
    *(CDD_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_cdd_no_init_end = .;

    .=align(4);
    __linker_can_no_init_start = .;
    . += FILL_LENGTH;
    *(CAN_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(CAN_DATA_NO_INIT_32_SECTION)
    *(CAN_DATA_NO_INIT_16_SECTION)
    *(CAN_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_can_no_init_end = .;

    .=align(4);
    __linker_pwm_no_init_start = .;
    . += FILL_LENGTH;
    *(PWM_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(PWM_DATA_NO_INIT_32_SECTION)
    *(PWM_DATA_NO_INIT_16_SECTION)
    *(PWM_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_pwm_no_init_end = .;

    .=align(4);
    __linker_adc_no_init_start = .;
    . += FILL_LENGTH;
    *(ADC_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(ADC_DATA_NO_INIT_32_SECTION)
    *(ADC_DATA_NO_INIT_16_SECTION)
    *(ADC_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_adc_no_init_end = .;

    .=align(4);
    __linker_eth_no_init_start = .;
    . += FILL_LENGTH;
    *(ETH_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(ETH_DATA_NO_INIT_32_SECTION)
    *(ETH_DATA_NO_INIT_16_SECTION)
    *(ETH_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_eth_no_init_end = .;

    .=align(4);
    __linker_ethtrcv_no_init_start = .;
    . += FILL_LENGTH;
    *(ETHTRCV_DATA_NO_INIT_UNSPECIFIED_SECTION)
    *(ETHTRCV_DATA_NO_INIT_32_SECTION)
    *(ETHTRCV_DATA_NO_INIT_16_SECTION)
    *(ETHTRCV_DATA_NO_INIT_8_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_ethtrcv_no_init_end = .;

    .=align(4);
    __linker_fls_no_init_start = .;
    . += FILL_LENGTH;
    *(FLS_DATA_NO_INIT_UNSPECIFIED_SECTION)
    .=align(4);
    . += FILL_LENGTH;
    __linker_fls_no_init_end = .;
    }
    }

  • Hi

    The linker seems to be wrong, it's looking like you simply appended the MCAL's linker to the SDK's linker. This is not recommended because many of the parameters might get overwrittern for example like entry points, stack namings etc., 

    Please use the below linker command as a reference.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/2772.lnk_5F00_r5_5F00_am263_5F00_CLANG.cmd

  • Sorry Kowshik 

    I only use the first one also this:


    /* This is the stack that is used by code running within main()
    * In case of NORTOS,
    * - This means all the code outside of ISR uses this stack
    * In case of FreeRTOS
    * - This means all the code until vTaskStartScheduler() is called in main()
    * uses this stack.
    * - After vTaskStartScheduler() each task created in FreeRTOS has its own stack
    */
    --stack_size=16384
    /* This is the heap size for malloc() API in NORTOS and FreeRTOS
    * This is also the heap used by pvPortMalloc in FreeRTOS
    */
    --heap_size=512
    -emain /* This is the entry of the application, _vector MUST be plabed starting address 0x0 */

    /* This is the size of stack when R5 is in IRQ mode
    * In NORTOS,
    * - Here interrupt nesting is disabled as of now
    * - This is the stack used by ISRs registered as type IRQ
    * In FreeRTOS,
    * - Here interrupt nesting is enabled
    * - This is stack that is used initally when a IRQ is received
    * - But then the mode is switched to SVC mode and SVC stack is used for all user ISR callbacks
    * - Hence in FreeRTOS, IRQ stack size is less and SVC stack size is more
    */
    __IRQ_STACK_SIZE = 256;
    /* This is the size of stack when R5 is in IRQ mode
    * - In both NORTOS and FreeRTOS nesting is disabled for FIQ
    */
    __FIQ_STACK_SIZE = 256;
    __SVC_STACK_SIZE = 8192; /* This is the size of stack when R5 is in SVC mode */
    __ABORT_STACK_SIZE = 256; /* This is the size of stack when R5 is in ABORT mode */
    __UNDEFINED_STACK_SIZE = 256; /* This is the size of stack when R5 is in UNDEF mode */

    SECTIONS
    {
    /* This has the R5F entry point and vector table, this MUST be at 0x0 */
    .vectors:{} palign(8) > R5F_VECS

    /* This has the R5F boot code until MPU is enabled, this MUST be at a address < 0x80000000
    * i.e this cannot be placed in DDR
    */
    GROUP {
    .text.hwi: palign(8)
    .text.startup: palign(8) // Harbas A. for MCAL
    .text.cache: palign(8)
    .text.mpu: palign(8)
    .text.boot: palign(8)
    .text:abort: palign(8) /* this helps in loading symbols when using XIP mode */
    } > OCRAM

    /* This is rest of code. This can be placed in DDR if DDR is available and needed */
    GROUP {
    .text: {} palign(8) /* This is where code resides */
    .rodata: {} palign(8) /* This is where const's go */
    } > OCRAM

    /* This is rest of initialized data. This can be placed in DDR if DDR is available and needed */
    GROUP {

    .data: {} palign(8) /* This is where initialized globals and static go */
    } > OCRAM

    /* This is rest of uninitialized data. This can be placed in DDR if DDR is available and needed */
    GROUP {
    .bss: {} palign(8) /* This is where uninitialized globals go */
    RUN_START(__BSS_START)
    RUN_END(__BSS_END)
    .sysmem: {} palign(8) /* This is where the malloc heap goes */
    .stack: {} palign(8) /* This is where the main() stack goes */
    } > OCRAM

    /* This is where the stacks for different R5F modes go */
    GROUP {
    .irqstack: {. = . + __IRQ_STACK_SIZE;} align(8)
    RUN_START(__IRQ_STACK_START)
    RUN_END(__IRQ_STACK_END)
    .fiqstack: {. = . + __FIQ_STACK_SIZE;} align(8)
    RUN_START(__FIQ_STACK_START)
    RUN_END(__FIQ_STACK_END)
    .svcstack: {. = . + __SVC_STACK_SIZE;} align(8)
    RUN_START(__SVC_STACK_START)
    RUN_END(__SVC_STACK_END)
    .abortstack: {. = . + __ABORT_STACK_SIZE;} align(8)
    RUN_START(__ABORT_STACK_START)
    RUN_END(__ABORT_STACK_END)
    .undefinedstack: {. = . + __UNDEFINED_STACK_SIZE;} align(8)
    RUN_START(__UNDEFINED_STACK_START)
    RUN_END(__UNDEFINED_STACK_END)
    } > OCRAM

    /* Sections needed for C++ projects */
    GROUP {
    .ARM.exidx: {} palign(8) /* Needed for C++ exception handling */
    .init_array: {} palign(8) /* Contains function pointers called before main */
    .fini_array: {} palign(8) /* Contains function pointers called after main */
    } > OCRAM

    /* General purpose user shared memory, used in some examples */
    .bss.user_shared_mem (NOLOAD) : {} > USER_SHM_MEM
    /* this is used when Debug log's to shared memory are enabled, else this is not used */
    .bss.log_shared_mem (NOLOAD) : {} > LOG_SHM_MEM
    /* this is used only when IPC RPMessage is enabled, else this is not used */
    .bss.ipc_vring_mem (NOLOAD) : {} > RTOS_NORTOS_IPC_SHM_MEM
    }

    MEMORY
    {
    R5F_VECS : ORIGIN = 0x00000000 , LENGTH = 0x00000040
    R5F_TCMA : ORIGIN = 0x00000040 , LENGTH = 0x00007FC0
    R5F_TCMB : ORIGIN = 0x00080000 , LENGTH = 0x00008000

    /* when using multi-core application's i.e more than one R5F/M4F active, make sure
    * this memory does not overlap with other R5F's
    */
    OCRAM : ORIGIN = 0x70040000 , LENGTH = 0x40000 /* Harbas 0x80000 */

    /* This section can be used to put XIP section of the application in flash, make sure this does not overlap with
    * other CPUs. Also make sure to add a MPU entry for this section and mark it as cached and code executable
    */
    FLASH : ORIGIN = 0x60100000 , LENGTH = 0x80000


    /* shared memories that are used by RTOS/NORTOS cores */
    /* On R5F,
    * - make sure there is a MPU entry which maps below regions as non-cache
    */
    USER_SHM_MEM : ORIGIN = 0x701D0000, LENGTH = 0x00004000
    LOG_SHM_MEM : ORIGIN = 0x701D4000, LENGTH = 0x00004000
    /* MSS mailbox memory is used as shared memory, we dont use bottom 32*12 bytes, since its used as SW queue by ipc_notify */
    RTOS_NORTOS_IPC_SHM_MEM : ORIGIN = 0x72000000, LENGTH = 0x3E80}

  • Hi

    I guess it's still not correct because you're using the SDK's linker file for the MCAL code which causes compatibility issues. Please use the linker file I attached in my previous reply as a reference and build on top of it please.

    Thanks,
    G Kowshik 

  • HI Kowshik 

    Can you do it for me? I think this is out of my knowledge. so I can copy back to my project. Or Can we do a live session?

  • This is already inside the linker. and the size SVC is also already 4096

  • Hi Panda Bear,

    The linker file you're showing is from the SDK, please use the below attached linker once (this has the portability issues fixed to an extent and lets you initialize the vector tables etc., correctly)

    /*
     * STACK SIZE MACRO DEFINITIONS
     */
    #define M_USER_STACK_SIZE   0x1800   /* Multiple of 8 bytes - 6KB */
    #define M_PREV_STACK_SIZE   0x10    /* Multiple of 8 bytes - 16B */
    
    /*
     * LINKER OPTIONS
     */
    --entry_point=_c_int000                   /* ENTRY POINT                   */
    --stack_size=16384
    /* This is the heap size for malloc() API in NORTOS and FreeRTOS
     * This is also the heap used by pvPortMalloc in FreeRTOS
     */
    --heap_size=32768
    -e_vectors  /* This is the entry of the application, _vector MUST be plabed starting address 0x0 */
    
    /* SPECIFY THE SYSTEM MEMORY MAP */
    
    MEMORY{
    PAGE 0:
        VECTORS  (X)  : origin=0x102EF000 length=0x00001000
        /*  Reset Vectors base address(RESET_VECTORS) should be 64 bytes aligned  */
        RESET_VECTORS (X) : origin=0x00000000 length=0x100
        /* RESET_VECTORS (X) : origin=0x00020000 length=0x100 */
        TCMA_RAM (RX) : origin=0x00000100 length=0x00003F00
        TCMB_RAM (RW) : origin=0x00080000 length=0x00004000
        L2_RAM_BANK0 (RW) : origin=0x70000000 length=0x40000
       
        L3_RAM (RW)   : origin=0x88000000 length=0x00300000
        HWA_RAM (RW)  : origin=0x28000000 length=0x00020000
    
    PAGE 1:
        L3_RAM (RW)   : origin=0x88000000 length=0x00300000
    }
    
        --define=MCAL_CODE1=L2_RAM_BANK0
        --define=MCAL_CODE2=L2_RAM_BANK0
        --define=MCAL_DATA=L2_RAM_BANK0
        --define=MCAL_BSS=L2_RAM_BANK0
        --define=MCAL_NOINIT=L2_RAM_BANK0
        --define=MCAL_CONST=L2_RAM_BANK0
        --define FILL_PATTERN=0xFEAA55EF
        --define FILL_LENGTH=0x100
    
    /* Stack Sizes for various modes */
    __IRQ_STACK_SIZE = 256;
    __FIQ_STACK_SIZE = 256;
    __ABORT_STACK_SIZE = 256;
    __UND_STACK_SIZE = 256;
    __SVC_STACK_SIZE = 4096;
    
    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
    
    SECTIONS
    {
        /* This has the R5F entry point and vector table, this MUST be at 0x0 */
        .vectors:{} palign(8) > RESET_VECTORS
        .startup       : {} palign(8)      > TCMA_RAM
        .systcmsysvimRam :                 > TCMA_RAM
    
        /* TEXT SECTION - Executable Code */
        .text               :                    >  MCAL_CODE1, fill=FILL_PATTERN
        {
            .=align(4);
            __linker_text_start = .;
            . += FILL_LENGTH;
            *(.text)
            .=align(4);
            . += FILL_LENGTH;
            __linker_text_end = .;
        }
    
        /* CONST SECTION - Initialized Global Variables */
        .const      : load > MCAL_CONST, fill=FILL_PATTERN
        {
            .=align(4);
            __linker_const_start = .;
            . += FILL_LENGTH;
            *(.const)
            .=align(4);
            . += FILL_LENGTH;
            __linker_const_end = .;
        }
    
        /* RODATA SECTION - Initialized Static Variables */
        .rodata      : load > MCAL_CONST, fill=FILL_PATTERN
        {
            .=align(4);
            __linker_rodata_start = .;
            . += FILL_LENGTH;
            *(.const)
            .=align(4);
            . += FILL_LENGTH;
            __linker_rodata_end = .;
        }
    
        /* DATA SECTION - Initialized Data */
        .data       : load > MCAL_DATA
        {
            .=align(4);
            __linker_data_start = .;
            . += FILL_LENGTH;
            *(.data)
            .=align(4);
            . += FILL_LENGTH;
            __linker_data_end = .;
        }
    
        /* BSS SECTION - Contains Uninitialized Global variables */
        .bss        : load > MCAL_BSS
                        RUN_START(__BSS_START)
                        RUN_END(__BSS_END)
        {
            .=align(4);
            __linker_bss_start = .;
            . += FILL_LENGTH;
            *(.bss)
            .=align(4);
            . += FILL_LENGTH;
            __linker_bss_end = .;
        }
    
        /* CINIT SECTION - Tables which initializes global variables */
        .cinit      : load > MCAL_DATA
    
        /* STACK - System Stack */
        .stack      : load > MCAL_DATA, fill=FILL_PATTERN
    
        /* SYSMEM - Heap Memory */
        .sysmem     : load > MCAL_DATA
    
         /* MCPI Log Buffer */
        .MCPILogBuffer : load > MCAL_DATA
        McalTextSection : fill=FILL_PATTERN, align=4, load > MCAL_CODE1
        {
            .=align(4);
            __linker_dio_text_start = .;
            . += FILL_LENGTH;
            *(DIO_TEXT_SECTION)
            *(DIO_ISR_TEXT_SECTION)
            *(DIO_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_dio_text_end = .;
    
            .=align(4);
            __linker_gpt_text_start = .;
            . += FILL_LENGTH;
            *(GPT_TEXT_SECTION)
            *(GPT_ISR_TEXT_SECTION)
            *(GPT_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_gpt_text_end = .;
    
            .=align(4);
            __linker_mcu_text_start = .;
            . += FILL_LENGTH;
            *(MCU_TEXT_SECTION)
            *(MCU_ISR_TEXT_SECTION)
            *(MCU_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_mcu_text_end = .;
    
            .=align(4);
            __linker_port_text_start = .;
            . += FILL_LENGTH;
            *(PORT_TEXT_SECTION)
            *(PORT_ISR_TEXT_SECTION)
            *(PORT_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_port_text_end = .;
    
            .=align(4);
            __linker_wdg_text_start = .;
            . += FILL_LENGTH;
            *(WDG_TEXT_SECTION)
            *(WDG_ISR_TEXT_SECTION)
            *(WDG_CALLOUT_TEXT_SECTION)
            .=align(8);
            . += FILL_LENGTH;
            __linker_wdg_text_end = .;
    
    		.=align(4);
            __linker_spi_text_start = .;
            . += FILL_LENGTH;
            *(SPI_TEXT_SECTION)
            *(SPI_ISR_TEXT_SECTION)
            *(SPI_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_spi_text_end = .;
    
    		.=align(4);
            __linker_cdd_text_start = .;
            . += FILL_LENGTH;
            *(CDD_TEXT_SECTION)
            *(CDD_ISR_TEXT_SECTION)
            *(CDD_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_cdd_text_end = .;
    
            .=align(4);
            __linker_can_text_start = .;
            . += FILL_LENGTH;
            *(CAN_TEXT_SECTION)
            *(CAN_ISR_TEXT_SECTION)
            *(CAN_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_can_text_end = .;
    
            .=align(4);
            __linker_pwm_text_start = .;
            . += FILL_LENGTH;
            *(PWM_TEXT_SECTION)
            *(PWM_ISR_TEXT_SECTION)
            *(PWM_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_pwm_text_end = .;
    
            .=align(4);
            __linker_adc_text_start = .;
            . += FILL_LENGTH;
            *(ADC_TEXT_SECTION)
            *(ADC_ISR_TEXT_SECTION)
            *(ADC_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_adc_text_end = .;
    		
    		.=align(4);
            __linker_eth_text_start = .;
            . += FILL_LENGTH;
            *(ETH_TEXT_SECTION)
            *(ETH_ISR_TEXT_SECTION)
            *(ETH_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_eth_text_end = .;
    	
    		.=align(4);
            __linker_ethtrcv_text_start = .;
            . += FILL_LENGTH;
            *(ETHTRCV_TEXT_SECTION)
            *(ETHTRCV_ISR_TEXT_SECTION)
            *(ETHTRCV_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_ethtrcv_text_end = .;
    	
    		        .=align(4);
            __linker_fls_text_start = .;
            . += FILL_LENGTH;
            *(FLS_TEXT_SECTION)
            *(FLS_ISR_TEXT_SECTION)
            *(FLS_CALLOUT_TEXT_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_fls_text_end = .;
        }
    
        McalConstSection : fill=FILL_PATTERN, align=4, load > MCAL_CONST
        {
            .=align(4);
            __linker_dio_const_start = .;
            . += FILL_LENGTH;
            *(DIO_CONST_UNSPECIFIED_SECTION)
            *(DIO_CONST_32_SECTION)
            *(DIO_CONST_16_SECTION)
            *(DIO_CONST_8_SECTION)
            *(DIO_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_dio_const_end = .;
    
            .=align(4);
            __linker_gpt_const_start = .;
            . += FILL_LENGTH;
            *(GPT_CONST_UNSPECIFIED_SECTION)
            *(GPT_CONST_32_SECTION)
            *(GPT_CONST_16_SECTION)
            *(GPT_CONST_8_SECTION)
            *(GPT_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_gpt_const_end = .;
    
            .=align(4);
            __linker_mcu_const_start = .;
            . += FILL_LENGTH;
            *(MCU_CONST_UNSPECIFIED_SECTION)
            *(MCU_CONST_32_SECTION)
            *(MCU_CONST_16_SECTION)
            *(MCU_CONST_8_SECTION)
            *(MCU_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_mcu_const_end = .;
    
            .=align(4);
            __linker_port_const_start = .;
            . += FILL_LENGTH;
            *(PORT_CONST_UNSPECIFIED_SECTION)
            *(PORT_CONST_32_SECTION)
            *(PORT_CONST_16_SECTION)
            *(PORT_CONST_8_SECTION)
            *(PORT_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_port_const_end = .;
    
            .=align(4);
            __linker_wdg_const_start = .;
            . += FILL_LENGTH;
            *(WDG_CONST_UNSPECIFIED_SECTION)
            *(WDG_CONST_32_SECTION)
            *(WDG_CONST_16_SECTION)
            *(WDG_CONST_8_SECTION)
            *(WDG_CONFIG_SECTION)
            .=align(8);
            . += FILL_LENGTH;
            __linker_wdg_const_end = .;
    
    		.=align(4);
            __linker_spi_const_start = .;
            . += FILL_LENGTH;
            *(SPI_CONST_UNSPECIFIED_SECTION)
            *(SPI_CONST_32_SECTION)
            *(SPI_CONST_16_SECTION)
            *(SPI_CONST_8_SECTION)
            *(SPI_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_spi_const_end = .;
    
    		.=align(4);
            __linker_cdd_const_start = .;
            . += FILL_LENGTH;
            *(CDD_CONST_UNSPECIFIED_SECTION)
            *(CDD_CONST_32_SECTION)
            *(CDD_CONST_16_SECTION)
            *(CDD_CONST_8_SECTION)
            *(CDD_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_cdd_const_end = .;
    
            .=align(4);
            __linker_can_const_start = .;
            . += FILL_LENGTH;
            *(CAN_CONST_UNSPECIFIED_SECTION)
            *(CAN_CONST_32_SECTION)
            *(CAN_CONST_16_SECTION)
            *(CAN_CONST_8_SECTION)
            *(CAN_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_can_const_end = .;
    
            .=align(4);
            __linker_pwm_const_start = .;
            . += FILL_LENGTH;
            *(PWM_CONST_UNSPECIFIED_SECTION)
            *(PWM_CONST_32_SECTION)
            *(PWM_CONST_16_SECTION)
            *(PWM_CONST_8_SECTION)
            *(PWM_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_pwm_const_end = .;
    
            .=align(4);
            __linker_adc_const_start = .;
            . += FILL_LENGTH;
            *(ADC_CONST_UNSPECIFIED_SECTION)
            *(ADC_CONST_32_SECTION)
            *(ADC_CONST_16_SECTION)
            *(ADC_CONST_8_SECTION)
            *(ADC_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_adc_const_end = .;
    		
    		.=align(4);
            __linker_eth_const_start = .;
            . += FILL_LENGTH;
            *(ETH_CONST_UNSPECIFIED_SECTION)
            *(ETH_CONST_32_SECTION)
            *(ETH_CONST_16_SECTION)
            *(ETH_CONST_8_SECTION)
            *(ETH_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_eth_const_end = .;
        
    		.=align(4);
            __linker_ethtrcv_const_start = .;
            . += FILL_LENGTH;
            *(ETHTRCV_CONST_UNSPECIFIED_SECTION)
            *(ETHTRCV_CONST_32_SECTION)
            *(ETHTRCV_CONST_16_SECTION)
            *(ETHTRCV_CONST_8_SECTION)
            *(ETHTRCV_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_ethtrcv_const_end = .;
    	
    			.=align(4);
            __linker_fls_const_start = .;
            . += FILL_LENGTH;
            *(FLS_CONST_32_SECTION)
            *(FLS_CONST_UNSPECIFIED_SECTION)
            *(FLS_CONFIG_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_fls_const_end = .;
        }
    
        McalInitSection : align=4, load > MCAL_DATA
        {
            .=align(4);
            __linker_dio_init_start = .;
            . += FILL_LENGTH;
            *(DIO_DATA_INIT_UNSPECIFIED_SECTION)
            *(DIO_DATA_INIT_32_SECTION)
            *(DIO_DATA_INIT_16_SECTION)
            *(DIO_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_dio_init_end = .;
    
            .=align(4);
            __linker_gpt_init_start = .;
            . += FILL_LENGTH;
            *(GPT_DATA_INIT_UNSPECIFIED_SECTION)
            *(GPT_DATA_INIT_32_SECTION)
            *(GPT_DATA_INIT_16_SECTION)
            *(GPT_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_gpt_init_end = .;
    
            .=align(4);
            __linker_mcu_init_start = .;
            . += FILL_LENGTH;
            *(MCU_DATA_INIT_UNSPECIFIED_SECTION)
            *(MCU_DATA_INIT_32_SECTION)
            *(MCU_DATA_INIT_16_SECTION)
            *(MCU_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_mcu_init_end = .;
    
            .=align(4);
            __linker_port_init_start = .;
            . += FILL_LENGTH;
            *(PORT_DATA_INIT_UNSPECIFIED_SECTION)
            *(PORT_DATA_INIT_32_SECTION)
            *(PORT_DATA_INIT_16_SECTION)
            *(PORT_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_port_init_end = .;
    
            .=align(4);
            __linker_wdg_init_start = .;
            . += FILL_LENGTH;
            *(WDG_DATA_INIT_UNSPECIFIED_SECTION)
            *(WDG_DATA_INIT_32_SECTION)
            *(WDG_DATA_INIT_16_SECTION)
            *(WDG_DATA_INIT_8_SECTION)
            .=align(8);
            . += FILL_LENGTH;
            __linker_wdg_init_end = .;
    
    		 .=align(4);
            __linker_spi_init_start = .;
            . += FILL_LENGTH;
            *(SPI_DATA_INIT_UNSPECIFIED_SECTION)
            *(SPI_DATA_INIT_32_SECTION)
            *(SPI_DATA_INIT_16_SECTION)
            *(SPI_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_spi_init_end = .;
    
    		.=align(4);
            __linker_cdd_init_start = .;
            . += FILL_LENGTH;
            *(CDD_DATA_INIT_UNSPECIFIED_SECTION)
            *(CDD_DATA_INIT_32_SECTION)
            *(CDD_DATA_INIT_16_SECTION)
            *(CDD_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_cdd_init_end = .;
    
            .=align(4);
            __linker_can_init_start = .;
            . += FILL_LENGTH;
            *(CAN_DATA_INIT_UNSPECIFIED_SECTION)
            *(CAN_DATA_INIT_32_SECTION)
            *(CAN_DATA_INIT_16_SECTION)
            *(CAN_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_can_init_end = .;
    
            .=align(4);
            __linker_pwm_init_start = .;
            . += FILL_LENGTH;
            *(PWM_DATA_INIT_UNSPECIFIED_SECTION)
            *(PWM_DATA_INIT_32_SECTION)
            *(PWM_DATA_INIT_16_SECTION)
            *(PWM_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_pwm_init_end = .;
    
            .=align(4);
            __linker_adc_init_start = .;
            . += FILL_LENGTH;
            *(ADC_DATA_INIT_UNSPECIFIED_SECTION)
            *(ADC_DATA_INIT_32_SECTION)
            *(ADC_DATA_INIT_16_SECTION)
            *(ADC_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_adc_init_end = .;
    		
    		  .=align(4);
            __linker_eth_init_start = .;
            . += FILL_LENGTH;
            *(ETH_DATA_INIT_UNSPECIFIED_SECTION)
            *(ETH_DATA_INIT_32_SECTION)
            *(ETH_DATA_INIT_16_SECTION)
            *(ETH_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_eth_init_end = .;
    	
    		  .=align(4);
            __linker_ethtrcv_init_start = .;
            . += FILL_LENGTH;
            *(ETHTRCV_DATA_INIT_UNSPECIFIED_SECTION)
            *(ETHTRCV_DATA_INIT_32_SECTION)
            *(ETHTRCV_DATA_INIT_16_SECTION)
            *(ETHTRCV_DATA_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_ethtrcv_init_end = .;
    	
    			.=align(4);
            __linker_fls_init_start = .;
            . += FILL_LENGTH;
            *(FLS_DATA_INIT_32_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_fls_init_end = .;
        }
    
        McalNoInitSection : align=4, load > MCAL_NOINIT, type = NOINIT
        {
            .=align(4);
            __linker_dio_no_init_start = .;
            . += FILL_LENGTH;
            *(DIO_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(DIO_DATA_NO_INIT_32_SECTION)
            *(DIO_DATA_NO_INIT_16_SECTION)
            *(DIO_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_dio_no_init_end = .;
    
            .=align(4);
            __linker_gpt_no_init_start = .;
            . += FILL_LENGTH;
            *(GPT_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(GPT_DATA_NO_INIT_32_SECTION)
            *(GPT_DATA_NO_INIT_16_SECTION)
            *(GPT_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_gpt_no_init_end = .;
    
            .=align(4);
            __linker_mcu_no_init_start = .;
            . += FILL_LENGTH;
            *(MCU_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(MCU_DATA_NO_INIT_32_SECTION)
            *(MCU_DATA_NO_INIT_16_SECTION)
            *(MCU_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_mcu_no_init_end = .;
    
            .=align(4);
            __linker_port_no_init_start = .;
            . += FILL_LENGTH;
            *(PORT_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(PORT_DATA_NO_INIT_32_SECTION)
            *(PORT_DATA_NO_INIT_16_SECTION)
            *(PORT_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_port_no_init_end = .;
    
            .=align(4);
            __linker_wdg_no_init_start = .;
            . += FILL_LENGTH;
            *(WDG_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(WDG_DATA_NO_INIT_32_SECTION)
            *(WDG_DATA_NO_INIT_16_SECTION)
            *(WDG_DATA_NO_INIT_8_SECTION)
            .=align(8);
            . += FILL_LENGTH;
            __linker_wdg_no_init_end = .;
    
    		 .=align(4);
            __linker_spi_no_init_start = .;
            . += FILL_LENGTH;
            *(SPI_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(SPI_DATA_NO_INIT_32_SECTION)
            *(SPI_DATA_NO_INIT_16_SECTION)
            *(SPI_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_spi_no_init_end = .;
    
    		.=align(4);
            __linker_cdd_no_init_start = .;
            . += FILL_LENGTH;
            *(CDD_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(CDD_DATA_NO_INIT_32_SECTION)
            *(CDD_DATA_NO_INIT_16_SECTION)
            *(CDD_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_cdd_no_init_end = .;
    
            .=align(4);
            __linker_can_no_init_start = .;
            . += FILL_LENGTH;
            *(CAN_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(CAN_DATA_NO_INIT_32_SECTION)
            *(CAN_DATA_NO_INIT_16_SECTION)
            *(CAN_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_can_no_init_end = .;
    
            .=align(4);
            __linker_pwm_no_init_start = .;
            . += FILL_LENGTH;
            *(PWM_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(PWM_DATA_NO_INIT_32_SECTION)
            *(PWM_DATA_NO_INIT_16_SECTION)
            *(PWM_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_pwm_no_init_end = .;
    
            .=align(4);
            __linker_adc_no_init_start = .;
            . += FILL_LENGTH;
            *(ADC_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(ADC_DATA_NO_INIT_32_SECTION)
            *(ADC_DATA_NO_INIT_16_SECTION)
            *(ADC_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_adc_no_init_end = .;
    		
    		     .=align(4);
            __linker_eth_no_init_start = .;
            . += FILL_LENGTH;
            *(ETH_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(ETH_DATA_NO_INIT_32_SECTION)
            *(ETH_DATA_NO_INIT_16_SECTION)
            *(ETH_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_eth_no_init_end = .;
    	
    		     .=align(4);
            __linker_ethtrcv_no_init_start = .;
            . += FILL_LENGTH;
            *(ETHTRCV_DATA_NO_INIT_UNSPECIFIED_SECTION)
            *(ETHTRCV_DATA_NO_INIT_32_SECTION)
            *(ETHTRCV_DATA_NO_INIT_16_SECTION)
            *(ETHTRCV_DATA_NO_INIT_8_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_ethtrcv_no_init_end = .;
    	
    			.=align(4);
            __linker_fls_no_init_start = .;
            . += FILL_LENGTH;
            *(FLS_DATA_NO_INIT_UNSPECIFIED_SECTION)
            .=align(4);
            . += FILL_LENGTH;
            __linker_fls_no_init_end = .;
        }
        /* MCU+SDK */
        /* This is where the stacks for different R5F modes go */
        GROUP {
            .irqstack: {. = . + __IRQ_STACK_SIZE;} align(8)
            RUN_START(__IRQ_STACK_START)
            RUN_END(__IRQ_STACK_END)
            .fiqstack: {. = . + __FIQ_STACK_SIZE;} align(8)
            RUN_START(__FIQ_STACK_START)
            RUN_END(__FIQ_STACK_END)
            .svcstack: {. = . + __SVC_STACK_SIZE;} align(8)
            RUN_START(__SVC_STACK_START)
            RUN_END(__SVC_STACK_END)
            .abortstack: {. = . + __ABORT_STACK_SIZE;} align(8)
            RUN_START(__ABORT_STACK_START)
            RUN_END(__ABORT_STACK_END)
            .undefinedstack: {. = . + __UND_STACK_SIZE;} align(8)
            RUN_START(__UNDEFINED_STACK_START)
            RUN_END(__UNDEFINED_STACK_END)
        } > L2_RAM_BANK0
    }
    
    

    Thanks