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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,277 次查看
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

 

标签 (1)
0 项奖励
回复
1 解答
1,146 次查看
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 项奖励
回复
3 回复数
1,146 次查看
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 项奖励
回复
1,147 次查看
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 项奖励
回复
1,146 次查看
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 项奖励
回复