- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to write a simple interrupt service routine for UART. MY code is as follows:
in main function:
alt_ic_isr_register(UART_0_IRQ_INTERRUPT_CONTROLLER_ID,
UART_0_IRQ,
&receive_data,
uart_capture_ptr,
0x0);
ISR function
static void receive_data(void* context)
{
// put new char into buffer from UART
volatile int *uart_capture_ptr = (volatile int*) context;
// Store the value in the Buttons edge capture register in *context.
*uart_capture_ptr = IORD_8DIRECT(UART_0_BASE, 0x0);
// Reset the Buttons edge capture register.
IOWR_16DIRECT(PIO_0_BASE, 0, (alt_16)uart_capture_ptr);
}
The program builds but seems to terminate upon the initialisation of the isr (i.e whilst executing the alt_ic_isr_register function). Does anyone know why this is the case and how I should fix it?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see an example of interrupt initialization and ISR service for PIO https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/n2sw_nii52006.pdf, pg8-16 & 8-17. To confirm where it fails, try to print out the return code of "alt_ic_isr_register".
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page