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/AM4379: Ethercat slave demo, adding more tasks

Part Number: AM4379

Tool/software: TI-RTOS

Hi, I am so new and working on EtherCAT with IDKAM437x.

I want to add a simple UART_read task, and of course later more tasks, to run concurrently with current ethercat_slave_demo(PRU ICSS EtherCAT Slave) code, I tried several ways:

1- Because I can add tasks and edit pinmux easily on rtos_template_app(located in the latest pdk). 
I tried to add an etherCAT task to it. I get the ethercat slave controller files (ties*.c files) out from the ethercat_slave_demo project, copied .c files to the rtos_template_app , added the ethercat task of the ethercat_slave_demo near other given tasks , it ended up with many problems.

2 - I later decided to move on with working ethercat_slave_demo code and add more tasks into it, found this issue : "e2e.ti.com/.../729390" where I tried to add an UART task uses UART1, needed to alter the pinmux correctly. I tried to change the .pinmux file under ${PDK_INSTALL_DIR}\packages\ti\starterware\tools\pinmux_config\am43xx\idkevmam437x.pinmux as stated in the link.

I found the file "idkevm.pinmux" under that directory, loaded it to the ti cloud pinmux tool, added UART1, and save the edited version, replaced it to the very directory, make pdk, rebuilt the project, and it gives an runtime error(angel_swi).

My questions are simple:
- Do you encourage the 1.way or if I am developing a project including etherCAT, I should develop it in given ethercat_slave_demo project( Namely, can one easily reuse the etherCAT files and the tasks in ethercat_slave_demo, easily integrate it as a task to another project)?

- In ethercat_slave_demo project," Which pinmux files" located under "which directories" in ethercat_slave_demo project (PRU ICSS EtherCAT Slave) should be edited to configure?

Thanks in advance!

  • Hi,

    The approach #2 above is more recommended.
    The pinmux files are under PDK \packages\ti\starterware\board\am43xx

    Regards,
    Garrett
  • Hi Garrett, do you know a way to add also a simple ethernet task(maybe something like echoing), I could not find any example nor drivers for it.
    Thanks.
  • You can try to integrate the NIMU example from PDK packages\ti\transport\ndk\nimu\example.

    Regards,
    Garrett
  • Hi again, i am working on "NIMU_BasicExample_idkAM437x_armExampleproject", connected to my PC, i get some stats results.
    RX | Good: 114 | Bcast: 33 | Mcast: 81 | Oct: 18311 |
    .
    :

    I tried to add EchoTcp() function that i found under conecho.c (current ndk), to send an receive TCP packets over currently established ethernet connection that i am able read something from my PC with current exampleProject.
    However i get error creating the socket, eventhough i added fdOpenSession(TaskSelf()); , still get the error no: -1.
    What will be the reason for this. I just added it as a task to the that NIMU project without any change in anything.

    //Function starts like this, creating a socket.

    void EchoTcp(){

    uint32_t IPAddr = 3232239633;
    SOCKET s;
    struct sockaddr_in sin1;
    int test,i;
    char *pBuf = 0;
    struct timeval timeout;

    fdOpenSession(TaskSelf());

    printf("\n== Start TCP Echo Client Test ==\n");

    /* Create test socket */
    s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if( s == INVALID_SOCKET )
    {
    printf("failed socket create (%d)\n",fdError());
    goto leave;
    }
  • Hi,
    EchoTCP's priority was high, i reduced it to 2, it worked.
    I don't know why but with higher priority, the task cannot create a socket...