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.

C6678 ethernet port 0 won't transmit packet

Good day!

I'm working with EVM6678 board and I'd like to use it in AMC chassis.

I've edited nimu_eth.c to support EMAC port 0 (which is routed to AMC) instead of EMAC port 1 (which is routed to on-board PHY):

    ethInfo.inport = pa_EMAC_PORT_0;  in EmacStart() function

and

        gTxPort = EMAC_PORT_USED; in EMACInit_Core() function.

I call InitSGMII() function for port 0 after platform_init() function call.

I create a UDP socket and send 1KB data using EMAC port 0, but packets aren't sent (EmacSend() function in NIMU driver aren't called)

I've tried all settings described in http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/196772.aspx, http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/266546.aspx and http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/278528.aspx posts, but it's still not working.

Have you any ideas?

  • Update:

    Code which tscheck is posted in http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/278528.aspx (http://processors.wiki.ti.com/images/1/11/EVM_EMAC0_en.zip) is not working too.

  • Hi,

    Refer this E2E thread,If you are connecting SGMII-to-SGMII through an AMC setup
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/196299/700615.aspx#700615
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/115240.aspx

  • Hi Pubesh!

    I've checked the post you've pointed, but none of them helps me. The physical connection for SGMII0 is established, link is up, negotiating is completed, no errors, 6 packets of 64 bytes each are sent from SGMII0 to link partner (I read it from STATSA and STATSB registers).

    But my packets which I send using UDP socket at this port doesn't even reach NIMU driver EmacSend() function! And the same code for port 1 connected to on-board PHY works without problem!

  • Hi,

    If possible please provide a code snippet so that we can examine this issue.

  • Hi Pubesh!

    Here are my client example source code and NIMU source code I've edited.

    #include <stdio.h>
    // Include BIOS6
    #include <ti/sysbios/BIOS.h>
    // Include Clock module
    #include <ti/sysbios/knl/Clock.h>
    // Include platform utilities
    #include <ti/platform/resource_mgr.h>
    // Include CSL Boot configuration defs
    #include "ti\csl\csl_bootcfgAux.h"
    // Include CSL Power and Sleep Controller defs
    #include "ti\csl\csl_pscAux.h"
    // CSL SGMII defs
    #include <ti/csl/csl_cpsgmiiAux.h>
    #include <ti/csl/csl_cpgmac_slAux.h>
    #include <ti/csl/csl_cpsw_3gfAux.h>
    
    
    
    //=============================================================================
    //============ Standard output definitions ====================================
    //=============================================================================
    #define printf												platform_write
    //=============================================================================
    
    
    
    //=============================================================================
    //============ IP Stack NDK Routines ==========================================
    //=============================================================================
    /* Our NETCTRL callback functions */
    static void NetworkOpen(void);
    static void NetworkClose(void);
    static void NetworkIPAddr(IPN IPAddr, uint32_t IfIdx, uint32_t fAdd);
    
    static void ClientTask(void);
    //=============================================================================
    
    
    //=============================================================================
    //============ General defs ===================================================
    //=============================================================================
    #define OK													0
    #define ERR													-1
    
    #define DEVICE_NAME											"T-A6678"					// Device name
    #define DEVICE_IP_ADDRESS									"192.168.0.180"				// Device IP address
    #define DEVICE_IP_NETMASK									"255.255.255.128"			// Device IP netmask
    #define DEVICE_GATEWAY_IP_ADDRESS							"192.168.0.129"				// Device gateway IP address
    #define DEVICE_DNS_IP_ADDRESS								DEVICE_GATEWAY_IP_ADDRESS	// Device DNS IP address
    #define DEVICE_DOMAIN_NAME									"example.com"				// Device domain name
    #define SEND_DGRAM_BUF_SIZE									1024						/* Sending message size */
    #define SERVER_IP_ADDRESS									"192.168.0.130"
    static HANDLE hClientTask;
    //=============================================================================
    
    
    /*------------ main() function ------------------------------------------------
     * DESCRIPTION: Entry point for the application
     * ARGUMENTS:
     * None
     * RETURNED VALUE: Error code
    -----------------------------------------------------------------------------*/
    int32_t main(void)
    {
    	/* Start the BIOS 6 Scheduler - it will kick off our main thread MainTask() */
    	printf("Start BIOS 6\n");
    	BIOS_start();
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ EVM_init() function --------------------------------------------
     * DESCRIPTION: Function initializes the platform hardware. This routine is
     * configured to start in the configuration file. It is the first routine that
     * BIOS calls and is executed before Main is called.
     * ARGUMENTS:
     * None
     * RETURNED VALUE: None
    -----------------------------------------------------------------------------*/
    void EVM_init(void)
    {
    	platform_init_flags sFlags;
    	platform_init_config sConfig;
    	/* Status of the call to initialize the platform */
    	int32_t platform_status;
    
    	/*
    	 * You can choose what to initialize on the platform by setting the following
    	 * flags. Things like the DDR, PLL, etc should have been set by the boot loader.
    	*/
    	memset((void *) &sFlags,  0, sizeof(platform_init_flags));
    	memset((void *) &sConfig, 0, sizeof(platform_init_config));
    
    	sFlags.pll  = 0;	/* PLLs for clocking  	*/
    	sFlags.ddr  = 0;	/* External memory 		*/
    	sFlags.tcsl = 1;	/* Time stamp counter 	*/
    	sFlags.phy  = 1;	/* Ethernet 			*/
    	sFlags.ecc  = 0;	/* Memory ECC 			*/
    
    	sConfig.pllm = 0;	/* Use libraries default clock divisor */
    
    	platform_status = platform_init(&sFlags, &sConfig);
    
    	/* If we did not initialize the platform okay */
    	if (platform_status != Platform_EOK)
    	{
    		/* Initialization of the platform failed... die */
    		printf("Platform failed to initialize. Error code %d \n", platform_status);
    		printf("We will die in an infinite loop... \n");
    		while (1)
    		{
    			(void) platform_led(1, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
    			(void) platform_delay(50000);
    			(void) platform_led(1, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    			(void) platform_delay(50000);
    		}
    	}
    	printf("platform_init Done \n");
    	return;
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ nit_sgmii() function -------------------------------------------
     * DESCRIPTION: Function initializes SGMII peripheral
     * ARGUMENTS: 
     * macPortNum - MAC port number for which the SGMII port setup must
     *                      be performed
     * RETURNED VALUE: Error code
    -----------------------------------------------------------------------------*/
    int32_t init_sgmii(uint32_t macPortNum)
    {
        CSL_SGMII_ADVABILITY    sgmiiCfg;
        CSL_SGMII_STATUS        sgmiiStatus;
    
        /* Reset the port before configuring it */
        CSL_SGMII_doSoftReset (macPortNum);
        while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);
    
    	/* Hold the port in soft reset and set up
    	 * the SGMII control register:
    	 *      (1) Enable Master Mode
    	 *      (2) Enable Auto-negotiation
    	 */
    	CSL_SGMII_startRxTxSoftReset (macPortNum);
    	CSL_SGMII_enableMasterMode (macPortNum);
    	CSL_SGMII_enableAutoNegotiation (macPortNum);
    	CSL_SGMII_endRxTxSoftReset (macPortNum);
    
    	/* Setup the Advertised Ability register for this port:
    	 *      (1) Enable Full duplex mode
    	 *      (2) Enable Auto Negotiation
    	 *      (3) Enable the Link
    	 */
    	sgmiiCfg.linkSpeed      =   CSL_SGMII_1000_MBPS;
    	sgmiiCfg.duplexMode     =   CSL_SGMII_FULL_DUPLEX;
    	CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);
    
    	do
    	{
    		CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
    	} while (sgmiiStatus.bIsLinkUp != 1);
    
    	/* Wait for SGMII Autonegotiation to complete without error */
    	do
    	{
    		CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
    		if (sgmiiStatus.bIsAutoNegError != 0)
    			return (TA66XX_HOST_DEVICE_CONNECTION_FAILED_ERR); /* This is an error condition */
    	} while (sgmiiStatus.bIsAutoNegComplete != 1);
    
    	// Exit with no errors
    	return (OK);
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ MainTask() function --------------------------------------------
     * DESCRIPTION: This is the main task for the application.
     * It will configure and start the IP Stack. This thread is configured to start
     * in configuration file and it is called from BIOS.
     * ARGUMENTS:
     * None
     * RETURNED VALUE: Error code
    -----------------------------------------------------------------------------*/
    int32_t MainTask(void)
    {
    	int32_t r;
    	uint32_t i;
    	QMSS_CFG_T qmss_cfg;
    	CPPI_CFG_T cppi_cfg;
    	uint32_t boot_mode;
    	/* Platform Information - we will read it form the Platform Library */
    	platform_info gPlatformInfo;
    	HANDLE hCfg;							// Handle to our IP stack configuration
    
    	/* Get information about the platform so we can use it in various places */
    	memset((void *) &gPlatformInfo, 0, sizeof(platform_info));
    	(void) platform_get_info(&gPlatformInfo);
    
    	(void) platform_uart_init();
    	(void) platform_uart_set_baudrate(115200);
    	(void) platform_write_configure(PLATFORM_WRITE_ALL);
    
    	printf("MainTask is starting...\n");
    
    	/* Clear the state of the User LEDs to OFF */
    	for (i = 0; i < gPlatformInfo.led[PLATFORM_USER_LED_CLASS].count; i++)
    	{
    		(void) platform_led(i, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    	}
    
    	// If AMC interface is used then it's needed to configure SGMII peripheral
    	// as it's not configured in platform_init() function
    	if ((r = init_sgmii(0)) != OK)
    	{
    		printf("Error: failed to initialize the DSP SGMII0\n");
    		return (r);
    	}
    
    	/* Initialize the components required to run this application:
    	 *  (1) QMSS
    	 *  (2) CPPI
    	 *  (3) Packet Accelerator
    	 */
    	/* Initialize QMSS */
    	if (platform_get_coreid() == 0)
    	{
    		qmss_cfg.master_core = 1;
    	}
    	else
    	{
    		qmss_cfg.master_core = 0;
    	}
    	qmss_cfg.max_num_desc = MAX_NUM_DESC;
    	qmss_cfg.desc_size = MAX_DESC_SIZE;
    	qmss_cfg.mem_region = Qmss_MemRegion_MEMORY_REGION0;
    	if (res_mgr_init_qmss(&qmss_cfg) != 0)
    	{
    		printf("Error: failed to initialize the QMSS subsystem \n");
    		goto exit;
    	}
    	else
    	{
    		printf("QMSS successfully initialized\n");
    	}
    
    	/* Initialize CPPI */
    	if (platform_get_coreid() == 0)
    	{
    		cppi_cfg.master_core = 1;
    	}
    	else
    	{
    		cppi_cfg.master_core = 0;
    	}
    	cppi_cfg.dma_num = Cppi_CpDma_PASS_CPDMA;
    	cppi_cfg.num_tx_queues = NUM_PA_TX_QUEUES;
    	cppi_cfg.num_rx_channels = NUM_PA_RX_CHANNELS;
    	if (res_mgr_init_cppi(&cppi_cfg) != 0)
    	{
    		printf("Error: failed to initialize CPPI subsystem \n");
    		goto exit;
    	}
    	else
    	{
    		printf("CPPI successfully initialized\n");
    	}
    
    	/* Initialize Packet Accelerator */
    	if (res_mgr_init_pass()!= 0)
    	{
    		printf("Error: failed to initialize the Packet Accelerator \n");
    		goto exit;
    	}
    	else
    	{
    		printf("PA successfully initialized\n");
    	}
    
    	/* Start the NDK stack - The stack will start the Ethernet driver */
    	r = NC_SystemOpen(NC_PRIORITY_HIGH, NC_OPMODE_INTERRUPT);
    
    	if (r)
    	{
    		printf("NC_SystemOpen Failed (%d). Will die in an infinite loop so you need to reset...\n", r);
    		for (;;);
    	}
    
    	/*
    	 * Create and build the system configuration from scratch.
    	 */
    
    	/* Create a new configuration */
    	hCfg = CfgNew();
    	if (!hCfg)
    	{
    		printf("Error: unable to create a configuration for the IP stack.\n");
    		goto exit;
    	}
    
    	/* Validate the length of the supplied names */
    	if (strlen(DEVICE_NAME) >= CFG_HOSTNAME_MAX)
    	{
    		printf("Error: host name too long\n");
    		goto exit;
    	}
    
    	printf("Setting hostname to %s\n", DEVICE_NAME);
    
    	printf("MAC Address: %02x-%02x-%02x-%02x-%02x-%02x\n",
    			gPlatformInfo.emac.efuse_mac_address[0], gPlatformInfo.emac.efuse_mac_address[1],
    			gPlatformInfo.emac.efuse_mac_address[2], gPlatformInfo.emac.efuse_mac_address[3],
    			gPlatformInfo.emac.efuse_mac_address[4], gPlatformInfo.emac.efuse_mac_address[5]);
    
    	/* Add our global hostname to hCfg (to be claimed in all connected domains) */
    	CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0, strlen(DEVICE_NAME), (uint8_t *) DEVICE_NAME, 0 );
    
    
    	CI_IPNET ip_info;			// IP network configuration data for the selected physical interface
    	CI_ROUTE route_info;
    	IPN IPTmp;
    
    	// Configure static IP address
    	memset(&ip_info, 0, sizeof(ip_info));
    	ip_info.IPAddr = inet_addr(DEVICE_IP_ADDRESS);
    	ip_info.IPMask = inet_addr(DEVICE_IP_NETMASK);
    	strcpy(ip_info.Domain, DEVICE_DOMAIN_NAME);
    	ip_info.NetType = 0;			// Flags are not set - normal physical network
    
    	// Add the address to interface 1
    	// In case CFGTAG_IPNET Tag is used, then Item is set to network physical interface number
    	CfgAddEntry(hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *) &ip_info, 0);
    
    	// Add the default gateway. Since it is the default, the destination address and mask are both set to zero
    	memset(&route_info, 0, sizeof(route_info));
    	route_info.IPGateAddr = inet_addr(DEVICE_GATEWAY_IP_ADDRESS);
    
    	// Add the route
    	// In case CFGTAG_ROUTE Tag is used, then Item is set to 0
    	CfgAddEntry(hCfg, CFGTAG_ROUTE, 0, 0, sizeof(CI_ROUTE), (UINT8 *)&route_info, 0);
    
    	// Manually add the DNS server when specified
    	IPTmp = inet_addr(DEVICE_DNS_IP_ADDRESS);
    	if (IPTmp)
    		CfgAddEntry(hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_DOMAINNAMESERVER, 0, sizeof(IPTmp), (UINT8 *) &IPTmp, 0);
    
    	/*
    	** Boot the system using this configuration
    	**
    	** We keep booting until the function returns 0. This allows
    	** us to have a "reboot" command.
    	*/
    
    	do
    	{
    		r = NC_NetStart(hCfg, NetworkOpen, NetworkClose, NetworkIPAddr);
    	} while (r > 0);
    
    	printf("Done with this utility. Shutting things down\n");
    
    	/* Delete Configuration */
    	CfgFree(hCfg);
    
    	/* Close the OS */
    exit:
    	printf("Exiting the system\n");
    	NC_SystemClose();
    	return (0);
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ NetworkOpen() function -----------------------------------------
     * DESCRIPTION: This function is called after the Network stack has started.
     * ARGUMENTS:
     * None
     * RETURNED VALUE: None
    -----------------------------------------------------------------------------*/
    static void NetworkOpen(void)
    {
    	// Create Client task
    	// TaskCreate(*pFun, Name, Priority, StackSize, Arg1, Arg2, Arg3)
    	hClientTask = TaskCreate(ClientTask, "ClientTask", OS_TASKPRINORM, 4096, 0, 0, 0);
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ NetworkClose() function ----------------------------------------
     * DESCRIPTION: This function is called when the network is shutting down,
     * or when it no longer has any IP addresses assigned to it.
     * ARGUMENTS:
     * None
     * RETURNED VALUE: None
    -----------------------------------------------------------------------------*/
    static void NetworkClose(void)
    {
    	TaskDestroy(hClientTask);
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ NetworkIPAddr() function ---------------------------------------
     * DESCRIPTION: This function is called whenever an IP address binding is
     * added or removed from the system.
     * ARGUMENTS:
     * __in IPAddr � IP address we are adding or removing
     * __in IfIdx � Interface index (number)
     * __in fAdd � True if we added the interface, false if its being removed.
     * RETURNED VALUE: None
    -----------------------------------------------------------------------------*/
    static void NetworkIPAddr(IPN IPAddr, uint32_t IfIdx, uint32_t fAdd)
    {
    	IPN IPTmp;
    
    	if (fAdd)
    		printf("Network added: ");
    	else
    		printf("Network removed: ");
    
    	/* Print a message */
    	IPTmp = ntohl(IPAddr);
    	printf("eth%u: %d.%d.%d.%d\n", IfIdx, (int8_t)(IPTmp >> 24) & 0xFF, (int8_t)(IPTmp >> 16) & 0xFF,
    		(int8_t)(IPTmp >> 8) & 0xFF, (int8_t) IPTmp & 0xFF);
    
    	return;
    }
    //-----------------------------------------------------------------------------
    
    
    #define CPPI_PORT_STATE 0x00000003
    #define SGMII_PORT1_STATE 0x00000003
    #define SGMII_PORT2_STATE 0x00000003
    
    
     /************************************************************************************
      * Setup the Address Lookup Engine (ALE) module
      **************************************************************************************/
    void setupALE(void)
    {
        const unsigned int ALE_BASE  = 0x02090E00;
        const unsigned int ALE_TABLE_CLEAR_DELAY = 64;
        unsigned int i = 0;
        
        *((volatile unsigned int *) (ALE_BASE + 0x08)) = 0xC0000000;  //Setup the ALE_CONTROL register       
                                                                      //Set the ENABLE_ALE bit (bit 31) to enable the ALE table
                                                                      //Set the CLEAR_TABLE bit (bit 30) to clear the ALE table
        
        *((volatile unsigned int *) (ALE_BASE + 0x08)) |= 0x00000010; //Setup the ALE_CONTROL register
                                                                        //Set the ALE_BYPASS bit (bit 4) so that packets from Port1 and Port2
                                                                        //are sent directly to Port0, bypassing the ALE 
                                                                          
        for (i = 0; i < ALE_TABLE_CLEAR_DELAY; i++);                  //Wait for the ALE table to clear
      
        *((volatile unsigned int *) (ALE_BASE + 0x40)) = CPPI_PORT_STATE; //Enable port packet forwarding on CPPI Port
        *((volatile unsigned int *) (ALE_BASE + 0x44)) = SGMII_PORT1_STATE; //Enable port packet forwarding on SGMII0 Port
        *((volatile unsigned int *) (ALE_BASE + 0x48)) = SGMII_PORT2_STATE; //Enable port packet forwarding on SGMII1 Port
        
    }
    //-----------------------------------------------------------------------------
    
    
    /*------------ view_ale_table() function --------------------------------------
     * DESCRIPTION: Function prints ALE table
     * ARGUMENTS: None
     * RETURNED VALUE: Error code
    -----------------------------------------------------------------------------*/
    void view_ale_table(void)
    {
    	int32_t i;
    	CSL_CPSW_3GF_ALE_UNICASTADDR_ENTRY  ucastAddrCfg;
    
    	for (i = 0; i < CSL_CPSW_3GF_NUMALE_ENTRIES; i++)
    	{
    		if (CSL_CPSW_3GF_getALEEntryType(i) != ALE_ENTRYTYPE_FREE)
    		{
    			/* Found a free entry */
    			CSL_CPSW_3GF_getAleUnicastAddrEntry (i, &ucastAddrCfg);
    			printf("Port = %d, ", ucastAddrCfg.portNumber);
    			printf("MAC address = %02x:%02x:%02x:%02x:%02x:%02x, ",
    				ucastAddrCfg.macAddress[0],
    				ucastAddrCfg.macAddress[1],
    				ucastAddrCfg.macAddress[2],
    				ucastAddrCfg.macAddress[3],
    				ucastAddrCfg.macAddress[4],
    				ucastAddrCfg.macAddress[5]);
    			printf("unicast_type = %d\n", ucastAddrCfg.ucastType);
    		}
    	}
    }
    //-----------------------------------------------------------------------------
    
    
    /******************************************************************************
     *  @b ClientTask()
     *
     *  @n
     *
     *  This is the client task for the application.
     *
     *  @retval
     *  None
     *****************************************************************************/
    static void ClientTask(void)
    {
    	int32_t r;
    	SOCKET sock;
    	uint64_t begin;
    	double d, sent_data_len;
    	uint32_t sent_bytes = 0;
    	uint32_t count;
    	uint32_t i;
    	uint32_t *send_buf = NULL;							// Buffer for sending messages
    	uint8_t *pbuf;
    	int32_t rest_bytes, n;
    	struct sockaddr_in sin;
    	struct sockaddr_in server;
    
    	printf("ClientTask is starting...\n");
    
        printf("Initial ALE table:\n");
        view_ale_table();
    //	setupALE();
    //    printf("ALE table after setup:\n");
    //    view_ale_table();
    
        // Create buffer for send data
    	if ((send_buf = (uint32_t *) mmBulkAlloc(SEND_DGRAM_BUF_SIZE / 4)) == NULL)
    	{
    		printf("Error: mmBulkAlloc() failed\n");
    		r = ERR;
    		goto exit;
    	}
    	// Fill data buffer
    	for (i = 0; i < SEND_DGRAM_BUF_SIZE / 4; i++)
    		send_buf[i] = htonl(i);
    
    	// Open the file session for client network task
    	if (fdOpenSession(TaskSelf()) != 1)
    	{
    		printf("Error: fdOpenSession() failed\n");
    		r = ERR;
    		goto exit;
    	}
    
    	if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
    	{
    		printf("Error: socket() failed with error %d\n", fdError());
    		r = ERR;
    		goto exit;
    	}
    
    	/* Clear sin structure */
    	memset((char *) &sin, 0, sizeof(sin));
    	memset((char *) &server, 0, sizeof(server));
    	/* Initialize sin structure (AF_INET = TCP/IP) */
    	sin.sin_family = AF_INET;
    	sin.sin_len = sizeof(sin);
    	sin.sin_addr.s_addr = inet_addr(TA66XX_MONITOR_DEVICE_IP_ADDRESS);
    	/* Initialize server structure (AF_INET = TCP/IP) */
    	server.sin_family = AF_INET;
    	server.sin_len = sizeof(server);
    	server.sin_addr.s_addr = inet_addr(TA66XX_MONITOR_SERVER_IP_ADDRESS);
    	server.sin_port = htons(_TA66XX_MONITOR_network_port);
    
    //#if 0
    	/*
    	 * Try to bind the address to the socket.
    	 */
    	if (bind(sock, (PSA) &sin, sizeof(sin)) < 0)
    	{
    		printf("Error: bind() failed with error %d\n", fdError());
    		r = ERR;
    		goto exit;
    	}
    //#endif /* 0 */
    
    	count = 0;
    
    	while (count < 10)
    	{
    		// Send message to the server
    		rest_bytes = SEND_DGRAM_BUF_SIZE;
    		pbuf = (uint8_t *) send_buf;
    		while (rest_bytes > 0)
    		{
    			/* send() function returns number of sent bytes */
    			n = sendto(sock, pbuf, rest_bytes, 0, (PSA) &server, sizeof(server));
    			if (n < 0)
    			{
    				printf("Error: sendto() failed with error %d\n", fdError());
    				r = ERR;
    				goto exit;
    			}
    			rest_bytes -= n;
    			pbuf += n;
    			sent_bytes += n;
    		}
    		count++;
    		printf("Sent %u packets of %u bytes length to the server\n", count, sent_bytes);
    //	    printf("ALE table after send:\n");
    //        view_ale_table();
    	}
    
    //	while (1);
    
    	// Exit with no errors
    	r = OK;
    
    exit:
    	printf("ClientTask: exit code = %d\n", r);
    	if (send_buf)
    		mmBulkFree(send_buf);
    	// Close the client connection
    	// Close the socket
    	shutdown(sock, SHUT_WR);
    	fdClose(sock);
    	// Close the file session for client network task
    	fdCloseSession(TaskSelf());
    	TaskExit();
    }
    //-----------------------------------------------------------------------------
    
    
    3125.nimu_eth.c 3022.nimu_internal.h
    [C66xx_0] MainTask is starting...
    QMSS successfully initialized
    CPPI successfully initialized
    PA successfully initialized
    
    Current DSP core is 0
    Setting hostname to T-A6678
    MAC Address: 00-17-ea-cb-fb-3e
    EMAC port0 is used
    PASS successfully initialized 
    Ethernet subsystem successfully initialized 
    Ethernet eventId : 48 and vectId (Interrupt) : 7 
    Verify_Init: Expected 0 entry count for Queue number = 897, found 128 entries
    gPaTxQHnd[0] = 640
    gPaTxQHnd[1] = 641
    gPaTxQHnd[2] = 642
    gPaTxQHnd[3] = 643
    gPaTxQHnd[4] = 644
    gPaTxQHnd[5] = 645
    gPaTxQHnd[6] = 646
    gPaTxQHnd[7] = 647
    gPaTxQHnd[8] = 648
    gTxReturnQHnd = 899
    gTxFreeQHnd = 736
    gRxFreeQHnd = 738
    gRxQHnd = 704
    gTxCmdReturnQHnd = 900
    gTxCmdFreeQHnd = 737
    gPaCfgCmdRespQHnd = 898
    gRxFlowHnd = -2147480736
    gAccChannelNum = 0
    gTxPort = 0
    Registration of the EMAC Successful, waiting for link up ..
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    Network added: eth1: 192.168.0.180
    ClientTask is starting...
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    Sent 1 packets of 1024 bytes length to the server
    Sent 2 packets of 2048 bytes length to the server
    Sent 3 packets of 3072 bytes length to the server
    Sent 4 packets of 4096 bytes length to the server
    Sent 5 packets of 5120 bytes length to the server
    Sent 6 packets of 6144 bytes length to the server
    Sent 7 packets of 7168 bytes length to the server
    Sent 8 packets of 8192 bytes length to the server
    Sent 9 packets of 9216 bytes length to the server
    Sent 10 packets of 10240 bytes length to the server
    ClientTask: exit code = 0
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    EmacSend function:
    EmacRxPktISRCount = 0
    EmacSend function: packet length = 64 bytes
    

  • Oleg,

    You shared minimal code only, from that I could not find the serdes configuration(configSerdes()).
    This function is used from the platform lib normally. Can you provide the full set of project to analyse the issue.
    Please conform my understanding is correct from the below snapshot.


    Did you probe the AMC pins for the following signals at: AMC0_SGMII0_TX_DP, AMC0_SGMII0_RX_DP and AMC0_SGMII0_TX_DN, AMC0_SGMII0_RX_DN.

  • Hi Pubesh!

    Serdes are configured by board evm6678.gel GEL file for both ports. Your snapshot is correct, I'm trying to send packets through SGMII_0 to link partner, SGMII 0 is configured in forced link configuration and has link up. Here is the working project to test the case: 1067.client.zip

  • Oleg,

    I am looking your code, I will post you once get the solution or suggestion on the same.

  • Hi Pubesh!

    I've fixed the client example and it works now with EMAC port 0 (which is routed to AMC). The problem is NDK Buffer Pool section ".far:NDK_PACKETMEM" location (which was located in MSMCSRAM in my example). After I've moved this section to DDR3 memory the example worked well. I think the problem is MSMCSRAM default cache setting - this memory is cacheable by default.

  • Oleg,

    Good to hear the status. However this discussion of thread can helpful for future readers, If you verified this thread. 

  • Hi Pubesh!

    Please tell me if any NIMU updates are available to support both EMAC ports for C6678 DSP?

  • Oleg,

    As of now, there is no release/update plans to NIMU driver changes for both EMAC ports on C6678 DSP.