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;}
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.