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.

TMS570LS3137: About Safety feature "ETH2A"

Part Number: TMS570LS3137

I am trying to perform an I/O Loopback test for the safety function ETH2A of the TMS570LS31x.
The environment to check is <Hercules Safety MCU Development Kit TMS 570 MCU>.

The transmission is completed normally, but the reception is not completed.

My source code is as follows.
Please let me know if there is a mistake.
The function called in the code is a function generated by HALCoGen04.05.01.

I will ask you just in case.
Is loopback using MACCONTROL register internal loopback?

****** CODE *****************************************************************************

void TestEthLpbk(void) {
  hdkif_t *hdkif;
  hdkif = &hdkif_data[0U];
  boolean retValue;
  uint8 tx_data[60U] = { /* Test data for transmission */
    0x00, 0x80, 0x2F, 0x25, 0x56, 0xBA, 0x98, 0x90, 0x96, 0xD8 };
  uint8 rx_data[60U] = {0U}; /* Receive buffer */
  uint16 dataLen = 60U;
  pbuf_t pbuf = { NULL, tx_data, dataLen, dataLen };
  uint16 rcvLen = 0U;
  uint16 cnt;

  /* Initialize EMAC for sending and receiving */
  EMACHWInit( selftestmacAdd );
  EMACRMIISpeedSet(EMAC_BASE, EMAC_RMIISPEED_100MBPS);

  /* Enable Loopback */
  Dp83640EnableLoopback( hdkif->mdio_base, hdkif->phy_addr );
  EMACEnableLoopback( hdkif->emac_base );

  /* Data transmission */
  retValue = EMACTransmit( hdkif, &pbuf );
  if( retValue == TRUE ) {
    /* Receive data */
    EMACReceive( hdkif );
    rcvLen = hdkif->rxchptr.active_head->bufoff_len;
    for( cnt = 0U; cnt < rcvLen; cnt++ ) {
      rx_data[cnt] = HWREGB((hdkif->rxchptr.active_head->bufptr)+cnt);
    }

    /* Data Verify */
    for( cnt = 0U; cnt < rcvLen; cnt++ ) {
      if( tx_data[cnt] != rx_data[cnt] ) {
       /* Loopback fault */
      }
    }
  }
  else {
    /* Failed to send data */
  }

  /* Disable Loopback */
  EMACDisableLoopback( hdkif->emac_base );
  Dp83640DisableLoopback( hdkif->mdio_base, hdkif->phy_addr );

  return;
}