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.
Tool/software:
Hi,
We are using custom board with AM5748 running on Sysbios (SDK version: 08_01_00_09). AM5748 EMAC is configured in switch mode.
Two DP83869HM ethernet Phy's are connected through RGMII interface. Two peer devices (laptops) are connected to ethernet PHY's as shown in the below image.
If EMAC and peer devices are configured in 100M mode, ping/communication between two peer devices is successful. If they are configured in 1G mode, ping between two peer devices fails (Switch mode is not working).
Suggestions would be helpful.
I have also attached the application here.
/********************************************************************** ************************* Standard Includes ************************** **********************************************************************/ #include <xdc/std.h> /* initializes XDCtools */ #include <ti/sysbios/BIOS.h> /* initializes SYS/BIOS */ #include <ti/sysbios/knl/Task.h> /* initializes Task module */ #include <xdc/runtime/IHeap.h> #include <xdc/runtime/System.h> #include <xdc/runtime/Error.h> #include <xdc/cfg/global.h> #include <ti/board/board.h> #include <string.h> #include <ti/sysbios/utils/Load.h> /* To get CPU load */ #include <ti/drv/uart/UART_stdio.h> /* UART Headers*/ /* CSL Chip Functional Layer */ #include <ti/csl/csl_chip.h> #include <ti/csl/csl_cpswAux.h> #include <ti/csl/soc.h> /* EMAC Driver Header File. */ #include <ti/drv/emac/emac_drv.h> #include <ti/drv/emac/src/v4/emac_drv_v4.h> #include <ti/drv/emac/soc/emac_soc_v4.h> #include <ti/sysbios/family/arm/arm9/Cache.h> /********************************************************************** ************************* User Includes ****************************** **********************************************************************/ int main() { Task_Params taskParams; EMAC_DRV_ERR_E returnValue; Board_STATUS boardInitStatus = 0; Error_Block eb; Error_init(&eb); EMAC_HwAttrs_V4 emac_cfg; EMAC_OPEN_CONFIG_INFO_T open_cfg; EMAC_CHAN_MAC_ADDR_T chan_cfg[APP_EMAC_NUM_CHANS_PER_CORE]; EMAC_CONFIG_INFO_T cfg_info; uint32_t port_num = 0; /* Board Initialization*/ Board_initCfg cfg = BOARD_INIT_UART_STDIO | BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK; boardInitStatus = Board_init(cfg); if (boardInitStatus != 0) { UART_printf("Board Initialization failure\n"); return (0); } UART_printf("Board Initialization success\n"); /* Interrupt Crossbar Configuration*/ CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_92, CSL_XBAR_GMAC_SW_IRQ_RX_PULSE); CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_93, CSL_XBAR_GMAC_SW_IRQ_TX_PULSE); /* Select RGMII Mode for both the ports GMIIx_SEL = 2 (CTRL_CORE_CONTROL_IO_1)*/ CSL_FINS( ((CSL_control_coreRegs *) CSL_MPU_CTRL_MODULE_CORE_CORE_REGISTERS_REGS)->CONTROL_IO_1, CONTROL_CORE_CONTROL_IO_1_GMII1_SEL, 0x02U); CSL_FINS( ((CSL_control_coreRegs *) CSL_MPU_CTRL_MODULE_CORE_CORE_REGISTERS_REGS)->CONTROL_IO_1, CONTROL_CORE_CONTROL_IO_1_GMII2_SEL, 0x02U); /*GMAC RESET ISOLATION Enable*/ CSL_FINS( ((CSL_control_coreRegs *) CSL_MPU_CTRL_MODULE_CORE_CORE_REGISTERS_REGS)->CONTROL_IO_2, CONTROL_CORE_CONTROL_IO_2_GMAC_RESET_ISOLATION_ENABLE, 0U); CSL_FINS( ((CSL_control_coreRegs *) CSL_MPU_CTRL_MODULE_CORE_CORE_REGISTERS_REGS)->CONTROL_IO_2, CONTROL_CORE_CONTROL_IO_2_GMAC_RESET_ISOLATION_ENABLE, 1U); ethernetBufferInit(); EMAC_socGetInitCfg(port_num, &emac_cfg); emac_cfg.port[0].phy_addr = EMAC_CPSW_PORT0_PHY_ADDR; emac_cfg.port[1].phy_addr = EMAC_CPSW_PORT1_PHY_ADDR; emac_cfg.numPorts = MAX_NUM_EMAC_PORTS; emac_cfg.macModeFlags = EMAC_CPSW_CONFIG_MODEFLG_GIGABIT | EMAC_CPSW_CONFIG_MODEFLG_FULLDUPLEX; EMAC_socSetInitCfg(port_num, &emac_cfg); open_cfg.hwAttrs = (void*) &emac_cfg; open_cfg.loop_back = 0; open_cfg.controller_core_flag = 1; open_cfg.max_pkt_size = APP_EMAC_INIT_PKT_SIZE; open_cfg.mdio_flag = 1; open_cfg.num_of_chans = 1; open_cfg.num_of_rx_pkt_desc = 256; open_cfg.num_of_tx_pkt_desc = 256; open_cfg.p_chan_mac_addr = &chan_cfg[0]; open_cfg.alloc_pkt_cb = app_alloc_pkt; open_cfg.free_pkt_cb = app_free_pkt; if (port_num == 0) { open_cfg.phy_addr = 0x0; open_cfg.rx_pkt_cb = (EMAC_RX_PKT_CALLBACK_FN_T*) ethernet_callback1; chan_cfg[0].chan_num = 0; chan_cfg[0].num_of_mac_addrs = 1; chan_cfg[0].p_mac_addr = &macId[0]; } if ((returnValue = emac_open(port_num, &open_cfg)) == EMAC_DRV_RESULT_OPEN_PORT_ERR) { UART_printf("main: emac_open failure: %d\n", returnValue); return FAILURE; } else { UART_printf("main: emac_open success\n"); cfg_info.rx_filter = EMAC_PKTFLT_ALL; //promisc mode cfg_info.mcast_cnt = 0; cfg_info.p_mcast_list = NULL; emac_config(port_num, &cfg_info); } emacInitStatus = 1; printEMACRegisters(); Task_Params_init(&taskParams); taskParams.priority = 15; taskParams.instance->name = "EmacRxPkt"; Task_create(app_test_task_poll_pkt, &taskParams, NULL); /* Start BIOS */ BIOS_start(); return 0; }
Thanks,
Sandeep
Hello Sandeep,
Please see the following thread for further information:
-Josue
Hi Josue,
Thanks for the reply. Went through the above thread and it's not relevant to the issue that I am facing. In my case basic 1G switch mode is not working with Sysbios. I am trying to ping between two peer devices and currently not focused on 1000Mbps data rate.
1G switch mode is not working with Sysbios but its working when configured through Linux. This suggests that there is some issue with EMAC configuration through Sysbios. Suggestions regarding this be helpful.
Thanks,
Sandeep
Hello Sandeep,
Understood. I will inquire internally and get back to you.
Please expect delays in response.
-Josue
Hello Sandeep,
Sorry for the delay. Have you tried any of the NIMU examples on the RTOS SDK? I am currently procuring a AM574x board to test.
-Josue
Hello Josue,
Issue is resolved. Issue was with the PHY configuration. Thanks for your support.
Hello Sandeep,
Can you elaborate on what was wrong in your configuration?
-Best
Josue