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.
I wish to utilize both Ethernet and EtherCAT simultaneously on the AM243x-EVM. Since the stacked PHYs are shared between the ICSS (encompassing both Ethernet and EtherCAT), one feasible option is to employ CPSW for Ethernet. However, there's a challenge: one of the PHYs is shared between CPSW and ICSS.
My current understanding indicates that CPSW can solely be configured in either dual MAC mode or switch mode. I aim to operate it in single MAC mode. Is such a configuration possible?
Hi Saptarshi,
If I understand correctly, you want the green block (CPSW) to be used in MAC mode.
If you open syscfg of your application, go to Enet(CPSW) -> MAC Port config,
You can disable MAC port-2 config and have MAC port-1 config enabled.
Now rebuild your application after the above changes. This way you can have single MAC port enabled. Now once your configuration is done and during the runtime the application and driver initialization is done, try to Ping the IP address associated with the same.
Please try the above and let me know if you have any other questions.
Regards,
Shaunak
Hello Shaunak,
Thanks for the prompt reply. Even after disabling Mac Port 2, sysconfig has pinmux errors. How to resolve them?
Thanks,
Saptarshi
Hello, Shaunak
Please find it attached. It is the Beckoff Ethercat example with an added CPSW ENet Module from Sysconfig.
/** * These arguments were used when this file was generated. They will be automatically applied on subsequent loads * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. * @cliArgs --device "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "INDUSTRIAL_COMMUNICATIONS_SDK_AM243x@09.00.00" * @versions {"tool":"1.18.0+3266"} */ /** * Import the modules used in this configuration. */ const eeprom = scripting.addModule("/board/eeprom/eeprom", {}, false); const eeprom1 = eeprom.addInstance(); const flash = scripting.addModule("/board/flash/flash", {}, false); const flash1 = flash.addInstance(); const led = scripting.addModule("/board/led/led", {}, false); const led1 = led.addInstance(); const led2 = led.addInstance(); const led3 = led.addInstance(); const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); const gpio1 = gpio.addInstance(); const i2c = scripting.addModule("/drivers/i2c/i2c", {}, false); const i2c1 = i2c.addInstance(); const i2c2 = i2c.addInstance(); const pruicss = scripting.addModule("/drivers/pruicss/pruicss", {}, false); const pruicss1 = pruicss.addInstance(); const ethercat = scripting.addModule("/industrial_comms/ethercat/ethercat", {}, false); const ethercat1 = ethercat.addInstance(); const debug_log = scripting.addModule("/kernel/dpl/debug_log"); const mpu_armv7 = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false); const mpu_armv71 = mpu_armv7.addInstance(); const mpu_armv72 = mpu_armv7.addInstance(); const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); const enet_cpsw = scripting.addModule("/networking/enet_cpsw/enet_cpsw", {}, false); const enet_cpsw1 = enet_cpsw.addInstance(); /** * Write custom configuration values to the imported modules. */ eeprom1.$name = "CONFIG_EEPROM0"; flash1.$name = "CONFIG_FLASH0"; flash1.peripheralDriver.$name = "CONFIG_OSPI0"; led1.name = "TPIC2810"; led1.$name = "CONFIG_LED_DIGITAL_OUTPUT"; led2.$name = "CONFIG_LED_RUN"; led3.name = "Ioexp"; led3.ioIndex = 16; led3.$name = "CONFIG_LED_ERROR"; gpio1.$name = "CONFIG_GPIO0"; led2.peripheralDriver = gpio1; gpio1.pinDir = "OUTPUT"; gpio1.useMcuDomainPeripherals = true; gpio1.MCU_GPIO.$assign = "MCU_GPIO0"; gpio1.MCU_GPIO.gpioPin.$assign = "MCU_SPI1_CS0"; i2c1.$name = "CONFIG_I2C0"; eeprom1.peripheralDriver = i2c1; i2c1.I2C.$assign = "I2C0"; i2c1.I2C.SCL.$assign = "I2C0_SCL"; i2c1.I2C.SDA.$assign = "I2C0_SDA"; i2c2.$name = "CONFIG_I2C1"; led1.peripheralDriver = i2c2; led3.peripheralDriver = i2c2; i2c2.I2C.$assign = "I2C1"; i2c2.I2C.SCL.$assign = "I2C1_SCL"; i2c2.I2C.SDA.$assign = "I2C1_SDA"; ethercat1.$name = "CONFIG_ETHERCAT0"; ethercat1.instance = "ICSSG1"; ethercat1.ethphy[0].$name = "CONFIG_ETHPHY0"; ethercat1.ethphy[1].$name = "CONFIG_ETHPHY1"; ethercat1.ethphy[1].mdioPort = 3; pruicss1.iepSyncMode = scripting.forceWrite(true); ethercat1.icss = pruicss1; pruicss1.$name = "CONFIG_PRU_ICSS1"; pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; debug_log.enableUartLog = true; debug_log.enableCssLog = false; debug_log.uartLog.$name = "CONFIG_UART0"; debug_log.uartLog.UART.$assign = "USART0"; mpu_armv71.$name = "CONFIG_MPU_REGION0"; mpu_armv71.size = 31; mpu_armv71.attributes = "Device"; mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv71.allowExecute = false; mpu_armv72.$name = "CONFIG_MPU_REGION1"; mpu_armv72.size = 15; mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv73.$name = "CONFIG_MPU_REGION2"; mpu_armv73.baseAddr = 0x41010000; mpu_armv73.size = 15; mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv74.$name = "CONFIG_MPU_REGION3"; mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv74.baseAddr = 0x70000000; mpu_armv74.size = 21; mpu_armv75.$name = "CONFIG_MPU_REGION4"; mpu_armv75.baseAddr = 0x80000000; mpu_armv75.size = 31; enet_cpsw1.$name = "CONFIG_ENET_CPSW0"; enet_cpsw1.DisableMacPort2 = true; enet_cpsw1.macOnlyEn_hostPort = true; enet_cpsw1.macOnlyEn_macPort1 = true; enet_cpsw1.txDmaChannel[0].$name = "ENET_DMA_TX_CH0"; enet_cpsw1.rxDmaChannel[0].$name = "ENET_DMA_RX_CH0"; enet_cpsw1.pinmux[0].$name = "ENET_CPSW_PINMUX0"; const udma = scripting.addModule("/drivers/udma/udma", {}, false); const udma1 = udma.addInstance({}, false); enet_cpsw1.udmaDrv = udma1; /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ flash1.peripheralDriver.OSPI.$suggestSolution = "OSPI0"; flash1.peripheralDriver.OSPI.CLK.$suggestSolution = "OSPI0_CLK"; flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "OSPI0_CSn0"; flash1.peripheralDriver.OSPI.DQS.$suggestSolution = "OSPI0_DQS"; flash1.peripheralDriver.OSPI.D7.$suggestSolution = "OSPI0_D7"; flash1.peripheralDriver.OSPI.D6.$suggestSolution = "OSPI0_D6"; flash1.peripheralDriver.OSPI.D5.$suggestSolution = "OSPI0_D5"; flash1.peripheralDriver.OSPI.D4.$suggestSolution = "OSPI0_D4"; flash1.peripheralDriver.OSPI.D3.$suggestSolution = "OSPI0_D3"; flash1.peripheralDriver.OSPI.D2.$suggestSolution = "OSPI0_D2"; flash1.peripheralDriver.OSPI.D1.$suggestSolution = "OSPI0_D1"; flash1.peripheralDriver.OSPI.D0.$suggestSolution = "OSPI0_D0"; ethercat1.PRU_ICSSG1_MDIO.$suggestSolution = "PRU_ICSSG1_MDIO0"; ethercat1.PRU_ICSSG1_MDIO.MDC.$suggestSolution = "PRG1_MDIO0_MDC"; ethercat1.PRU_ICSSG1_MDIO.MDIO.$suggestSolution = "PRG1_MDIO0_MDIO"; ethercat1.PRU_ICSSG1_IEP.$suggestSolution = "PRU_ICSSG1_IEP0"; ethercat1.PRU_ICSSG1_IEP.EDC_LATCH_IN0.$suggestSolution = "PRG1_PRU0_GPO18"; ethercat1.PRU_ICSSG1_IEP.EDC_LATCH_IN1.$suggestSolution = "PRG1_PRU0_GPO7"; ethercat1.PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$suggestSolution = "PRG1_PRU0_GPO19"; ethercat1.PRU_ICSSG1_IEP.EDC_SYNC_OUT1.$suggestSolution = "PRG1_PRU0_GPO17"; ethercat1.PRU_ICSSG1_IEP.EDIO_DATA_IN_OUT28.$suggestSolution = "PRG1_PRU0_GPO9"; ethercat1.PRU_ICSSG1_IEP.EDIO_DATA_IN_OUT29.$suggestSolution = "PRG1_PRU0_GPO10"; ethercat1.PRU_ICSSG1_IEP.EDIO_DATA_IN_OUT30.$suggestSolution = "PRG1_PRU1_GPO9"; ethercat1.PRU_ICSSG1_IEP.EDIO_DATA_IN_OUT31.$suggestSolution = "PRG1_PRU1_GPO10"; ethercat1.PRU_ICSSG1_MII_G_RT.$suggestSolution = "PRU_ICSSG1_MII_G_RT"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXD0.$suggestSolution = "PRG1_PRU0_GPO0"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXD1.$suggestSolution = "PRG1_PRU0_GPO1"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXD2.$suggestSolution = "PRG1_PRU0_GPO2"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXD3.$suggestSolution = "PRG1_PRU0_GPO3"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXDV.$suggestSolution = "PRG1_PRU0_GPO4"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXER.$suggestSolution = "PRG1_PRU0_GPO5"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_RXLINK.$suggestSolution = "PRG1_PRU0_GPO8"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_TXD0.$suggestSolution = "PRG1_PRU0_GPO11"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_TXD1.$suggestSolution = "PRG1_PRU0_GPO12"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_TXD2.$suggestSolution = "PRG1_PRU0_GPO13"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_TXD3.$suggestSolution = "PRG1_PRU0_GPO14"; ethercat1.PRU_ICSSG1_MII_G_RT.MII0_TXEN.$suggestSolution = "PRG1_PRU0_GPO15"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXD0.$suggestSolution = "PRG1_PRU1_GPO0"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXD1.$suggestSolution = "PRG1_PRU1_GPO1"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXD2.$suggestSolution = "PRG1_PRU1_GPO2"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXD3.$suggestSolution = "PRG1_PRU1_GPO3"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXDV.$suggestSolution = "PRG1_PRU1_GPO4"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXER.$suggestSolution = "PRG1_PRU1_GPO5"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_RXLINK.$suggestSolution = "PRG1_PRU1_GPO8"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_TXD0.$suggestSolution = "PRG1_PRU1_GPO11"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_TXD1.$suggestSolution = "PRG1_PRU1_GPO12"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_TXD2.$suggestSolution = "PRG1_PRU1_GPO13"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_TXD3.$suggestSolution = "PRG1_PRU1_GPO14"; ethercat1.PRU_ICSSG1_MII_G_RT.MII1_TXEN.$suggestSolution = "PRG1_PRU1_GPO15"; ethercat1.PRU_ICSSG1_MII_G_RT.MII_MR0_CLK.$suggestSolution = "PRG1_PRU0_GPO6"; ethercat1.PRU_ICSSG1_MII_G_RT.MII_MR1_CLK.$suggestSolution = "PRG1_PRU1_GPO6"; ethercat1.PRU_ICSSG1_MII_G_RT.MII_MT0_CLK.$suggestSolution = "PRG1_PRU0_GPO16"; ethercat1.PRU_ICSSG1_MII_G_RT.MII_MT1_CLK.$suggestSolution = "PRG1_PRU1_GPO16"; debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; enet_cpsw1.pinmux[0].MDIO.$suggestSolution = "MDIO0"; enet_cpsw1.pinmux[0].MDIO.MDC.$suggestSolution = "PRG0_PRU1_GPO19"; enet_cpsw1.pinmux[0].MDIO.MDIO.$suggestSolution = "PRG0_PRU1_GPO18"; enet_cpsw1.pinmux[0].RGMII1.$suggestSolution = "RGMII1"; enet_cpsw1.pinmux[0].RGMII1.RD0.$suggestSolution = "PRG0_PRU1_GPO7"; enet_cpsw1.pinmux[0].RGMII1.RD1.$suggestSolution = "PRG0_PRU1_GPO9"; enet_cpsw1.pinmux[0].RGMII1.RD2.$suggestSolution = "PRG0_PRU1_GPO10"; enet_cpsw1.pinmux[0].RGMII1.RD3.$suggestSolution = "PRG0_PRU1_GPO17"; enet_cpsw1.pinmux[0].RGMII1.RX_CTL.$suggestSolution = "PRG0_PRU0_GPO9"; enet_cpsw1.pinmux[0].RGMII1.RXC.$suggestSolution = "PRG0_PRU0_GPO10"; enet_cpsw1.pinmux[0].RGMII1.TD0.$suggestSolution = "PRG1_PRU1_GPO7"; enet_cpsw1.pinmux[0].RGMII1.TD1.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII1.TD2.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII1.TD3.$suggestSolution = "PRG1_PRU1_GPO17"; enet_cpsw1.pinmux[0].RGMII1.TX_CTL.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII1.TXC.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.$suggestSolution = "RGMII2"; enet_cpsw1.pinmux[0].RGMII2.RD0.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.RD1.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.RD2.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.RD3.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.RX_CTL.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.RXC.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TD0.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TD1.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TD2.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TD3.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TX_CTL.$suggestSolution = "<error>"; enet_cpsw1.pinmux[0].RGMII2.TXC.$suggestSolution = "<error>";
Thanks,
Saptarshi
Hi Saptarshi,
I'll look into the same and get back to you once I have a fix for these errors. Seems like something wrong with Resource allocation.
I will run some experiments on my side and try.
Regards,
Shaunak
Hi Saptarshi,
Sharing an update with you, I was able to resolve most of the syscfg errors. The stacked PHYs on the EVM (the one shared between CPSW and ICSS) uses RGMII2. Here we would need CSPW to use RGMII1. Based on those modifications, most of the errors are resolved. But there are some conflicts between the data Input and Output pins between ICSSG1 and CPSW. I'm discussing this internally with the hardware folks and I'll get back to you when I make some more progress.
Regards,
Shaunak
Hi Saptarshi,
One workaround is to use ICSSG0 and CPSW to get no pinmux conflicts. ICSSG0 is not connected to the on-board PHY so you would need a daughter card for this.
Im still confirming with the hardware team to check if this is any hardware limitation.(using ICSSG1 MII and CPSW RGMII1).
Regards,
Shaunak
Hello Shaunak,
In case of the workaround, can we use LwiP on ICSSG0 and Ethercat on ICSSG1?
Thanks,
Saptarshi
Hi Saptarshi,
ICSSG0 can be used only on your custom board where you interface a PHY with it. On the AM243x evm you can use ICSSG1. ICSSG0 is not linked to any PHY on the device.
But lwIP can be used on either of the ICSSG instance.
Regards,
Shaunak