I'm developing an application in C for ConnectCore 6UL and I use some third-party libraries already compiled for ARM7.
The execution environment of the application is linux created with yocto and I have also compiled gcc to run directly on the iMX6UL.
Everything compiles correctly but when executing I get the following error and the program aborts. Illegal instruction
After checking with dgb in disassembly I see that the instruction that gives problems is the following:
0x0003e2f0 <+1112>: vabs.f32 s8, s13
0x0003e2f4 <+1116>: vdiv.f32 s14, s12, s13
0x0003e2f8 <+1120>: vdiv.f32 s15, s9, s8
0x0003e2fc <+1124>: vstr s14, [r3]
=> 0x0003e300 <+1128>: vrintz.f32 s15, s15
0x0003e304 <+1132>: vmul.f32 s15, s15, s8
0x0003e308 <+1136>: vcvt.s32.f32 s15, s15
0x0003e30c <+1140>: vmov r12, s15
0x0003e310 <+1144>: cmp r12, #1
This instruction is located within the memory space of the library that I have commented on previously.
I have created this little program:
#include <stdio.h>
int main ()
{
printf ("1\n");
asm ("vrintz.f32 s15, s15");
printf ("2\n");
return 1;
}
And gcc tells me the following:
# gcc test.c
/tmp/ccEGrRl1.s: Assembler messages:
/tmp/ccEGrRl1.s:45: Error: selected processor does not support `vrintz.f32 s15,s15' in ARM mode
Is it possible that this instruction is not supported by iMX6UL? do i need any additional flag for compiling?
I have also tried from the cross compiler using the following flags obtaining the same result:
arm-dey-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security - -sysroot=/opt/dey/3.2-r1/ccimx6ulsbc/sysroots/cortexa7t2hf-neon-dey-linux-gnueabi
As additional information, I have tested the same source code and compiled library for a raspberry pi 4b and it works perfectly.
Any suggestion?
Solved! Go to Solution.
Hello jhernandez,
It definitely has to be with different core, the code you use it for ARM7 and the i.MX6UL use Cortex A7.
Regards
Hello jhernandez,
It definitely has to be with different core, the code you use it for ARM7 and the i.MX6UL use Cortex A7.
Regards