Hello,
I think that Vybrid should support GCC, KEIL(ARM), and IAR. You should be able to select requested compiler in CPU component on Build options tab.
Best regards
Vojtech Filip
Processor Expert Support Team
Hi Vojtech,
I split this into another discussion, but didn't expect the other two replies to come along for the ride. Sorry.
I copied the I2C_Accelerometer PEx example project to my workspace. Its original target compiler is the IAR C compiler. I changed the Build Options to generate code for the "GNU C Compiler" instead.
I was able to Generate Processor Expert Code with no apparent problems.
Then I changed these properties of the I2C_Accelerometer PEx example project:
Properties --> C/C++ Build --> Tool Chain Editor: Changed to "DS-5 GCC Compiler" and "CDT Internal builder"
Properties --> C/C++ Build --> Settings --> Tool Settings --> GCC C Compiler --> Miscellaneous: Added "-std=gnu99"
Properties --> C/C++ Build --> Settings --> Tool Settings --> GCC C Compiler --> Includes: Added three include dirs
When I try to build it I get this error twice : "Generated_Code/Cpu.c:93: undefined reference to '__vector_table'
I noticed that there is an array "vector_table[0x91]" in Vectors.c, line 73 and was wondering if this was what it was referring to. I figured that the prefix of the double underscore "__" is supposed to be generated by something in IAR C (the original target compiler). I assume there is some name-mangling going on by something....
Do you know how to fix?
Thanks
Hello,
I think it is caused by incorrect project setup on your side. In case you change compiler you should also select corresponding compiler in CPU component on Build options tab. Regarding __vector_table, this symbol should be defined in linker file to specify address of vector table. When I have opened your project I have noticed that you do not use PEx generated linker file. Could you please try to enable its generation and set linker to use it?
Best regards
Vojtech Filip
Processor Expert Support Team
Hi Vojtech,
I created an entirely new PEx project in DS-5 this time, called 'SecondPE' to make sure I didn't mess something up: New --> Project --> Processor Expert Project --> (Processor MVF61NN151MK50) --> Use current perspective, Initialize all peripherals -> GNU C Compiler.
When it created the project, I looked at the properties for the PEx project. In the Tool Chain Editor, for "Current toolchain", I selected "DS-5 GCC". For "Current builder", I selected "Processor Expert Configuration Debug Builder". Is this what you mean by using the "PEx generated linker file"?
Under "Build Options" in the PEx projects, "Generate linker file" is already set to "yes"
I added "Generated_Code" and "Sources" to the include paths.
I then cleaned and then built the project and I get these messages when it tries to link
Building target: SecondPE
Invoking: GCC C++ Linker
arm-linux-gnueabihf-g++ -o "SecondPE" ./Sources/Events.o ./Sources/Exceptions.o ./Sources/ProcessorExpert.o ./Project_Settings/Startup_Code/startupA5.o ./Generated_Code/ADC0.o ./Generated_Code/ADC1.o ./Generated_Code/AFE.o ./Generated_Code/ASRC.o ./Generated_Code/CAN0.o ./Generated_Code/CAN1.o ./Generated_Code/CMU.o ./Generated_Code/CRC.o ./Generated_Code/Cpu.o ./Generated_Code/DAC0.o ./Generated_Code/DAC1.o ./Generated_Code/DCU0.o ./Generated_Code/DCU1.o ./Generated_Code/DDR_mc1.o ./Generated_Code/DMA0.o ./Generated_Code/DMA1.o ./Generated_Code/ENET0.o ./Generated_Code/ENET1.o ./Generated_Code/ESAI.o ./Generated_Code/ESW.o ./Generated_Code/EWM.o ./Generated_Code/FB.o ./Generated_Code/FTM0.o ./Generated_Code/FTM1.o ./Generated_Code/FTM2.o ./Generated_Code/FTM3.o ./Generated_Code/GIC.o ./Generated_Code/GPC.o ./Generated_Code/GPIO0.o ./Generated_Code/GPIO1.o ./Generated_Code/GPIO2.o ./Generated_Code/GPIO3.o ./Generated_Code/GPIO4.o ./Generated_Code/I2C0.o ./Generated_Code/I2C1.o ./Generated_Code/I2C2.o ./Generated_Code/I2C3.o ./Generated_Code/I2S0.o ./Generated_Code/I2S1.o ./Generated_Code/I2S2.o ./Generated_Code/I2S3.o ./Generated_Code/LPTMR0.o ./Generated_Code/MSCM.o ./Generated_Code/NFC.o ./Generated_Code/OCOTP.o ./Generated_Code/PDB.o ./Generated_Code/PE_LDD.o ./Generated_Code/PIT.o ./Generated_Code/Pins1.o ./Generated_Code/QuadSPI0.o ./Generated_Code/QuadSPI1.o ./Generated_Code/RLE_DEC.o ./Generated_Code/SDHC0.o ./Generated_Code/SDHC1.o ./Generated_Code/SPDIF.o ./Generated_Code/SPI0.o ./Generated_Code/SPI1.o ./Generated_Code/SPI2.o ./Generated_Code/SPI3.o ./Generated_Code/SRC.o ./Generated_Code/TCON0.o ./Generated_Code/TCON1.o ./Generated_Code/UART0.o ./Generated_Code/UART1.o ./Generated_Code/UART2.o ./Generated_Code/UART3.o ./Generated_Code/UART4.o ./Generated_Code/UART5.o ./Generated_Code/USB0.o ./Generated_Code/USB1.o ./Generated_Code/USBPHY0.o ./Generated_Code/USBPHY1.o ./Generated_Code/VDEC.o ./Generated_Code/VIU3.o ./Generated_Code/Vectors.o ./Generated_Code/WDOG_A5.o ./Generated_Code/WDOG_M4.o ./Generated_Code/WKPU.o
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x80): undefined reference to `__stack_und_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x84): undefined reference to `__stack_abt_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x88): undefined reference to `__stack_fiq_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x8c): undefined reference to `__stack_irq_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x90): undefined reference to `__stack_svc_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x94): undefined reference to `__stack_top__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x9c): undefined reference to `_sidata'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xa0): undefined reference to `_sdata'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xa8): undefined reference to `__START_BSS'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xac): undefined reference to `__END_BSS'
./Generated_Code/Cpu.o: In function `__init_hardware':
/home/thu/DS-5-Workspace-oobedemo/SecondPE/Linux_C_Debug/../Generated_Code/Cpu.c:259: undefined reference to `__vector_table'
collect2: error: ld returned 1 exit status
make: *** [SecondPE] Error 1
**** Build Finished ****
I suspect that the DS-5 GCC compiler isn't the right choice? It's the only GCC compiler available besides the Timestorm GCC compiler. When I try to use the Timestorm GCC compiler, Eclipse says: "java.lang.NullPointerException" so I can't use the Timestorm GCC compiler.
Do I need to specify to the compiler the CPU type? I also tried adding this to the GCC compiler and GCC assembler configs in the project:
-mcpu=cortex-a5 -mfpu=vfpv4-d16
and got the same result.
Is there some linker config I need to set up?
Thanks.
Hello,
I these errors are caused by GCC compiler/linker incorrect setup. I do not have much experience with DS-5 and PEx integration however I would recommend the following steps.
Create new standard C project in DS-5 (without PEx) for your MCU. This step should ensure that corresponding toolchain will be set properly.
After that right click on your project and select "Enable PEx in existing C project".
Try to generate and build your project.
Please find also attached steps for IAR, in your case just replace IAR by requested toolchain.
If this not help I will prepare exact steps for DS-5 and PEx for you.
Best regards
Vojtech Filip
Processor Expert Support Team
Hi Vojtech,
I tried doing the steps you outlined and I get the similar problems. I deleted the old project and wiped it from the disk. Then I created a new C project as you outlined in your PDF. Then I added PEx to that project:
Building target: SecondPE
Invoking: GCC C Linker
arm-linux-gnueabihf-gcc -o "SecondPE" ./Sources/Events.o ./Sources/Exceptions.o ./Sources/ProcessorExpert.o ./Project_Settings/Startup_Code/startupA5.o ./Generated_Code/ADC0.o ./Generated_Code/ADC1.o ./Generated_Code/AFE.o ./Generated_Code/ASRC.o ./Generated_Code/CAN0.o ./Generated_Code/CAN1.o ./Generated_Code/CMU.o ./Generated_Code/CRC.o ./Generated_Code/Cpu.o ./Generated_Code/DAC0.o ./Generated_Code/DAC1.o ./Generated_Code/DCU0.o ./Generated_Code/DCU1.o ./Generated_Code/DDR_mc1.o ./Generated_Code/DMA0.o ./Generated_Code/DMA1.o ./Generated_Code/ENET0.o ./Generated_Code/ENET1.o ./Generated_Code/ESAI.o ./Generated_Code/ESW.o ./Generated_Code/EWM.o ./Generated_Code/FB.o ./Generated_Code/FTM0.o ./Generated_Code/FTM1.o ./Generated_Code/FTM2.o ./Generated_Code/FTM3.o ./Generated_Code/GIC.o ./Generated_Code/GPC.o ./Generated_Code/GPIO0.o ./Generated_Code/GPIO1.o ./Generated_Code/GPIO2.o ./Generated_Code/GPIO3.o ./Generated_Code/GPIO4.o ./Generated_Code/I2C0.o ./Generated_Code/I2C1.o ./Generated_Code/I2C2.o ./Generated_Code/I2C3.o ./Generated_Code/I2S0.o ./Generated_Code/I2S1.o ./Generated_Code/I2S2.o ./Generated_Code/I2S3.o ./Generated_Code/LPTMR0.o ./Generated_Code/MSCM.o ./Generated_Code/NFC.o ./Generated_Code/OCOTP.o ./Generated_Code/PDB.o ./Generated_Code/PE_LDD.o ./Generated_Code/PIT.o ./Generated_Code/Pins1.o ./Generated_Code/QuadSPI0.o ./Generated_Code/QuadSPI1.o ./Generated_Code/RLE_DEC.o ./Generated_Code/SDHC0.o ./Generated_Code/SDHC1.o ./Generated_Code/SPDIF.o ./Generated_Code/SPI0.o ./Generated_Code/SPI1.o ./Generated_Code/SPI2.o ./Generated_Code/SPI3.o ./Generated_Code/SRC.o ./Generated_Code/TCON0.o ./Generated_Code/TCON1.o ./Generated_Code/UART0.o ./Generated_Code/UART1.o ./Generated_Code/UART2.o ./Generated_Code/UART3.o ./Generated_Code/UART4.o ./Generated_Code/UART5.o ./Generated_Code/USB0.o ./Generated_Code/USB1.o ./Generated_Code/USBPHY0.o ./Generated_Code/USBPHY1.o ./Generated_Code/VDEC.o ./Generated_Code/VIU3.o ./Generated_Code/Vectors.o ./Generated_Code/WDOG_A5.o ./Generated_Code/WDOG_M4.o ./Generated_Code/WKPU.o
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x80): undefined reference to `__stack_und_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x84): undefined reference to `__stack_abt_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x88): undefined reference to `__stack_fiq_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x8c): undefined reference to `__stack_irq_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x90): undefined reference to `__stack_svc_end__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x94): undefined reference to `__stack_top__'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0x9c): undefined reference to `_sidata'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xa0): undefined reference to `_sdata'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xa8): undefined reference to `__START_BSS'
./Project_Settings/Startup_Code/startupA5.o: In function `endless_loop':
(.text._startup_code+0xac): undefined reference to `__END_BSS'
./Generated_Code/Cpu.o: In function `__init_hardware':
/home/thu/DS-5-Workspace-oobedemo/SecondPE/Debug/../Generated_Code/Cpu.c:162: undefined reference to `__vector_table'
/home/thu/DS-5-Workspace-oobedemo/SecondPE/Debug/../Generated_Code/Cpu.c:162: undefined reference to `__vector_table'
collect2: error: ld returned 1 exit status
make: *** [SecondPE] Error 1
**** Build Finished ****
Please note that I have not yet added my own code for this project. I simply want to get the PEx project to generate code and compile cleanly. Then I'll add code, etc.
Thanks.
Hi Vojtech,
After experimenting with this, it looks like the Keil ARM C/C++ Compiler that PEx specifies is actually the ARM CC compiler in DS-5. I didn't know that. That is why I've been making PEx generate GCC code. I wish I had known that a long time ago :smileyhappy:.
Hello,
in case you select GNU C compiler compiler on Build options tab in CPU component you get linker file in *.ld file. In case you select KEIL (ARM) you get linker file in *.scat file. So if you switch to another tool-chain you have to also made corresponding action in PEx (compiler switch + code generation).
Regarding pragma arm warning - Its not OK. We will fix it for next release. However If you switch to GCC toolchain you have to also switch into GCC in PEx. Now You are building code for ARM compiler by GCC compiler.
PEx supports ARM CC compiler. Please find attached powerpoint, its little bit outdated but the main steps should be same also for you.
Best regards
Vojtech Filip
Processor Expert Support Team
Hello,
I am now trying to add MQX-Lite PEx to a C project to get it to compile in ARM DS-5 under Ubuntu 32-bit. I get two errors:
These are the steps I took:
The build result was those two errors above. I also tried using two other builders, "CDT Internal Builder" and "Processor Expert Configuration Debug Builder" - same results.
Is this a bug?
I also tried creating a PEx MQX-Lite Project from scratch, but Vybrid is not among the processor choices, so I couldn't do that.
So I tried adding MQX PEx to a C Project. I get a lot of compile errors. These are the steps I took:
I figure I'm doing something wrong....
Thanks
Hello,
MQX-Lite is not supported for Cortex-A5, and as far as I know there is no plan to support it in near future.
I think we should add some error to MQX-Lite component when is selected on unsupported platform.
We are sorry for inconvenience.
Best regards
Vojtech Filip
Processor Expert Support Team
Hi Vojtech,
Thanks for the information. I'll quit trying to add MQX-Lite to the project. How about MQX? Does PEx support MQX on the Cortex-A5? I'm having trouble getting it to work with all those compile errors.
Thanks.
Hello
1) The Keil compiler is the same <almost> as found in DS-5. There are a few minor differences. With both Keil MDK and DS-5 - you can also use the GGC compiler if you prefer - whatever your favourite GCC version is.
2) There is an appnote on exporting Professor Expert to Keil - it is quite basic - but perhaps something useful in there: http://www.keil.com/appnotes/files/apnt_235_pe2uv.pdf
3) For an RTOS - you can look at Keil RTX. It now comes with a BSD license which makes it free. Ports for Keil, IAR and GCC are here: https://www.keil.com/demo/eval/rtx.htm
RTX started out for Cortex-M processors - but we have started to port it to Cortex-A. DS-5 includes an example for a single core Cortex-A9. If you can't find it - email me and I will dig it up. bob.boys@arm.com You might be able to get it working on the Cortex-A5.
To see how RTX works - Keil has some Kinetis examples - go to www.keil.com/freescale and get one of my labs that show this - and the kernel awareness windows too. RTX is very simple to get working on a Cortex-M processor - hopefully it will be easy for the bigger ones too.
4) ARMCC has a GCC emulation mode: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0483c/CHDDJHCH.html
Many people like the ARM compiler - they say it is easier to use.
We now have a Freescale landing page: www.keil.com/freescale - we will add things to this this year....
Thanks
Bob Boys
ARM
San Jose, CA
Hi Robert,
Thanks for the information about DS-5 versus Keil MDK. Using DS-5 with ARMCC and PEx targeting the A5 core is working well. Your information regarding GCC emulation could come in quite handy in the near future.
Regarding RTX, I am using MQX since we already have a lot of experience with it. However, I might have to look at RTX and see what's up over there. Unfortunately, our development platform is Linux, so we're stuck with whatever development tools are available for Linux. Windows development host is not an option for us at this time. This is because the Timesys portion to do Linux development on the A5 core is 100% Linux hosted with no Windows option.
This is what I'm doing: PEx generates code for the A5 on the Vybrid. The resulting code is ported so that it runs on the M4 core. This means I have to do some fixups in the code especially in the auto-generated assembly. The amount of code to port isn't as much as I had feared and it is certainly scriptable. The goal is to have PEx generate code and my script will port the code before compilation. This way, all source is under PEx control and will be more or less transparent. I've gotten the ported code to work even with MQX 4.0.2 which PEx does not support on Vybrid. I was able to set up a GPIO pin using PEx and then toggle it, making a simple square wave and do printf() to the MQX serial port console. So far, so good.
Hi Jack,
I am trying to get PEx and MQX to work together for the A5 Vybrid core with the IAR toolset. Any chance you could post the details of your work?
Hi Vojtech,
Yes, I'm using DS-5 GCC, because PEx doesn't support the ARM CC compiler. This is on 32-bit Ubuntu 12.10. My ARM DS-5 installation is v5.16 with PEx, update, and the Vybrid Service Pack.
Using the ARMCC compiler, I was able to get the same successful results you did. This is the first time I've been able to compile PEx code without errors.
Using the DS-5 GCC Compiler, I made the changes you outlined and I get errors:
**** Build of configuration Debug for project TEST_GCC ****
make all
Building file: ../Sources/Events.c
Invoking: GCC C Compiler
arm-linux-gnueabihf-gcc -I"/home/thu/DS-5-Workspace-oobedemo/TEST_GCC/Generated_Code" -I"/home/thu/DS-5-Workspace-oobedemo/TEST_GCC/Sources" -I"/home/thu/.ds-5/workbench/ProcessorExpert/lib/Vybrid/iofiles" -I"/home/thu/.ds-5/workbench/ProcessorExpert/lib/Vybrid/pdd_100212/inc" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Sources/Events.d" -MT"Sources/Events.d" -o "Sources/Events.o" "../Sources/Events.c"
Finished building: ../Sources/Events.c
Building file: ../Sources/Exceptions.c
Invoking: GCC C Compiler
arm-linux-gnueabihf-gcc -I"/home/thu/DS-5-Workspace-oobedemo/TEST_GCC/Generated_Code" -I"/home/thu/DS-5-Workspace-oobedemo/TEST_GCC/Sources" -I"/home/thu/.ds-5/workbench/ProcessorExpert/lib/Vybrid/iofiles" -I"/home/thu/.ds-5/workbench/ProcessorExpert/lib/Vybrid/pdd_100212/inc" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Sources/Exceptions.d" -MT"Sources/Exceptions.d" -o "Sources/Exceptions.o" "../Sources/Exceptions.c"
../Sources/Exceptions.c:37:0: warning: ignoring #pragma arm [-Wunknown-pragmas]
../Sources/Exceptions.c:38:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:40:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:46:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:48:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:54:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:56:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:62:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
../Sources/Exceptions.c:64:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
make: *** [Sources/Exceptions.o] Error 1
**** Build Finished ****
It seems that the DS-5 GCC compiler doesn't understand the '#pragma arm' pragma.
FYI, I checked the "Project_Settings/Linker_Files" directory and there is no "ProcessorExpert.ld" file, only ProcessorExpert.scat. Is the .ld file a temporary file?
Thanks.
Hi Vojtech,
I will try it out. Thanks.
Hello,
I have reproduced the errors reported in your original post. Since there is no workaround for this problem we will try to prepare hot-fix for you as soon as possible.
Best regards
Vojtech Filip
Processor Expert Support Team
Hello,
please find the hot-fix for you issue attached. To apply it please copy ProcessorExpert folder in the archive over existing ProcessroExpert component in your installation of Driver Suite on your disc.
We are sorry for inconvenience.
Best regards
Vojtech Filip
Processor Expert Support Team