Help interpreting MCUXpresso error message when accessing ext. lib

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

Help interpreting MCUXpresso error message when accessing ext. lib

ソリューションへジャンプ
2,990件の閲覧回数
Ed_McM
Contributor I

Hi,

I had a question regarding how to interpret an error message I received when building SDK project in MCUXpresso IDE, which accesses a linked lib.  The SDK was created for use on the i.MXRT1050 EVK.  The lib was built under linux using gnu toolchain for ARM Cortex M7 bare metal.  I have added the lib and path in IDE.

Initially I verified that I could build a simple hello world program, without any lib access.  I then added some calls into the libvpx and got the following error message.  Any help interpreting the message is appreciated.

Thanks

Ed

----------------------------------------------------------------------------------------------------------------------------------

...

Finished building: ../board/clock_config.c
Finished building: ../board/board.c
Finished building: ../board/pin_mux.c
Finished building: ../CMSIS/system_MIMXRT1052.c

Building target: MIMXRT1052xxxxB_Project.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\SHARED_PROJECTS\Defibtech\Defibtech_trainer\workspace\LIBvpx" -Xlinker -Map="MIMXRT1052xxxxB_Project.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -T MIMXRT1052xxxxB_Project_Debug.ld -o "MIMXRT1052xxxxB_Project.axf"  ./xip/evkbimxrt1050_flexspi_nor_config.o ./xip/evkbimxrt1050_sdram_ini_dcd.o ./xip/fsl_flexspi_nor_boot.o  ./utilities/fsl_debug_console.o ./utilities/fsl_io.o ./utilities/fsl_log.o ./utilities/fsl_str.o  ./startup/startup_mimxrt1052.o  ./source/VPX_APP/ivfdec.o ./source/VPX_APP/tools_common.o ./source/VPX_APP/video_reader.o  ./source/MIMXRT1052xxxxB_Project.o ./source/semihost_hardfault.o  ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_gpio.o ./drivers/fsl_lpuart.o  ./board/board.o ./board/clock_config.o ./board/peripherals.o ./board/pin_mux.o  ./CMSIS/system_MIMXRT1052.o   -lvpx
C:\SHARED_PROJECTS\Defibtech\Defibtech_trainer\workspace\LIBvpx\libvpx.a: error adding symbols: File format not recognized
collect2.exe: error: ld returned 1 exit status
make: *** [MIMXRT1052xxxxB_Project.axf] Error 1

---------------------------------------------------------------------------------------------------------------------------------------

some additional info:

i.MX RT1052 

SDK for MIMXRT1052

MCUXpresso IDE v10.2.0

Windows 7 professional (MCUXpresso environment)

Linux Ubuntu (lib build environment)

0 件の賞賛
1 解決策
2,634件の閲覧回数
converse
Senior Contributor V

After a bit of investigation...

Looks like you are trying to link with a version of libvpx built for Ubuntu/x86 and not for ARM/Cortex-M7.

This is what I did:

I extracted the .o files from the archive and ran arm-none-eabi-nm, which gives the "File format not recognised" error.

I then ran nm on a Linux host and it gave me the correct symbols...

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
2,634件の閲覧回数
Ed_McM
Contributor I

Thanks for the help Con Verse.  That was it, I wasn't correctly setting path to cross compiler during build on Linux.  It ended up using the default linux native gcc.

0 件の賞賛
2,634件の閲覧回数
Ed_McM
Contributor I

I've attached a zipped file that includes libvpx.a  and the build output with details on each built object file.  Thanks for looking at this.

0 件の賞賛
2,635件の閲覧回数
converse
Senior Contributor V

After a bit of investigation...

Looks like you are trying to link with a version of libvpx built for Ubuntu/x86 and not for ARM/Cortex-M7.

This is what I did:

I extracted the .o files from the archive and ran arm-none-eabi-nm, which gives the "File format not recognised" error.

I then ran nm on a Linux host and it gave me the correct symbols...

0 件の賞賛
2,634件の閲覧回数
converse
Senior Contributor V

The message seems quite self explanatory to me. The library file is not in a format that the tools recognise. So,how to solve? It would be good if you can

- post the exact version number of the gcc used to create the library 

- post an example command line of how you compiled one of the .o files in the library

- post the command line used to build the library

it probably also worth double checking that the library has not been corrupted in copying it from Linux to windows. Is it the exact same size? Is the md5 sum the same?

0 件の賞賛
2,634件の閲覧回数
Ed_McM
Contributor I

The message seems quite self explanatory to me. The library file is not in a format that the tools recognise. So,how to solve? It would be good if you can

- post the exact version number of the gcc used to create the library 

   GNU ARM Embedded Toolchain Version: 7-2018-q2-update Linux 64 bit

   link to toolchain used: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm

- post an example command line of how you compiled one of the .o files in the library

- post the command line used to build the library

   See attached configure shell script and makefile used:

   $ cd /home/ed/Project/libvpx/libvpx/                                
   $ export PATH="${PATH}:/home/ed/Project/armCrossCompile/gcc-arm-none-eabi-7-2018-q2-update/bin"  
   $ CROSS=arm-none-eabi-                                                                                                                                  
   $ make distclean                                                                                                                                                  
   $ ./configure --target=generic-gnu                                                                                                                     
   $ make                                                                                                                                                                                               

 

it probably also worth double checking that the library has not been corrupted in copying it from Linux to windows. Is it the exact same size? Is the md5 sum the same?

They are the same size doesn't look like it was corrupted.

0 件の賞賛
2,634件の閲覧回数
converse
Senior Contributor V

Those files don't help me - without running the scripts/makefile I cannot easily see what command line options are being used on the compiler and archiver (and I don't have time to read through them and work it out). Can you post the output from the build of the library - containing the command lines used to build each file (and not just 'Building xyzzy...).

Alternatively, post the .a file (zipped) and I'll see what the library contains.

0 件の賞賛