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.

RTOS/PROCESSOR-SDK-AM437X: EtherCAT and Ethernet tasks together

Part Number: PROCESSOR-SDK-AM437X

Tool/software: TI-RTOS

IDKAM437x
Hello, I am modifying ethercat_slave_demo project, adding more tasks,
I simply added a server code(TCP_echo_Server) that runs on CPSW ethernet, my main.c is below:

int main(){
         TaskP_Params taskParams;

Board_init(BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_ICSS_PINMUX | BOARD_INIT_UART_STDIO);

TaskP_Params_init(&taskParams);
taskParams.priority = 4;
taskParams.stacksize = 2048*TIESC_TASK_STACK_SIZE_MUL;
ecat_hndl = TaskP_create(ethercat_slave_task, &taskParams);

/* Chip configuration MII/RMII selection */

CpswPortMacModeSelect(1, ETHERNET_MAC_TYPE_RGMII);
CpswPortMacModeSelect(2, ETHERNET_MAC_TYPE_RGMII);

TaskP_Params_init(&taskParams);
taskParams.priority = 2;
taskParams.stacksize = 0x2000;
tcp_hndl = TaskP_create(TCP_echo_Server, &taskParams);

NIMUDeviceTable[nimu_device_index++].init = &CpswEmacInit ;    //nimu_device_index  = 0
NIMUDeviceTable[nimu_device_index].init = NULL ;

OSAL_OS_start();

}

Thanks in advance.

  • Hi,

    The default Board_init() function from Processor SDK has the exclusive ‘BOARD_INIT_ICSS_PINMUX’ and ‘BOARD_INIT_PINMUX_CONFIG’ (CPSW). But from the AM437x IDK schematic, it appears to be no conflict in terms of pin muxing, so you need to remove the ‘idkAM437x_icssPinMuxFlag’ in the board library and rebuild, then you can try to concurrently configure both:

    PINMUXModuleConfig(CHIPDB_MOD_ID_CPSW, 0U, NULL);
    PINMUXModuleConfig(CHIPDB_MOD_ID_PRU_ICSS, 1U, NULL);

    in order to enable the Ethernet with CPSW port 1 and EtherCAT with PR1_MII0 and PR1_MII1.

    Regards,
    Garrett