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.

Use TwinCAT run in DC mode with the AM335x ICE



Hi,

I Used the Master tool (TwinCAT) to run the slave(ICE) and the slave is SYS/BIOS SDK 1.0.0.7 of AM335x ICE .

if I set the TwinCAT run in DC mode and Disable Sync1 signal , the slave's  state of infoData parameter will be 0x52, and the ERR led light.

the error message in TwinCAT is:
  0x___2 = Slave in 'PREOP' state
  0x001_ = Slave signals error
  0x004_ = Initialization error occurred

  • Yes,

    I believe that is correct as for current configuration of our ESC both Sync 0 and Sync 1 need to be enabled. Is that a problem for you?

    Regards.

  • Dear Frank,

    1.Since the Sync 1 is an option item can be Enable/Disable when communication in DC mode.

       So I think, is it an PRU firmware bug issue?

    2.The Sync0task Function in SYS/BIOS stack code will service both two signals. Is this behavior correct?

       If Yes, how can I distinguish this two signals?

    Best regards,

    Louis

  • Hi,

    This is not a firmware issue - stack configuration by default expect SYNC0 and SYNC1 enabled. Please refer to below thread on how to change this

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/264078/924585.aspx#924585

    Please upgrade to 1.0.0.8 (the latest version of SDK)  - this has support for SYNC1 ISR 

  • Dear Frank,

    Thank for your reply.

    I have another question that is when I operation the following link step by step, After restart in run mode, I observed the PDItask and Sync0task both waited the event by  Semaphore_post( HOST_AL_EVENT& HOST_SYNC0_EVENT ), Any comment?

    http://processors.wiki.ti.com/index.php/Running_AM335x_EtherCAT_Application_in_DC_Mode

    I used the 1.0.0.8 SDK and following is my test code

    in Sync0task:
                //LED5G on
                *((unsigned int*) 0x44E07194)  = 0x00010000;        // set bit 16
            Sync0_Isr();
                //LED5G off
                *((unsigned int*) 0x44E07190)  = 0x00010000;        // reset GPIO0 bit 16

    in PDItask:
                 //LED6R on
                *((unsigned int*) 0x44E07194)  = 0x00000002;        // set bit 1
            HW_EcatIsr();
                //LED6R off
                *((unsigned int*) 0x44E07190)  = 0x00000002;        // reset GPIO0 bit 1

    I used to TwinCAT (V2.11) as master tool. and following is my test case:

    1. Two Slaves(TI-ESC) both in free/synchron mode, after reset TwinCAT and activate free run.
        -LED6R on and off repeated.

    2. Two slaves(TI-ESC) both in DC mode, after restart in run mode.
       -Both LED6R and LED5Gon and off repeated.

    I thought the PDItask is only triggered in Free/Synchron mode, and the Sync0task is only triggered in DC mode. doesn't it?

  • Hi,

    >I thought the PDItask is only triggered in Free/Synchron mode, and the Sync0task is only triggered in DC mode. doesn't it?

    No - this is not true. PDI task is triggered whenever process data (SM2 or SM3) event occurs even in DC mode.

  • Dear Frank,

    Thanks your information.

    As above case, I measured the LED5G rising edge signal which triggered in Sync0task function between two slaves, but the delta time is large then 1us.
    whether the delta time between two slaves must less then 1us in DC mode?

    Otherwise, have any suggestion to verify the synchronize time between two slaves(TIESC-001) in the DC mode?

    Best regards,

    Louis

  • Louis,

    you shouldn't expect to be able to do this in software. There is some considerable jitter on the software side depending on your system configurations and application (cache, GPIO latency, wait states...). Now that is why we provide the Sync0 and Sync1 output signals on the device. On ICE they are routed to J12. See the docs for details.

    There you can accurately measure sync signals down to the ns level using a (good) scope. That is at least how we do it...

    regards.

  • Dear Frank,

      Can you tell me where can find the doc which is defined the outputs signals, thanks.

    Best regards,

    Louis

  • Louis,

    usually here: http://processors.wiki.ti.com/index.php/AM335x_Industrial_Communication_Engine_%28ICE%29_EVM_HW_User_Guide

    But it doesn't tell you where Sync0 comes out... you also need this:

        // enable ECAT SYNC0 for DC Tests
        { 0x0968 , 6 , AM335X_PIN_OUTPUT },    //    pr1_edc_sync0_out -> DC mode - uart0_ctsn

    And that leads to: UART4_RXD (pin 39 on J12).

    I agree this is not easy... I wonder if we need to improve the docs for DC users :-).

    Regards.

  • Dear Frank,

      Thanks for your tips, so the two external signals of Latch0/1 also have routed to the ICE device?

    I have measured the delta time of Sync0 signals of two slaves, and the delta time also down to the ns level.

    >I wonder if we need to improve the docs for DC users :-).
    I agree that there is a need to improve : ) .

    Best regards,

    Louis

  • Dear Frank,


         How about Latch0 and Latch1 signal pin? Have be route to the ICE device?

  • Dear Louis, can you provide information about delta time between two sync on different devices?
    I can't found it on http://processors.wiki.ti.com/index.php/Running_AM335x_EtherCAT_Application_in_DC_Mode. There is just a method but not a result.