- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I wrote a simple program to start learning IRQ programming. I created a simple SOPC custom component (called simper_irq). This is the HDL: pastebin.com/9fyfZQtL Also, I created a simple program in C. This is the source: pastebin.com/bmChv4vh The value of flag should increase (at least once). However, it's the same all the time. I can't see where I'm wrong. Could anybody help me? Thanks a lot.Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't see the attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here we go again.
There's no attachements. These are the links: http://pastebin.com/9fyfzqtl http://pastebin.com/bmchv4vh Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not an expert of custom sopc component.
Have you associated the irq_port signal to the avalon irq line? I think this should be in the _hw.tcl file. Other remark: in the HDL you assign irq a high level but never clear it. I think this is not correct. The C code is correct, provided SIMPLER_IRQ_0_IRQ really refers to your component irq. Again: in the isr you must reset the irq otherwise it will retrigger perpetually- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
have you include the irq header?
--- Quote Start --- #include <sys/alt_irq.h> --- Quote End ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You shouldn't cast your function pointer to the interrupt handler and it should be with the correct prototype:
void simpler_interrupts(void *context, alt_u32 id);
As flyinghigh says, you should also include the alt_irq.h file to get the correct declaration for the register function. Check also the code returned by alt_irq_register()
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page