Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Interrupt Problem

Currently i am working on low level driver for Nand Flash in NIOS II.In my system following component are included DDR_SDRAM,JTAG_UART,PERFORMANCE COUNTER,PIO(LED),NFC(Nand flash controller).In my sytem i use interrupt on PIO Base.

in my low level API like read and write i use it as following code.

write()

{

//data write code

//enable NFC

while(intrstat == 0);

intrstat = 0;//globel variable

}

read()

{

//data read code

//enable NFC

while(intrstat == 0);

intrstat = 0;

}

main()

{

IOWR(LED_BASE,0,0);

alt_irq_register(NFC_IRQ,edge_capture_ptr,handle_nfc_interrupts);

alt_irq_enable(NFC_BASE);

write();

read();

}

static void handle_nfc_interrupts(void* context, alt_u32 id)

{

volatile int* irq_capture_ptr = (volatile int*) context;

printf("Into the nfc_handler:\n");

alt_irq_disable(NFC_BASE);

IORD(NFC_BASE,NFC_STATUS);

IOWR(LED_BASE,0,1);

intrstat = 1;

alt_irq_enable(NFC_BASE);

}

my problem is when i call the write or read API it goes in infinite loop and also not call the ISR for it.so pls give me help what change i needed in above code..............

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    @phillip

    Hi,

    finaly................................................

    i reslove my problem.

    this issue occurs from IP side so i tell about it to IP devloper for my system

    and they give me new .sof after some modification and then all my code gone very well.

    Thanks @philipp to continuesly give me help,

    Regards,

    Jayesh
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    --- Quote Start ---

    reslove my problem.

    --- Quote End ---

    Great to hear!

    Thanks @philipp to continuesly give me help,

    Well, I couldn't really help you......

    but anyway you are welcome!

    Best wishes to India!

    Philipp