Forum Discussion
Altera_Forum
Honored Contributor
21 years agoUnplanned NIOS2 RESTART !
Hello All I have a big project with time critical devices - VGA and Sound playing VGA Refresh use separate video banks in separate SDRAMs I use DMA for VGA refresh - ...
Altera_Forum
Honored Contributor
21 years agoHere is IRQ handler
And i find what string is influent to unplaned RESTART I mark in comments my try's and effects wich i get (1) - I try set IRQ wich can interrupt sound IRQ Result - NO EFFECT (SOUND WORK but VIDEO crash refresh) (2) - I try set manual enable VGA_IRQ Result - NO EFFECT (SOUND WORK but VIDEO crash refresh) (3) - I try to enable ALL Interupts inside Sound_irq Result - I get workable Sound and Video - ALL work's fine but sometimes nios restart programm by random way. void __irq_sound_handler(void* context,alt_u32 id) { if((dsp_buff[0] & FIFO_A_EMPTY) && playing) { // alt_u32 old_priority=alt_irq_interruptible(VGA_DMA_IRQ); // (1). // alt_irq_enable_all(NIOS2_STATUS_PIE_MSK); //(3) // alt_irq_enable(VGA_DMA_IRQ); (2) FillSndBuff(); // fill sound fifo counter++; // counter of irq calls dsp_buff[1]=1; // IRQ ENABLE FLAG // Enable sound IRQ for next call (by default it IRQ ENABLE cleared when i sound fifo get chipselect) // IRQ is asserted when FIFO buffer signal almost_empty get rising edge // alt_irq_non_interruptible(old_priority); //(1). } } So I want create interuptable IRQ handler What I do wrong ? Any Ideas ?