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
已解决! 转到解答。
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
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