AnsweredAssumed Answered

Ethernet RX interrupt for BF548 EZ kit

Question asked by Tharindu on Aug 22, 2012
Latest reply on Sep 5, 2012 by Prashant

Hi all,

 

I have a multi-threaded LwIP application on the BF548 dev kit. My Ethernet connection to the chip is working as expected and so does my UDP sockets. I set up an interrupt service routine to PE8  but it does not seem to work. The initialization runs as the first boot thread and the LwIP runs afterwords. I checked the program by using polling and it does receive the packet. I used a code example for initializing GPIO and the interrupt that was posted on the forum. Any help is greatly appreciated. Anyway, here is the code..

 

#include <defBF548.h>

#include <ccblkfn.h>

#include <cdefBF548.h>

#include <sys/exception.h>

#include <services/services.h>

#include <drivers/adi_dev.h>

#include <stdio.h>

 

   

EX_INTERRUPT_HANDLER(GPIO_ISR);

 

 

void int_set(void)

{

 

 

*pPORTE_FER=0;  //Enable port D for GPIO functionality

*pPORTE_DIR_CLEAR=PE8;  //PD0 as input

*pPORTE_INEN=PE8;  //input enable PD0

 

 

*pPINT2_ASSIGN=0x00000101; //Assign PortD to PINT2 block

 

 

*pPINT2_MASK_SET=1;  // unmask the GPIO interrupt

*pPINT2_EDGE_SET=1;  // Edge on PD0 triggers interrupt

*pPINT2_LATCH=1;     //Clear the latch to avoid false interrupt

 

 

*pSIC_IAR11=0xf4ffffff;    //[27:24] in SIC_IAR1 meant for PINT2 interrupt

 

 

register_handler(ik_ivg12,GPIO_ISR);

 

 

 

          printf("Interrupt set..\n"); // Debug. The code does run through

 

 

 

*pSIC_IMASK2=0x40000000;   //unmask PINT2 interrupt at SIC level

 

 

}

Outcomes