GCC compiler for MPC5777

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GCC compiler for MPC5777

3,630 Views
sreekant866
Contributor I

Hello Team,

We need a GCC compiler suitable for MPC5777C board (GCC PowerPC eabi SPE), for production usage. Can you please provide production usage compiler for development?.

 

0 Kudos
9 Replies

3,509 Views
sreekant866
Contributor I

Thank you for the reply.

We are getting undef instruction error as soon as the control hits start of the program.

sreekant866_0-1632920589599.png

 

 

Below are the build settings we have followed using the S32DS_Power_Win32_v2.1 compiler:

1.Compiled the code using '-powerpc-eabivle-gcc-4.9.4' compiler located in "\nxp\S32DS_Power_v2.1\S32DS\build_tools\powerpc-eabivle-4_9\bin" with change in target flags to support VLE instruction set

TGT_FLAGS = -mno-eabi -memb -mabi=spe -mregnames -Wa,-mregnames -Wa,-mvle -misel -Wa,-me500 \

            -mspe -mfloat-gprs=single -mhard-float -mlra

2. To support VLE instruction set extension and to execute code in VLE page, we have set VLE bit to 1 in the MAS 626 register as part of MMU for flash and SRAM TLBs.

sreekant866_1-1632920589659.jpeg

 

3. Below are the updates done in compiler settings to use the powerpc-eabivle-gcc-4.9.4

PREFIX = C:\nxp\S32DS_Power_v2.1\S32DS\build_tools\powerpc-eabivle-4_9\bin

CC = $(PREFIX)\powerpc-eabivle-gcc

CPP= $(PREFIX)\powerpc-eabivle-g++

AS = $(PREFIX)\powerpc-eabivle-as

AR = $(PREFIX)\powerpc-eabivle-ar

LD = $(PREFIX)\powerpc-eabivle-ld

NM = $(PREFIX)\powerpc-eabipse-nm

OBJDUMP = $(PREFIX)\powerpc-eabivle-objdump

OBJCOPY = $(PREFIX)\powerpc-eabivle-objcopy

READELF = $(PREFIX)\powerpc-eabivle-readelf

 

Please provide your support to fix the aforementioned issue. Kindly, let us know if you need more information.

0 Kudos

3,477 Views
stanish
NXP Employee
NXP Employee

Hi,

it seems, the compiler generates instructions for a different target core.

I'd suggest you to use:

-mcpu=e200z7

-meabi

and remove options below (IMO these are not applicable to e200 cores)

-mfloat-gprs=single

-me500 

-memb

-mlra

Is there any specific reason why you use these options?

 

Hope it helps,

Stan

 

0 Kudos

3,333 Views
sreekant866
Contributor I

Thank you for the response. Sorry for the delay.

We tried to use the flags suggested in the previous response.

We modified the C, CPP and Assembly compiler flags using  the S32 design studio environment as reference.

Assembly files do not compile and throw unrecognized opcode, if -me500 flag is not used, as shown in below image:

 

sreekant866_0-1635314926745.png

So, we added -me500 flag in our compilation. Below are the assembly flags:

"ASFLAGS = -g3 -mbig -mregnames -me500"

For C and CPP files, we added -mcpu=e200z7 and -meabi  as suggested in the previous response. We removed -mfloat-gprs=single, -memb and -mlra

For C files below are the compiler flags:

CFLAGS = -meabi -mabi=spe -mregnames -Wa,-mregnames -Wa,-mbooke32 -misel \
-mspe -mhard-float -O0 -g3 -Wall -c -fmessage-length=0 -fstrict-volatile-bitfields -ffunction-sections \
-fdata-sections -mcpu=e200z7 -mbig -mvle -mregnames -mhard-float -std=gnu99\

For CPP flags below are the compiler flags:

CPPFLAGS = -meabi -Wa,-mregnames -misel \
-mspe -mhard-float -O0 -g3 -Wall -c -fmessage-length=0 -fstrict-volatile-bitfields -ffunction-sections \
-fdata-sections -mcpu=e200z7 -mbig -mvle -mregnames -mhard-float \
-fno-default-inline --param max-inline-insns-auto=0 -fno-inline-functions \
-fno-rtti -fno-exceptions -fno-enforce-eh-specs -fno-builtin -fno-threadsafe-statics -fno-gnu-keywords \
-fno-nonansi-builtins -fno-operator-names -nostdinc++ -Wabi -Wreorder -Woverloaded-virtual -Wsign-promo -Winit-self \
-Wswitch-enum -Wextra -Wfloat-equal -Wunreachable-code -fsingle-precision-constant \

Below are the linker flags used:

"LDFLAGS = -EB -N -v --gc-sections --sort-section alignment -warn-common"

After setting the above compilation flags. We are still getting undefined instruction error, while execution. Please check the below diagram.

sreekant866_1-1635315359742.png

Please help us to resolve the above issue. Kindly let us know if more information is needed,

Thanks!

 

 

 

 

Even after successful compilation and linking .cpp object code has instruction undefined.

0 Kudos

3,312 Views
sreekant866
Contributor I

Also , Please let us know if we can have a working session to resolve this issue quickly. It will be of great help.

Thanks!

0 Kudos

3,193 Views
stanish
NXP Employee
NXP Employee

Hello,

I've tested to compile a startup asm. source file (attached) with the option -me500 and I cannot event compile it. I get error below:

powerpc-eabivle-gcc.exe: error: unrecognized command line option '-me500'

With the options:

-c
-g3
-mbig
-mregnames
-meabi
-mcpu=e200z7

i can compile asm file even with evxor instruction:

stanish_1-1635955028529.png

it is not correctly disassembled however the opcode seems to be ok.

Could you possibly post your assembler outpu tbuild console when -mcpu=e200z7 option is used instead of

-me500.

Could you also turn on verbosed more by adding -v opton. This will provide us with some additional details.

 

Thanks,

Stan

3,570 Views
mcdvoice
Contributor I

MCD

tHANKS FOR SHARING 

0 Kudos

3,618 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

We are providing S32 Design Studio for Power Architecture what's environment based on GCC compiler:

https://www.nxp.com/design/software/development-software/s32-design-studio-ide:S32-DESIGN-STUDIO-IDE

https://community.nxp.com/t5/S32-Design-Studio/bd-p/s32ds

 

0 Kudos

3,598 Views
sreekant866
Contributor I

Thank you for the quick response. 

As per the information provided, we installed 'S32DS_Power_Win32_v2.1', which is relevant to MPC5777C. Below is path from where we installed:

https://nxp.flexnetoperations.com/control/frse/download?agree=Accept&element=10944607

After installing, we tried to use the compiler -powerpc-eabivle-gcc-4.9.4 located in "\nxp\S32DS_Power_v2.1\S32DS\build_tools\powerpc-eabivle-4_9\bin". 

We are not using the complete software development environment. We are pointing the compiler mentioned above. We are able to compile successfully but we are unable to execute.

Please note that in our project we are using powerpc-eabispe-gcc-4.2.3 currently. We are able to successfully run using this compiler. We want to upgrade the gcc version for maintainability.

Do you have any specific compiler with respect to "powerpc-eabispe-gcc" in any of the development environment?. Please point us to the specific compiler location.

Also, if we want to use ' -powerpc-eabivle-gcc' compiler, do we need to make any specific changes in build environment or code to successfully execute. Please guide us through this request.

 

0 Kudos

3,578 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

 

We don't have any other specific compiler for Power PC. The only one which we are providing is part of S32DS Power PC v2.1 installation.  

 

Can you share more details why you can't execute binary built with gcc v4.9? Program ends in exception or what is the root cause? 

 

Jiri

0 Kudos