This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EMAC can't receive any frame using interrupt.

Other Parts Discussed in Thread: RM48L952, HALCOGEN

Hi, 

I encountered a problem in debug EMAC module of RM48L952, I use the example of "HALCoGen_EMAC_Driver_with_lwIP_Demonstration",

I use ARP protocol to test send and receive, in my project, I can send ARP request packet successfully, but I can't receive any ARP response packet  from PC.  Why?

help me

thanks and regards

  • Clark,

    Since your question is about the use of HALCoGen, I have passed your post the the HALCoGen team and they will respond to you shortly.

    Thanks and regards,

    Zhaohong

  • Hi Clark,

    It appears that there are others that have faced this problem before. It's possible that you're sending data too soon after the initial handshake. Try adding a delay before the first data packet is sent.

    There's more on this thread here on the lwIP forum : http://lists.gnu.org/archive/html/lwip-users/2006-11/msg00048.html


    Hope this helps.

    Regards,

    Chaitanya

  • Hi Chaitanya,
    in my project, the ipMode parameter of lwIPInit() function is set to IPADDR_USE_STATIC. so in the lwIPInit() function, run netif_set_up() function. in the netif_set_up() function, I shield the etharp_gratuitous() function. this function send arp request packet.
    I think the initial handshake as you say just is this process, isn't is?
    if yes, but i shield the initial handshake via shielding the etharp_gratuitous() function.

    in the EMAC_LwIP_Main() function, while(1) part, I send arp request packet every 2 seconds. But still not receive any data from PC. below the code:

    while(1)
    {          
             send_arp_request();
      delayMs(2000);//延时2S。
             sprintf(buf, "%d", countEMACCore0RxIsr);
             sciDisplayText(scilinREG, buf, sizeof(buf));         
     
    }

    Why?

    in the "HALCoGen_EMAC_Driver_with_lwIP_Demonstration" project, to interrupt receiving part, I didn't do any changes except add a debug variable "countEMACCore0RxIsr". below, ISR code of interrupt receive:
    static int countEMACCore0RxIsr = 0;
    #pragma INTERRUPT(EMACCore0RxIsr, IRQ)
    void EMACCore0RxIsr(void)
    {
      countEMACCore0RxIsr++; 
      lwIPRxIntHandler(0);
    }

    "countEMACCore0RxIsr" variable value always is 0 in debug process.

    why?

    thanks and regards

  • Hi Clark,

    I'm sorry I wasn't able to reply earlier.

    Just as a sanity check, have you made sure that both the PC and the board are on the same network/subnet? If DHCP is enabled for the PC, make sure to switch that to static IP as well.

    Also, does the application ever go to the EMACCore0RxIsr() while debugging? If there's no data received, then this interrupt will never occur and countEMACCore0RxIsr will remain 0 because it never goes to the ISR. So this comes back to your original problem rather than being an issue in itself.

    Apart from this, I have not really faced this issue before. Since this is more to do with the lwIP side of things, you might get more help by asking on the lwIP mailing list. I have found a couple of threads where people have faced the same issue, but in their case the delay seems to have fixed it.

    Hope this helps.

    Thanks and Regards,

    Chaitanya

  • Hi Chaitanya,
    I am sure that both the PC and the board are on the same network/subnet. make sure PC switch the static IP as well. but there is still questions.

    as you said, " you might get more help by asking on the lwIP mailing list."
    but I don't konw where the lwIP mailing list is? can you tell me?


    Thanks and Regards

  • Hi Clark,

    You can sign up for the mailing list here. You have to subscribe before you ask any questions.

    https://lists.nongnu.org/mailman/listinfo/lwip-users

    Also you could go through the lwIP wiki site to see if there's something that might help. There is some material there about ARP and how to support ARP in your application or driver using lwIP. Do check if that helps.

    Thanks and Regards,

    Chaitanya