This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM57L843: RM57L843 and MPIR library

Part Number: RM57L843

hello everyone


I have the following problem which I couldn't solve so far:

for a project in my UNI I need to write a program which uses an external library in this case MPIR (Multiple Precision Integers and Rationals), following the instructions of the library; I built it using Microsoft Visual studio for generic c and got the files
1. Header: mpir.h 

2.Library:  mpir.lib

for the second step i need to run the code on my board Hercules RM57L843

1. I used HalCodGen to generate the required files
2. From ARM Compiler --> Include options -- I added the location of the library


3. From

3-1  ARM Linker--> File search Path --> at the top i added the location for the file mpir.lib
3-2  At the bottom I added again the location of the library folder.



4. when I build the project i get the errors:


error #10234-D: unresolved symbols remain
error #99923: Corrupt member header: 'C:/Users/masj/Documents/Code Composer/mpir-3.0.0/lib/Win32/Debug/mpir.lib'

if i remove 3-1 the former error (error #99923:) disappears.

My questions are:

1. How can I solve those errors.
2. Does it matter that the library was built using Visual Studio?


thank you

Sincerely
Moud

  • Moud Jadaan said:
    2. Does it matter that the library was built using Visual Studio?

    That explains the problem. The Visual Studio compiler will compile the library for use on a X86 CPU running under Windows, whereas for use on a RM57L843 the library needs to be compiled for a ARM Cortex-R CPU.

    Rather than attempting to link a library compiled with Visual Studio you need to create a MPIR library in CCS which is built using the ARM compiler.

  • Dear Chester

    Thanks for your answer.

    When I checked the MPIR documentation, it can be built for different CPUs as in the snippet below; for example for ARM I need to build it as generic C and that what I did.

    but that leads me to the question: how to build MPIR using CCS? because in the documentation, there are two ways either for Unix-like systems or by Visual Studio
    thanks again

  • Moud Jadaan said:
    When I checked the MPIR documentation, it can be built for different CPUs as in the snippet below; for example for ARM I need to build it as generic C and that what I did.

    I downloaded mpir-3.0.0 and see that in the mpn/arm sub-directory there assembler source files for the ARM CPU (haven't checked which ARM architecture the assembler is written for).

    The mpir-3.0.0 documentation says it supports cross-compilation. On a PC running Ubuntu 16.04 LTS I was able to configure mpir-3.0.0 to cross-compile using the arm-linux-gnueabi toolchain which targets ARM processors running Linux:

    ./configure --host=arm-linux-gnueabi
    make

    However, to use mpir on a RM57L843 requires a "bare-metal" ARM cross-compiler to be used. When I attempted to configure mpir to use the gcc-arm-none-eabi-4_9-2015q3 bare-metal GCC cross-compiler installed by CCS 7.1 the configure failed with:

    $ ./configure --host=arm-none-eabi
    <snip>
    checking how to switch to text section... .text
    checking how to switch to data section... .data
    checking for assembler label suffix... :
    checking for assembler global directive... .globl
    checking for assembler global directive attribute... 
    checking if globals are prefixed by underscore... /home/mr_halfword/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin//arm-none-eabi-nm: conftest.o: File format not recognized
    unknown
    configure: WARNING: +----------------------------------------------------------
    configure: WARNING: | Cannot determine global symbol prefix.
    configure: WARNING: | /home/mr_halfword/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin//arm-none-eabi-nm -B output doesn't contain a global data symbol.
    configure: WARNING: | Will proceed with no underscore.
    configure: WARNING: | If this is wrong then you'll get link errors referring
    configure: WARNING: | to ___gmpn_add_n (note three underscores).
    configure: WARNING: | In this case do a fresh build with an override,
    configure: WARNING: |     ./configure gmp_cv_asm_underscore=yes
    configure: WARNING: +----------------------------------------------------------
    checking how to switch to read-only data section... 	.section	.rodata
    checking for assembler .type directive... .type	$1,@$2
    checking for assembler .size directive... .size	$1,$2
    checking for assembler local label prefix... configure: WARNING: "/home/mr_halfword/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin//arm-none-eabi-nm -B" failure
    configure: WARNING: cannot determine local label, using default L
    L
    checking for assembler byte directive... .byte
    checking how to define a 32-bit word... /home/mr_halfword/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin//arm-none-eabi-nm: conftest.o: File format not recognized
    /home/mr_halfword/ti/ccs710/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin//arm-none-eabi-nm: conftest.o: File format not recognized
    configure: error: cannot determine how to define a 32-bit word

    The conclusion is that the mpir-3.0.0 supplied build system doesn't support cross-compiling for a bare-metal ARM environment, and so you would need to either fix the build system or create a CCS project to compile the mpir source code.

    Also, mpir looks like a large library which internally performs dynamic memory allocation, and therefore have you checked if a RM57L843 microcontroller has sufficient memory for your application?

    One way to check the required memory usage would to be get a cheap ARM board capable of running Linux, such as a BeagleBone Black compile your application to run under ARM linux and check the amount of memory used.