L1907 linker error

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

L1907 linker error

跳至解决方案
1,292 次查看
stevec
Contributor III

I have some link errors:

Link Error   : L1907: Fixup overflow in initialise, to avail_msg_list type 1, at offset 0x3B

 

 

Link Error   : L1907: Fixup overflow in initialise, to msg_order_list type 1, at offset 0x3D

 

 

Link Error   : L1907: Fixup overflow in initialise, to message_lengths type 1, at offset 0x3F

 

 

Link Error   : Link failed

 

I defined the segments I wanted the variable arrays to go in

#pragma DATA_SEG FAR_RAM

 

unsigned char avail_msg_list[30];     //table of empty record slots

unsigned char msg_order_list[30];     //table of order of messages

unsigned char message_lengths[30];     //length in pages of each message

 

#pragma DATA_SEG DEFAULT

 

I need these to go into non zero page RAM to free up the zero page area (9S08QE8)

 

I get the failures here:

   for(i = 0; i < 30; i++)

   {

      avail_msg_list[i] = i + 1;      //set up table with 1 to 30

      msg_order_list[i] = 0;          //zero msg order list so no msgs played

      message_lengths[i] = 0;          //zero message lengths table entries...probably not necessary

   }

 

Any suggestions as to what I am doing wrong?

 

Steve



标签 (1)
0 项奖励
回复
1 解答
1,050 次查看
BlackNight
NXP Employee
NXP Employee

Maybe now I see it:

#pragma DATA_SEG FAR_RAM

does  not make it far (it is using the default address size which is 8bit).

I think the syntax is

#pragma DATA_SEG FAR FAR_RAM

Can you try this?

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,050 次查看
BlackNight
NXP Employee
NXP Employee

Are you using these 3 arrays somewhere else too?

Make sure that the header file knows about the pragma too:

#pragma DATA_SEG FAR_RAM

extern unsigned char avail_msg_list[30]; 

extern unsigned char msg_order_list[30];

extern unsigned char message_lengths[30];

#pragma DATA_SEG DEFAULT


Then: in the linker file, have you allocated the FAR_RAM outside the zero page too?


I hope this helps.

0 项奖励
回复
1,050 次查看
stevec
Contributor III

Erich,

Yes I have made the arrays extern in the .h file and the FAR_RAM is specified in the .prm file

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */

    FAR_RAM    ,                        /* non-zero page variables */

                                       INTO  RAM;

But I still get the link error.


Steve

0 项奖励
回复
1,051 次查看
BlackNight
NXP Employee
NXP Employee

Maybe now I see it:

#pragma DATA_SEG FAR_RAM

does  not make it far (it is using the default address size which is 8bit).

I think the syntax is

#pragma DATA_SEG FAR FAR_RAM

Can you try this?

0 项奖励
回复
1,050 次查看
stevec
Contributor III

Erich,

That seems to have sorted it. Many thanks. I thought that telling the compiler where in memory the variables were stored would automatically sort out the addressing mode. I get no compiler/linker errors now thanks. Now to check that the code does what I want it too.

Steve

0 项奖励
回复