hi everyone,
i'm new with ARMprocessor and dont know too much about DS-5. just alittle bit from my Softwares >>> SoC EDS 17.1 (from Altera) - DS-5 5.28 and my OS is Windows 10. I am using DS-5 for my SoC FPGA (DE0_Nano_SoC) Altera, which i use Toolchain Altera Baremetal GCC. Nowdays i wanted to use Interrupt for Private Timer and i got error which has conflict with the "alt_interrupt.c" source file from Altera HWlib. And the error appears with > selected processor does not support `cpsid i' 'cpsie i' in arm mode. I read all of the latest Disscusion in Community but didnt help me. I must say, that i manually write my type of cpu(Cortex- A9), type of architecture and etc. but didnt help. i even tried to compile in thumb mode, but didnt help. I thought mybe its a Bug between DS5 v5.28 and Windows10, so i tried it in Linux but i got the same error. When i use to compile another program without interrupt, then everything is fine. the problem is just these lines >>
ALT_STATUS_CODE alt_int_cpu_enable(){ alt_setbits_word(alt_int_base_cpu + 0x0, 0x1); /* iccicr */ /* Unmask IRQ interrupts from current processor. */#if defined(__ARMCOMPILER_VERSION) __asm("CPSIE i");#elif defined(__ARMCC_VERSION) __enable_irq();#else __asm("CPSIE i");#endif return ALT_E_SUCCESS;}ALT_STATUS_CODE alt_int_cpu_disable(){ alt_clrbits_word(alt_int_base_cpu + 0x0, 0x1); /* iccicr */ /* Mask IRQ interrupts from current processor. */#if defined(__ARMCOMPILER_VERSION) __asm("CPSID i");#elif defined(__ARMCC_VERSION) __disable_irq();#else __asm("CPSID i");#endif return ALT_E_SUCCESS;}
Which GCC tools and version are you using?
What build commands are you using to build the source file?
It would be worth checking that the build commands include the right "-march=armv7-a" and/or "-mcpu=cortex-a9" options, so the source is being built for the right Arm architecture version.
Hi elinor ,
thanks for your answer. But when i change --mcpu and --march i got another error. which is :
Description Resource Path Location Typemake: *** [makefile:31: test-hps_5.axf] Error 1 test-hps_5 C/C++ Problemregion `ram' overflowed by 45000 bytes test-hps_5 C/C++ Problemtest-hps_5.axf section `.text' will not fit in region `ram' test-hps_5 C/C++ Problem
that means, i didnt choose the right Target for GCC Linker (cycloneV-dk-oc-ram-hosted.ld) , but with like a Hello World example thats work. And when i choose (cycloneV-dk-ram-hosted.ld) i got error in Debugger, when i wanna connect with Core with this error :
ERROR(CMD16-TAD11-NAL22): ! Failed to load "test-hps_5.axf"! Failed to write 8 bytes to address S:0x00118194! General error on memory or register access.set debug-from mainstartWARNING(CMD399-COR168): ! Failed to start the target! No function named "main" could be foundWARNING(CMD407): Trying the entry point insteadERROR(CMD426): Cannot find symbol to start or entrypoint, the file or load commands may be used to set the entrypoint
P.S: Right Now: my Toolchain is Altera Bare metal GCC 6.2.0, DS-5.27.1, OS Ubuntu 16.10 LTS
Source Files : alt_clock_manager.c alt_generalpurpose_io.c alt_globaltmr.c alt_interrupt.c
alt_timers.c alt_watchdog.c
The make error message suggests that the ld linker script file being used does not have a large enough space allotted for the amount of code your built source files are generating. Given this, I believe the DS-5 memory access error is likely due to using an incompatible ld linker script. I suggest either linking with a ld file that is compatible with both your image data and the board's available memory or generating your own ld file which matches the board memory map. Once you are confident of the image placement, then I would try DS-5 debug again.
Hi Elizabeth,
one more Thanks for your reply.
I solved the Problem, i didnt use semihosting function for my Code, after use it , that worked and the correct Linker was (cycloneV-dk-oc-ram-hosted.ld) . But now i have another Problem and i cant run my Interrupt for my Timer. I dont know what i am missing for my interrupt initialize. My Timer settings are correct i examined it without interrupt instruction. Here is the Code :
void setup_interrupt()
{
assert(ALT_E_SUCCESS == alt_int_global_init()); assert(ALT_E_SUCCESS == alt_int_cpu_init());
assert(ALT_E_SUCCESS == alt_int_dist_enable(199));
assert(ALT_E_SUCCESS == alt_int_dist_target_set(199, 0x1));
assert(ALT_E_SUCCESS == alt_int_global_enable_all()); assert(ALT_E_SUCCESS == alt_int_cpu_enable_all());}
void setup_hps_timer()
{ uint32_t temp = 1000000; assert(ALT_E_SUCCESS == alt_gpt_tmr_stop(ALT_GPT_SP_TMR0)); assert(ALT_E_SUCCESS == alt_gpt_mode_set(ALT_GPT_SP_TMR0, 0x1)); assert(ALT_E_SUCCESS == alt_gpt_counter_set(ALT_GPT_SP_TMR0, temp)); assert(ALT_E_SUCCESS == alt_gpt_int_enable(ALT_GPT_SP_TMR0)); assert(ALT_E_SUCCESS == alt_gpt_tmr_start(ALT_GPT_SP_TMR0));}
void alt_int_handler_irq(){ printf("Interrupt happened\n"); assert(ALT_E_SUCCESS == alt_gpt_tmr_reset(ALT_GPT_SP_TMR0));}
P.S: the source codes are same and nothing has changed.
I hope, this issue would gonna be my last problem :D.