cancel
Showing results for 
Search instead for 
Did you mean: 

Can't compile for Arm Cortex A7, what is going wrong?

JOSU
Associate II

Install the SDK

Simple Hello World Application

I have followed all the steps for installing the SDK and verified the environment variables for the cross compiler. I use a make file and it generates a binary. The problem is it generates a binary for x86-64 even when it is being directed to use the arm-ostl-linux-gnueabi-gcc (GCC) 9.3.0 cross compiler.

Output of file:

"gtk_hello_world: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamic                       ally linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ac39231d6a72                       8870d0248017a6c9cd25d9f02eab, for GNU/Linux 3.2.0, not stripped"

I haven't just used gtk either, a simple printf application with stdio.h will also compile for x86-64 and not the intended cross compile target.

Output of Cross Compile target:

"echo $CC

arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/james/STM32MPU_workspace/STM32MP15-Ecosystem-v3.1.0/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi"

I have repeated this using WSL2 and VMware Workstation Player with Ubuntu 20.04 on both. The result is the same. The simple "hello world" application will open in an Ubuntu environment but not on the discovery kit using the OpenST linux distribution.

Is there any indication of something I may have done wrong in my SDK installation? Or is there some other step I can follow to ensure I get the correct cross compilation?

11 REPLIES 11
JOSU
Associate II

I have success:

helloworld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=c01e9c4baa9411f23a86dfa4ed177c73fca84f87, for GNU/Linux 3.2.0, with debug_info, not stripped

Thank you for your help. It was a combination of directory permissions and not realising the sudo command would use an incorrectly sourced cross compiler.

Erwan SZYMANSKI
ST Employee

That is a good news !

Have a nice day.

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.