GCC compiler for MPC5777

cancel
Showing results for 
Search instead for 
Did you mean: 

GCC compiler for MPC5777

317 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
8 Replies

196 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

164 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

20 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

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

258 Views
mcdvoice
Contributor I

MCD

tHANKS FOR SHARING 

0 Kudos

306 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

286 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

266 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