Copying EWL function to RAM

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

Copying EWL function to RAM

ソリューションへジャンプ
1,268件の閲覧回数
happyhands
Contributor I

Hello,

 

I have successfully copied and ran functions to RAM.  I am using a MCF51AC256 (ColdFire v1) and one of my RAM functions uses a division but the corresponding EWL __ldivu__ function is still in rom.  To put it in ram, I have tried to use the linker LCF file like this:

 

 

  .data : AT(___ROM_AT)
  {

 

 

   ...

 

 

    __START_SDATA = .;
    *(.sdata)
    *(.ram_code)
    OBJECT (__ldivu__, CF_runtime.c)
    . = ALIGN (0x4);
    __END_SDATA = .;

    ___DATA_END = .;
    __SDA_BASE = .;
    . = ALIGN (0x4);
  } >> userram

 

 

But it said it can't find __ldivu__.  I also tried:

 

 

CF_runtime.c (.text)

 

 

But it said it can't find CF_runtime.c even if the right path is listed in the ColdFire Linker Tool Settings Command Options.

I also tried the same thing with CF_runtime.o and librt.a

 

How do I tell the linker to put an EWL function into RAM?

 

Thank you

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
993件の閲覧回数
CrasyCat
Specialist III

Hello

 

There are 2 problems here.

 

1- Inside of the .lcf file you need to use the function linkage name.

    The compiler internally adds a _ prefix to all objects with global scope.

    So the linkage name for function __ldivu__ is ___ldivu__ (3 leading underscore characters).

 

2- As the function is stored in the library file you need to reference the library name in the OBJECT command.

    Please check the .xMAP file to retrieve the exact name of the library you are using.

 

The OBJECT command should then look as follows (provided you are linking the library librt.a to your application):

         OBJECT( ___ldivu__, librt.a)


 

CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
994件の閲覧回数
CrasyCat
Specialist III

Hello

 

There are 2 problems here.

 

1- Inside of the .lcf file you need to use the function linkage name.

    The compiler internally adds a _ prefix to all objects with global scope.

    So the linkage name for function __ldivu__ is ___ldivu__ (3 leading underscore characters).

 

2- As the function is stored in the library file you need to reference the library name in the OBJECT command.

    Please check the .xMAP file to retrieve the exact name of the library you are using.

 

The OBJECT command should then look as follows (provided you are linking the library librt.a to your application):

         OBJECT( ___ldivu__, librt.a)


 

CrasyCat

0 件の賞賛
返信
993件の閲覧回数
happyhands
Contributor I

Thank you.

 

The linker does recongize it now.  It says "___ldivu__(.text) in file librt.a was already linked in", but I'll take care of that.

 

Cheers

0 件の賞賛
返信