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.

TMS570LC4357: Multicast is not able to receive data

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi team,

Here's an issue from the customer may need your help:

When porting lwip1.4.1 on the TMS570LC4357, a multicast frame was not received and broadcast and unicast frames were received correctly. It was then discovered that the multicast frame was not received by the interface from the EMAC.

The customer's drive is generated using HALCOGEN, with some modifications as needed, and the following code is the part used to call the EMAC interface:

netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP | NETIF_FLAG_IGMP;

  EMACInit(hdkif->emac_ctrl_base, hdkif->emac_base);

 

  MDIOInit(hdkif->mdio_base, MDIO_FREQ_INPUT, MDIO_FREQ_OUTPUT);

  while(delay--);

 

  EMACRxBroadCastEnable(hdkif->emac_base, 0);

 

  /* Set the MAC Addresses in EMAC hardware */

  EMACMACSrcAddrSet(hdkif->emac_base, hdkif->mac_addr);

 

  /* Acknowledge receive and transmit interrupts for proper interrupt pulsing*/

  EMACCoreIntAck(hdkif->emac_base, EMAC_INT_CORE0_RX);

  EMACCoreIntAck(hdkif->emac_base, EMAC_INT_CORE0_TX);

 

  EMACRxUnicastSet(hdkif->emac_base, 0);

EMACRxMultiCastEnable(hdkif->emac_base, 0);

  EMACNumFreeBufSet(hdkif->emac_base, 0, 10);

 

  /* Write the RX HDP for channel 0 */

  EMACRxHdrDescPtrWrite(hdkif->emac_base, (U32)rxch->active_head, 0);

 

  EMACTxEnable(hdkif->emac_base);

  EMACRxEnable(hdkif->emac_base);

 

  EMACMIIEnable(hdkif->emac_base);

 

 

  /**

  * Enable the Transmission and reception, enable the interrupts for

  * channel 0 and for control core 0

  */

  EMACTxIntPulseEnable(hdkif->emac_base, hdkif->emac_ctrl_base, 0, 0);

  EMACRxIntPulseEnable(hdkif->emac_base, hdkif->emac_ctrl_base, 0, 0);

 

Could you help check is there anything wrong with the code above? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    You also need to set the MACHASH1 and MACHASH2 registers up to match the multicast address you want to listen to. It's a hash, so it takes the 48 bits of the MAC address and hashes down to a single bit position. You have to set that position in the HASH registers.

    --

    Thanks & Regards,

    Jagadish.

  • Hi Jagadish,

    Thanks for your support.

    What should this hash value be set to?  How should this hash be calculated?

    With 0 channel set to 0xffffffffff, multicast data is able to be received.

    Thanks and regards,

    Cherry

  • Hi Cherry,

    What should this hash value be set to?  How should this hash be calculated?

    First calculate Hash function of 6 bits from the MAC address you want to listen using below given formula

    Here Hash_fun(0) means bit 0 and Hash_fun(1) means bit 1 and so on.

    Now based on input MAC address( 00 00 00 00 00 00 to FF FF FF FF FF FF) you can get 64 possible values right i.e., from 0 to 63.

    So, to receive corresponding MAC address you have to set the corresponding bit in MACHASH Register(MACHASH1 for 0 to 31 bits and MACHASH2 for 32 to 63 bits).

    For example:

    If you want to receive multicast MAC address of 00 00 00 00 00 01, its 6bit hash function value is 0b000001 i.e. value 1 so we have to set the 1st bit in HASH register i.e., 1st bit in MACHASH1 register, so the register values are

    MACHASH1 = 0x00000001

    MACHASH2 = 0x00000000

    Similarly, you can even select multiple values in HASH register to receive multiple addresses .

    --

    Thanks & Regards,

    Jagadish.