Other Parts Discussed in Thread: SYSCONFIG
Hi experts,
What should I do?
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.
Hi experts,
Hello Seong,
Thanks for reaching out to Texas Instruments E2E support forum.
So, I tried to build after deleting i2c, eeprom in syscfg.
Can you please share the modified example.syscfg file.?
Regards,
Tushar
The file won't load
I post it in text.
The build was successful by changing the project settings so that the files generated by sysconfig could be modified.
Essentially, I want to run this example code normally without eeprom. Is there no problem running if I modify the ti_board_config.c file as below?
void EnetBoard_getMacAddrList(uint8_t macAddr[][ENET_MAC_ADDR_LEN],
uint32_t maxMacEntries,
uint32_t *pAvailMacEntries)
{
int32_t status = ENET_SOK;
uint32_t macAddrCnt;
uint32_t i;
uint8_t macAddrBuf[ENET_BOARD_NUM_MACADDR_MAX * ENET_MAC_ADDR_LEN];
uint8_t numMacMax = 0;
status = 0; //EEPROM_read(gEepromHandle[CONFIG_EEPROM0], I2C_EEPROM_MAC_CTRL_OFFSET, &numMacMax, sizeof(uint8_t));
EnetAppUtils_assert(status == ENET_SOK);
EnetAppUtils_assert(ENET_GET_NUM_MAC_ADDR(numMacMax) <= ENET_BOARD_NUM_MACADDR_MAX);
macAddrCnt = EnetUtils_min(ENET_GET_NUM_MAC_ADDR(numMacMax), maxMacEntries);
EnetAppUtils_assert(pAvailMacEntries != NULL);
status = 0; //EEPROM_read(gEepromHandle[CONFIG_EEPROM0], I2C_EEPROM_MAC_DATA_OFFSET, macAddrBuf, (macAddrCnt * ENET_MAC_ADDR_LEN));
EnetAppUtils_assert(status == ENET_SOK);
/* Save only those required to meet the max number of MAC entries */
/* TODO Read number of mac addresses from the board eeprom */
for (i = 0U; i < macAddrCnt; i++)
{
memcpy(macAddr[i], &macAddrBuf[i * ENET_MAC_ADDR_LEN], ENET_MAC_ADDR_LEN);
}
*pAvailMacEntries = macAddrCnt;
if (macAddrCnt == 0U)
{
EnetAppUtils_print("EnetBoard_getMacAddrList Failed - IDK not present\n");
EnetAppUtils_assert(false);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////sysconfig file
/**
* 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_ALX_beta" --package "ALX" --part "ALX" --context "r5fss0-0" --product "INDUSTRIAL_COMMUNICATIONS_SDK_AM243x@09.00.00"
* @versions {"tool":"1.17.0+3128"}
*/
/**
* Import the modules used in this configuration.
*/
const pruicss = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
const pruicss1 = pruicss.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 mpu_armv76 = mpu_armv7.addInstance();
const enet_icss = scripting.addModule("/networking/enet_icss/enet_icss", {}, false);
const enet_icss1 = enet_icss.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
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 = 23;
mpu_armv75.$name = "CONFIG_MPU_REGION5";
mpu_armv75.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv75.baseAddr = 0xA5000000;
mpu_armv75.size = 23;
mpu_armv75.attributes = "NonCached";
mpu_armv76.$name = "CONFIG_MPU_REGION6";
mpu_armv76.size = 27;
mpu_armv76.baseAddr = 0x60000000;
enet_icss1.$name = "CONFIG_ENET_ICSS0";
enet_icss1.phyToMacInterfaceMode = "RGMII";
enet_icss1.ExternalPhyMgmtEnable = true;
enet_icss1.PktInfoOnlyEnable = true;
enet_icss1.mdioDisableStateMachineOnInit = true;
enet_icss1.mdioMode = "MDIO_MODE_MANUAL";
enet_icss1.QoS = 3;
enet_icss1.LargePoolPktCount = 16;
enet_icss1.phyAddr1 = 3;
enet_icss1.phyAddr2 = 15;
enet_icss1.txDmaChannel[0].$name = "ENET_DMA_TX_CH0";
enet_icss1.rxDmaChannel.create(2);
enet_icss1.rxDmaChannel[0].$name = "ENET_DMA_RX_CH0";
enet_icss1.rxDmaChannel[0].useDefaultFlow = true;
enet_icss1.rxDmaChannel[0].PacketsCount = 8;
enet_icss1.rxDmaChannel[1].$name = "ENET_DMA_RX_CH1";
enet_icss1.rxDmaChannel[1].chIdx = 1;
enet_icss1.rxDmaChannel[1].macAddrCount = 0;
enet_icss1.rxDmaChannel[1].PacketsCount = 8;
enet_icss1.netifInstance.create(1);
enet_icss1.netifInstance[0].$name = "NETIF_INST_ID0";
enet_icss1.PRU_ICSSG1_RGMII1.$assign = "PRU_ICSSG1_RGMII1";
enet_icss1.icss = pruicss1;
pruicss1.$name = "CONFIG_PRU_ICSS1";
pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";
pruicss1.intcMapping.create(2);
pruicss1.intcMapping[0].$name = "CONFIG_ICSS1_INTC_MAPPING0";
pruicss1.intcMapping[0].event = "41";
pruicss1.intcMapping[0].channel = "7";
pruicss1.intcMapping[0].host = "8";
pruicss1.intcMapping[1].$name = "CONFIG_ICSS1_INTC_MAPPING1";
pruicss1.intcMapping[1].event = "53";
pruicss1.intcMapping[1].channel = "7";
pruicss1.intcMapping[1].host = "8";
const udma = scripting.addModule("/drivers/udma/udma", {}, false);
const udma1 = udma.addInstance({}, false);
enet_icss1.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.
*/
debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD";
debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD";
enet_icss1.PRU_ICSSG1_MDIO.$suggestSolution = "PRU_ICSSG1_MDIO0";
enet_icss1.PRU_ICSSG1_MDIO.MDC.$suggestSolution = "PRG1_MDIO0_MDC";
enet_icss1.PRU_ICSSG1_MDIO.MDIO.$suggestSolution = "PRG1_MDIO0_MDIO";
enet_icss1.PRU_ICSSG1_IEP.$suggestSolution = "PRU_ICSSG1_IEP0";
enet_icss1.PRU_ICSSG1_IEP.EDC_LATCH_IN0.$suggestSolution = "PRG1_PRU0_GPO18";
enet_icss1.PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$suggestSolution = "PRG1_PRU0_GPO19";
enet_icss1.PRU_ICSSG1_RGMII1.RD0.$suggestSolution = "PRG1_PRU0_GPO0";
enet_icss1.PRU_ICSSG1_RGMII1.RD1.$suggestSolution = "PRG1_PRU0_GPO1";
enet_icss1.PRU_ICSSG1_RGMII1.RD2.$suggestSolution = "PRG1_PRU0_GPO2";
enet_icss1.PRU_ICSSG1_RGMII1.RD3.$suggestSolution = "PRG1_PRU0_GPO3";
enet_icss1.PRU_ICSSG1_RGMII1.RXC.$suggestSolution = "PRG1_PRU0_GPO6";
enet_icss1.PRU_ICSSG1_RGMII1.RX_CTL.$suggestSolution = "PRG1_PRU0_GPO4";
enet_icss1.PRU_ICSSG1_RGMII1.TD0.$suggestSolution = "PRG1_PRU0_GPO11";
enet_icss1.PRU_ICSSG1_RGMII1.TD1.$suggestSolution = "PRG1_PRU0_GPO12";
enet_icss1.PRU_ICSSG1_RGMII1.TD2.$suggestSolution = "PRG1_PRU0_GPO13";
enet_icss1.PRU_ICSSG1_RGMII1.TD3.$suggestSolution = "PRG1_PRU0_GPO14";
enet_icss1.PRU_ICSSG1_RGMII1.TXC.$suggestSolution = "PRG1_PRU0_GPO16";
enet_icss1.PRU_ICSSG1_RGMII1.TX_CTL.$suggestSolution = "PRG1_PRU0_GPO15";
enet_icss1.PRU_ICSSG1_RGMII2.$suggestSolution = "PRU_ICSSG1_RGMII2";
enet_icss1.PRU_ICSSG1_RGMII2.RD0.$suggestSolution = "PRG1_PRU1_GPO0";
enet_icss1.PRU_ICSSG1_RGMII2.RD1.$suggestSolution = "PRG1_PRU1_GPO1";
enet_icss1.PRU_ICSSG1_RGMII2.RD2.$suggestSolution = "PRG1_PRU1_GPO2";
enet_icss1.PRU_ICSSG1_RGMII2.RD3.$suggestSolution = "PRG1_PRU1_GPO3";
enet_icss1.PRU_ICSSG1_RGMII2.RXC.$suggestSolution = "PRG1_PRU1_GPO6";
enet_icss1.PRU_ICSSG1_RGMII2.RX_CTL.$suggestSolution = "PRG1_PRU1_GPO4";
enet_icss1.PRU_ICSSG1_RGMII2.TD0.$suggestSolution = "PRG1_PRU1_GPO11";
enet_icss1.PRU_ICSSG1_RGMII2.TD1.$suggestSolution = "PRG1_PRU1_GPO12";
enet_icss1.PRU_ICSSG1_RGMII2.TD2.$suggestSolution = "PRG1_PRU1_GPO13";
enet_icss1.PRU_ICSSG1_RGMII2.TD3.$suggestSolution = "PRG1_PRU1_GPO14";
enet_icss1.PRU_ICSSG1_RGMII2.TXC.$suggestSolution = "PRG1_PRU1_GPO16";
enet_icss1.PRU_ICSSG1_RGMII2.TX_CTL.$suggestSolution = "PRG1_PRU1_GPO15";
Hello Seong,
Thanks for sharing the above details.
The build was successful by changing the project settings so that the files generated by sysconfig could be modified.
Essentially, I want to run this example code normally without eeprom. Is there no problem running if I modify the ti_board_config.c file as below?
Please allow some time to review the code and revert back.
Regards,
Tushar
Hello Seong,
The driver code fetches the mac addresses from EEPROM.
In the above code you have commented the EEPROM read in EnetBoard_getMacAddrList(), the macAddrBuf will not be filled. This will make the EnetAppUtils_allocMac() call fail when the app wants to allocate the macAddr.
It is better if you can fill some hard-coded mac-addresses in macAddrBuf replacing the EEPROM call.
Regards,
Tushar
With reference to url below, I hard-coded mac address as follows.
(ti_board_config.c)
void EnetBoard_getMacAddrList(uint8_t macAddr[][ENET_MAC_ADDR_LEN],
uint32_t maxMacEntries,
uint32_t *pAvailMacEntries)
{
uint32_t macAddrCnt;
uint32_t i;
uint8_t macAddrBuf[ENET_BOARD_NUM_MACADDR_MAX * ENET_MAC_ADDR_LEN];
uint8_t numMacMax = 0;
/* Fill the MAC Address */
//macAddrBuf[ENET_MAC_ADDR_LEN*0] = {0xF4, 0x84, 0x4C, 0xFB, 0xC0, 0x5C};
macAddrBuf[0] = 0xF4;
macAddrBuf[1] = 0x84;
macAddrBuf[2] = 0x4C;
macAddrBuf[3] = 0xFB;
macAddrBuf[4] = 0xC0;
macAddrBuf[5] = 0xF4;
//macAddrBuf[ENET_MAC_ADDR_LEN*1] = {0xF4, 0x84, 0x4C, 0xFB, 0xC0, 0x5D};
macAddrBuf[6] = 0xF4;
macAddrBuf[7] = 0x84;
macAddrBuf[8] = 0x4C;
macAddrBuf[9] = 0xFB;
macAddrBuf[10] = 0xC0;
macAddrBuf[11] = 0x5D;
numMacMax = 2;
macAddrCnt = EnetUtils_min(numMacMax, maxMacEntries);
EnetAppUtils_assert(pAvailMacEntries != NULL);
/* Save only those required to meet the max number of MAC entries */
/* TODO Read number of mac addresses from the board eeprom */
for (i = 0U; i < macAddrCnt; i++)
{
memcpy(macAddr[i], &macAddrBuf[i * ENET_MAC_ADDR_LEN], ENET_MAC_ADDR_LEN);
}
*pAvailMacEntries = macAddrCnt;
if (macAddrCnt == 0U)
{
EnetAppUtils_print("EnetBoard_getMacAddrList Failed - IDK not present\n");
EnetAppUtils_assert(false);
}
}
However, in the 'do while statement' of the function below, we are circling an infinite loop.
(call stack)
Enet_ioctl (ENET_IOCTL) - enet.c <- do while infinite loop
- EnetApp_waitForPhyAlive - test_enet.c
- enet_lwip_example - test_enet.c
EnetApp_waitForPhyAlive - test_enet.c
Looks like not able to communicate with PHY.
Please refer below documentation for custom PHY integration and let me know if you need further help ?
Regards
Ashwani