- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made my file system, kernel, app and uploaded, this is the source:
# include "D:\Proyectos\Marzo\NIOS2ndTry\Krl\build\include\nios2_system.h"# include <stdio.h> typedef unsigned char INT8U;# define NIOSTmr (np_timer *)na_high_res_timer # define pio ((np_pio *)na_led_pio)# define PIO pio->np_piodata void TmrISR(void); int main(void) { (*NIOSTmr).np_timerperiodl = 0xB400; (*NIOSTmr).np_timerperiodh = 0x04C4; (*NIOSTmr).np_timercontrol = np_timercontrol_cont_mask | np_timercontrol_start_mask | np_timercontrol_ito_mask ; nr_installuserisr(na_high_res_timer_irq, &TmrISR, 0); while(1) { } return 0; } void TmrISR(void) { static INT8U Ctr; (*NIOSTmr).np_timerstatus &= ~np_timerstatus_to_mask; PIO = Ctr++; printf("%d seconds\n", Ctr); } but when i make my application, and try to run it, the system resets itself. Any suggestions, corrections of the malfunctioning?Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can not use altera hal for interrupt service in uClinux. Read ch10 Interrupt Handling on the book "Linux device drivers 3rd ed.".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you are tryin to implement ISRs in a user-land application, and as far as I know, I don't think you can do this. All interrupts must be built into the kernel as a driver, correct? you need to write an actual driver, not a user application.
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