Error in PE generated code

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

Error in PE generated code

Jump to solution
1,582 Views
carnecro
Contributor I

I created new project for Vybrid processor :

New Project -> Processor Expert Project ... -> Processors -> Vybrid -> MVF61NN151MK50 ... -> GNU C Compiler

Compiler reports error in the generated fiel Cpu.c

   asm("mov r0,%0" : : "r" (&__vector_table));

   ^

   ../Generated_Code/Cpu.c:115:19: error: expected ')' before ':' token

   asm("mov r0,%0" : : "r" (&__vector_table));

                   ^

Robert

Tags (2)
0 Kudos
Reply
1 Solution
1,236 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Robert,

I have been able to reproduce the error with your project. I have verified the project settings and I have found out an incorrect settings of the C Compiler language standard. Please, select the GNU ISO C11(-std=gnu11) language standard to compile your application. See the screenshot below:

pastedImage_0.png

Please note, that this option affects support of the asm keyword, see details on the web page https://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/C-Dialect-Options.html

Best Regards,

Marek Neuzil

View solution in original post

0 Kudos
Reply
4 Replies
1,236 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Robert,

I have created a project in PEx Driver Suite 10.4.2 and I have been able to build the application by using GNU C Compiler (I have used GNU C Compiler that is installed in KDS 3.0.0), see the console output below.

Could you provide me detail about the project you have created, please? (PEx Driver Suite version, operating system, CPU component settings, GNU C Compiler version, target compiler settings)

09:39:44 **** Incremental Build of configuration Debug for project Test MVF61NN151MK50 prj ****

make all

'Building file: ../Sources/Events.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Sources/Events.d" -MT"Sources/Events.o" -c -o "Sources/Events.o" "../Sources/Events.c"

'Finished building: ../Sources/Events.c'

' '

'Building file: ../Sources/Exceptions.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Sources/Exceptions.d" -MT"Sources/Exceptions.o" -c -o "Sources/Exceptions.o" "../Sources/Exceptions.c"

'Finished building: ../Sources/Exceptions.c'

' '

'Building file: ../Sources/main.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"

'Finished building: ../Sources/main.c'

' '

'Building file: ../Project_Settings/Startup_Code/startupA5.asm'

'Invoking: Cross ARM GNU Assembler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -x assembler-with-cpp -MMD -MP -MF"Project_Settings/Startup_Code/startupA5.d" -MT"Project_Settings/Startup_Code/startupA5.o" -c -o "Project_Settings/Startup_Code/startupA5.o" "../Project_Settings/Startup_Code/startupA5.asm"

'Finished building: ../Project_Settings/Startup_Code/startupA5.asm'

' '

'Building file: ../Generated_Code/Cpu.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Generated_Code/Cpu.d" -MT"Generated_Code/Cpu.o" -c -o "Generated_Code/Cpu.o" "../Generated_Code/Cpu.c"

'Finished building: ../Generated_Code/Cpu.c'

' '

'Building file: ../Generated_Code/GIC.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Generated_Code/GIC.d" -MT"Generated_Code/GIC.o" -c -o "Generated_Code/GIC.o" "../Generated_Code/GIC.c"

'Finished building: ../Generated_Code/GIC.c'

' '

'Building file: ../Generated_Code/MSCM.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Generated_Code/MSCM.d" -MT"Generated_Code/MSCM.o" -c -o "Generated_Code/MSCM.o" "../Generated_Code/MSCM.c"

'Finished building: ../Generated_Code/MSCM.c'

' '

'Building file: ../Generated_Code/PE_LDD.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Generated_Code/PE_LDD.d" -MT"Generated_Code/PE_LDD.o" -c -o "Generated_Code/PE_LDD.o" "../Generated_Code/PE_LDD.c"

'Finished building: ../Generated_Code/PE_LDD.c'

' '

'Building file: ../Generated_Code/Vectors.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Generated_Code" -I"C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Sources" -std=gnu11 -MMD -MP -MF"Generated_Code/Vectors.d" -MT"Generated_Code/Vectors.o" -c -o "Generated_Code/Vectors.o" "../Generated_Code/Vectors.c"

'Finished building: ../Generated_Code/Vectors.c'

' '

'Building target: Test MVF61NN151MK50 prj.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-a5 -mthumb -O2 -Wall  -g -T "C:/Freescale/KDS_3.0.0/workspace/Test MVF61NN151MK50 prj/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -Wl,-Map,"Test MVF61NN151MK50 prj.map" -o "Test MVF61NN151MK50 prj.elf"  ./Sources/Events.o ./Sources/Exceptions.o ./Sources/main.o  ./Project_Settings/Startup_Code/startupA5.o  ./Generated_Code/Cpu.o ./Generated_Code/GIC.o ./Generated_Code/MSCM.o ./Generated_Code/PE_LDD.o ./Generated_Code/Pins1.o ./Generated_Code/Vectors.o  

'Finished building target: Test MVF61NN151MK50 prj.elf'

' '

09:39:48 Build Finished (took 4s.258ms)

Best Regards,

Marek Neuzil

0 Kudos
Reply
1,236 Views
carnecro
Contributor I

Eclipse on MacOSX with GNU ARM plugin (no KDS!), Freescale Microcontrollers Driver Suite Plugin 10.4.2, GNU C 4.9.3 (Launchpad gcc-arm-none-eabi-4_9-2015q1) -> see attached screenshot of my eclipse plugin software. Second attachment is my Eclipse project.

Full build log with compiler switches (:

01:21:46 **** Build of configuration Debug for project TestVF61 ****

make all

Building file: ../Sources/Events.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/iofiles" -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/pdd/inc" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Sources" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Generated_Code" -std=c99 -MMD -MP -MF"Sources/Events.d" -MT"Sources/Events.o" -c -o "Sources/Events.o" "../Sources/Events.c"

Finished building: ../Sources/Events.c

Building file: ../Sources/Exceptions.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/iofiles" -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/pdd/inc" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Sources" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Generated_Code" -std=c99 -MMD -MP -MF"Sources/Exceptions.d" -MT"Sources/Exceptions.o" -c -o "Sources/Exceptions.o" "../Sources/Exceptions.c"

../Sources/Exceptions.c: In function 'Undefined_Handler':

../Sources/Exceptions.c:66:3: warning: implicit declaration of function 'asm' [-Wimplicit-function-declaration]

   PE_DEBUGHALT();

   ^

Finished building: ../Sources/Exceptions.c

Building file: ../Sources/main.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/iofiles" -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/pdd/inc" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Sources" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Generated_Code" -std=c99 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"

Finished building: ../Sources/main.c

Building file: ../Project_Settings/Startup_Code/startupA5.asm

Invoking: Cross ARM GNU Assembler

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -x assembler-with-cpp -MMD -MP -MF"Project_Settings/Startup_Code/startupA5.d" -MT"Project_Settings/Startup_Code/startupA5.o" -c -o "Project_Settings/Startup_Code/startupA5.o" "../Project_Settings/Startup_Code/startupA5.asm"

Finished building: ../Project_Settings/Startup_Code/startupA5.asm

Building file: ../Generated_Code/Cpu.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-a5 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/iofiles" -I"/Users/Robert/Applications/EclipseCPP/ProcessorExpert/lib/Vybrid/pdd/inc" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Sources" -I"/Users/Robert/Developer/Workspaces/EclipseCPP/TestVF61/Generated_Code" -std=c99 -MMD -MP -MF"Generated_Code/Cpu.d" -MT"Generated_Code/Cpu.o" -c -o "Generated_Code/Cpu.o" "../Generated_Code/Cpu.c"

../Generated_Code/Cpu.c: In function '__init_hardware':

../Generated_Code/Cpu.c:115:3: warning: implicit declaration of function 'asm' [-Wimplicit-function-declaration]

   asm("mov r0,%0" : : "r" (&__vector_table));

   ^

../Generated_Code/Cpu.c:115:19: error: expected ')' before ':' token

   asm("mov r0,%0" : : "r" (&__vector_table));

                   ^

make: *** [Generated_Code/Cpu.o] Error 1

01:21:47 Build Finished (took 1s.540ms)

BTW - KDS 3.0 was released? Does it support MacOSX?

Robert

0 Kudos
Reply
1,237 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Robert,

I have been able to reproduce the error with your project. I have verified the project settings and I have found out an incorrect settings of the C Compiler language standard. Please, select the GNU ISO C11(-std=gnu11) language standard to compile your application. See the screenshot below:

pastedImage_0.png

Please note, that this option affects support of the asm keyword, see details on the web page https://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/C-Dialect-Options.html

Best Regards,

Marek Neuzil

0 Kudos
Reply
1,236 Views
carnecro
Contributor I

Yes, that's it. Thank you.

0 Kudos
Reply