Forum Discussion

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

PCI express and NIOS

I had a NIOS system working with my custom peripheral this morning on the transceiver starter kit this morning.

I then added a PCI express interface and had to modify the design a bit so I could fit it.

I then recompiled the NIOS and got....

undefined reference to `alt_ic_isr_register'

I see that# define ALT_ENHANCED_INTERRUPT_API_PRESENT is missing from the system.h file for some reason.

Any ideas?

1 Reply

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

    Discovered problem.

    It was my fault not really intuitive though.

    When I removed the JTAG UART from Qsys and regenerated .sopcinfo

    I got the error from eclipse

    undefined reference to `alt_ic_isr_register'

    Of course the JTAG UART qsys inclusion was generating

    # define ALT_ENHANCED_INTERRUPT_API_PRESENT

    In the system.h file.

    My custom peripheral has no HAL driver and therefore no# _sw.tcl file to indicate enhanced interrupt API and therefore I needed to use legacy interrupts.

    What I did was use conditional compilation i.e.

    # ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT

    static void codec_isr (void *context)

    # else

    static void codec_isr(void *context, alt_u32 id)

    # endif

    {

    }

    And

    # ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT

    a = alt_ic_isr_register (CODEC_BURST_MASTER_0_IRQ_INTERRUPT_CONTROLLER_ID ,CODEC_BURST_MASTER_0_IRQ, codec_isr, NULL, 0x0);

    # else

    a = alt_irq_register (CODEC_BURST_MASTER_0_IRQ_INTERRUPT_CONTROLLER_ID ,NULL, codec_isr);

    # endif

    And of course, using the legacy interrupts, the code now builds.

    Let’s see if that will work.