I also had rough times with building the demo and later debugging it until it worked, so I share here the main issues I had in hopes it would be useful.
First, importing the project into DS-5 did not import any of the include paths and the other settings and compiler flags, so they had to be added manually.
The include paths can be added one by one by compiling and searching the missing files on the disk and adding it in the compiler “include paths -I”.
The toolchain I used was arm-altera-eabi-gcc.
Compiler, assembler and linker flags that are needed in the settings page (without this you get all sorts of missing asm instructions and non-compatibility to existing libraries):
-mcpu=cortex-a9
-mfloat-abi=softfp
-march=armv7-a
-mfpu=vfpv3
As mentioned above, I needed to exclude alt_interrupt_armcc.c from the build as it was not assembly compatible with gcc. Further, fpga_support.c was also excluded because symbols relating to FPGA image were missing , I assume that more complex builds that include FPGA image may not have this problem.
Next, ISR handlers also did not install correctly, giving runtime exceptions. the linker flags
-defsym=__cs3_isr_swi=FreeRTOS_SWI_Handler and -defsym=__cs3_isr_irq=FreeRTOS_IRQ_Handler did nothing on my eclipse build 14 and the default compiled libraries did include an empty stubs interrupt vector. So when SWI interrupt was raised, the demo was stuck at an infinite loop.
For this I changed in portASM.s from:
.type FreeRTOS_IRQ_Handler, %function
FreeRTOS_IRQ_Handler:
to:
.type __cs3_isr_irq, %function
__cs3_isr_irq:
similarily for SWI I changed to:
.type __cs3_isr_swi, %function
__cs3_isr_swi:
Note that the folowing doesn’t work (crashes with undef / dabort exceptions) DONT USE:
void attribute ((interrupt)) __cs3_isr_swi(void) {
FreeRTOS_SWI_Handler();
}
void attribute ((interrupt)) __cs3_isr_irq(void) {
FreeRTOS_IRQ_Handler();
}
Other than that it works, but it was a quite difficult starting point.
Generally, I think demos should beware of parameters imports, I don’t know why it did not import any definitions even when instructed to import the example in place.
I hope sharing this information will help with other’s electronic designs
Guy Shemesh - ePiccolo Engineering