cx6812 can not link code correctly

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

cx6812 can not link code correctly

1,764件の閲覧回数
hbch
Contributor III
Hi,All,

I use cosmic cx6812 compiler which version is V4.6.8.

I found a  problem in linker.
The configuration in .lkf is this:

+def __FLASH_PAGED_31_START_PHY=0xC4000
+def __FLASH_PAGED_31_START_LOG=0x8000

## PPAGE = 0x31
+seg .ftext -b __FLASH_PAGED_31_START_PHY -o __FLASH_PAGED_31_START_LOG -w __PAGE_SIZE -m __SIZE_OF_FLASH -n .program_31 -sCODE
+seg .const -a .program_31  -n .const_31  -sCODE
#code here
   D:\control_code\CANBoot_DP512_cosmic\canloader.o

+def __END_OF_FLASH_PAGED_31_ACTUAL=pend(.const_31)        

After linking, the map file is following:
D:\control_code\CANBoot_DP512_cosmic\canloader.o:
start 00000000 end 000006c3 length  1731 section .text
start 00003e62 end 0000808c length 16938 section .debug

The linking result is different from my lkf configuration.
What is wrong with my project?
Can anyone help me?

ラベル(1)
0 件の賞賛
返信
1 返信

906件の閲覧回数
Pedro_
Contributor III
In your linker file, you have define an .ftext area where functions declared as @far would be placed, however, your functions must have been declared as @near (default).
 
Make sure to add @far or to compile using the modf switch.
 
example:
@far void myFunction (void);
 
@far void myFunction (void)
{
}
0 件の賞賛
返信