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.

MCU-PLUS-SDK-AM243X: SDK 8.06 45 ICSS_EMAC_txPacket() error management

Part Number: MCU-PLUS-SDK-AM243X

Hello,

Between SDK 8.05 and SDK 8.06.45 the error management inside ICSS_EMAC_txPacket() has changed.

I am facing a problem where on the evaluation board there is two ethernet ports (eth1 and eth2), when only one port has link then whenever we want to send a packet at bootup it will try to send on both port (which is normal since the mac table is not yet build up) but then 1 port has no link so the function ICSS_EMAC_txPacketEnqueue() returns ICSS_EMAC_ERR_TX_NO_LINK which is expected.

Here is the code in the SDK I am talking about :

So in this case ret1 or ret2 is then equal to ICSS_EMAC_ERR_TX_NO_LINK

The problem is then at the end of the ICSS_EMAC_txPacket() function we return "return ((ret2 << 16) | (ret1));" so if ret1 or ret2 is not 0 then the upper layer sees as if the send of the packet failed.

For me the behavior was on the ARP, because it was failing then the board was sending the ARP over and over on the available port and because it failed on the second port it was returning an error and tried over and over.

To fix this I have made this change:

I would like to have a feedback on this, would you have a proper fix on your side ? Or maybe you consider the fix I made as the good one ?

Thank you

Regards

Yanyves Genereux

  • Hi Yanyves Genereux,

    Thanks for your query. Allow me till end of this week to verify the fix and see if this is intended or a bug?

  • Hello,
    Sure no problem, it is not blocking for us, but we would like to know if the fix I applied is good or I missed something that may lead to some other problems
    Thank you

    Regards

  • Hello,
    Do you have some news on this ?
    Regards

  • Hi Yanvyes,

    This is fixed in Industrial Communications SDK 9.0. Copying the updated code for reference. 

    The intend is to get the Port1 status in 16 bit (LSBs) and Port2 in the other.Please confirm this will solve the issue you are seeing

    Regards,
    Prajith

  • Hello,

    Thanks for the answer.

    Are the ret1 and ret2 still initialized to SystemP_FAILURE per default ? If yes then it will still cause a problem.

    And the change you have applied is in the else case of the "if (portNumber == ICSS_EMAC_PORT_0)    /* special case to use MAC learning */", but for us the problem appears inside the if case.

    I understand the intent to get the two error codes in only one, but can we cannot set an error in case of one ICSS_EMAC_ERR_TX_NO_LINK. Taking ICSS_EMAC_ERR_TX_NO_LINK as an error force us to have both port connected, when it should be working when only one port is connected.

    Regards

    Yanyves

  • Hi Yanves,

    Thanks for the feedback. You are right, the intention is to have separate error codes for both ports so that  application can take action based on the error codes.

    but can we cannot set an error in case of one ICSS_EMAC_ERR_TX_NO_LINK.

    Is it not possible to take action based on the individual error codes? Lets say don't flag an error if atleast one port return status is good?

    Regards,
    Prajith

  • Hello,
    If I understood properly you are asking if we can manage the return error in the upper level?

    If this is the case I would say that this may not be enough, LWIP for example may want to send frame too. 

    From my opinion it is better to manage this on the low level so it is managed for everything.

    Regards

    Yanyves

  • Hi Yanyves,

    If I understood properly you are asking if we can manage the return error in the upper level?

    Yes. This is the intention. We have had some requirements from certain Application stack to return the transmission status of both ports to the upper layer so that appropriate decision can be taken.  Managing in low layer wont work as the info needs to be available for application. Hope this clarifies.

    Regards,
    Prajith