Skip to main content
Visitor II
September 9, 2008
Question

Ethernet interupt not interupting

  • September 9, 2008
  • 2 replies
  • 869 views
Posted on September 09, 2008 at 06:01

Ethernet interupt not interupting

    This topic has been closed for replies.

    2 replies

    rickardAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:55

    I having problem with the Ethernet interupt. I got the transmit and receive to work but I can't get the interupt to work.

    The ethernet is set up by:

    Code:

    void PF_Enet_Init(void)

    {

    ENET_InitClocksGPIO(); /* configure all GPIO */

    ENET_Init(PHY_FULLDUPLEX_100M); /* Operating mode = Fullduplex 100Mbs */

    ENET_Start(); /* start Receive & Transmit */

    PF_Setup_INT(ENET_ITLine, PF_Enet_Interrupt); // Sets up interupt

    }

    and the PF_Setup_INT looks like:

    Code:

    void PF_Setup_INT(uint16 VIC_Source, void (*InterruptFunction)(void))

    {

    uint16 Priority;

    if(VIC_Source < VIC_REGISTER_NUMBER)

    {

    Priority = VIC_Source;

    VIC0->VAiR[Priority] = (uint32)InterruptFunction; //Configuration of the ISR vector address

    VIC0->INTSR &= ~(VIC_MASK << Priority); //Set interrupt type to IRQ

    VIC0->VCiR[Priority] |= VIC_VECTOR_ENABLE_MASK; //Enable vector interrupt

    VIC0->VCiR[Priority] &= VIC_IT_SOURCE_MASK; //Select the interrupt source

    VIC0->VCiR[Priority] |= Priority; //and set the priority

    VIC0->INTER |= (VIC_MASK << Priority); //Enable the interrupt request lines.

    Vic0Inter = VIC0->INTER;

    }

    else

    {

    Priority = VIC_Source - VIC_REGISTER_NUMBER;

    VIC1->VAiR[Priority] = (uint32)InterruptFunction; //Configuration of the ISR vector address

    VIC1->INTSR &= ~(VIC_MASK << Priority); //Set interrupt type to IRQ

    VIC1->VCiR[Priority] |= VIC_VECTOR_ENABLE_MASK; //Enable vector interrupt

    VIC1->VCiR[Priority] &= VIC_IT_SOURCE_MASK; //Select the interrupt source

    VIC1->VCiR[Priority] |= Priority; //and set the priority

    VIC1->INTER |= (VIC_MASK << Priority); //Enable the interrupt request lines.

    Vic1Inter = VIC1->INTER;

    }

    }

    I have based my code on STR91x_webserver_v1_1 but this code does not use interupt in ethernet which I require.

    Anyone have a suggestion what I've missed?

    rickardAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:55

    I've found out what I've missed.

    In the init i added:

    ENET_DMA->IER = 0x80; // enable interupt when RX done

    and in the interupt I've added:

    ENET_DMA->ISR = 0x80; // Clear the interupt status for RX done