Forum Discussion

Rodo's avatar
Rodo
Icon for Occasional Contributor rankOccasional Contributor
4 years ago

Why doesn't main() work/run when I add a timer?

HI all,

I'm playing with an old Bemicro kit (MAX10: 10M08DAF484C8GES) and I got it blinking an LED (D1). I now added a timer (timer_0) in platform designer, made the connections and compile. I get no errors. The kit has 8 LEDs and every time I make a change I change which LEDs come on so I know the hardware changes are working (they are). Then I go to the C program in eclipse, re-generate the bsp. Added some code to register the isr and irq. Run the code and nothing happens. I have the software turn off all LEDs so I know it is working but the LEDs (set in hardware) never turn off. It doesn't look like main() is executing at all. I try to "Debug as" nios hardware and it looks like it is stuck in an interrupt but that may just be my guess. The code for the ISR (Interrupt Service Routine) only clears the flag for the timer irq. I wonder what I'm missing? Why doesn't main work?

Here are the pictures of the platform designer and timer. I could show the code for my project but since it never gets to main ...seems pointless. The interrupt number in the picture shows "0" (bottom right). I tried changing it to "5" but still same results. Any help is appreciated. Thanks

5 Replies