how to include a section multiple times via LCF file (in CW 10.3)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to include a section multiple times via LCF file (in CW 10.3)

Jump to solution
800 Views
TugboatCaptain
Contributor III

When a section is located into a memory using a wildcard, it only locates items in that wildcard not already located.  How can we locate something twice?

 

#LCF snippet:

 

    .firstsection:

    {

        *(.mysection)

    } > firstmemblock

 

    .secondsection:

    {

        *(.mysection)     # this does not include anything because the items have already been included elsewhere

    } > secondmemblock


Thanks,

Cap

 

Labels (1)
0 Kudos
Reply
1 Solution
669 Views
TugboatCaptain
Contributor III

Agreed, I could not find a way either.

It was for data tables that needed to appear in multiple places given some would be modified at runtime in flash.  It was mainly a convenience to only maintain one copy in the source instead of several.

solution: In the end I just made identical objects in the code in unique section names.

Thanks,

Cap

View solution in original post

0 Kudos
Reply
3 Replies
669 Views
trytohelp
NXP Employee
NXP Employee

Hello Cap,

Do you want to have the same code inside the 2 memory blocks ?

I don't think there is a way to duplicate it directly in the lcf file.

I don't undertand how this could be used in an application.

Regards

Pascal

Regards

Pascal

0 Kudos
Reply
670 Views
TugboatCaptain
Contributor III

Agreed, I could not find a way either.

It was for data tables that needed to appear in multiple places given some would be modified at runtime in flash.  It was mainly a convenience to only maintain one copy in the source instead of several.

solution: In the end I just made identical objects in the code in unique section names.

Thanks,

Cap

0 Kudos
Reply
669 Views
trytohelp
NXP Employee
NXP Employee

Cap,

we have a process using Copy ROM to RAM.

Not sure if this can help in this case.

This process is explained in the \MCU\Help\PDF\DSC_Compiler.pdf manual

Refer to 7.2.8 ROM to RAM Copying.

Regards

Pascal

0 Kudos
Reply