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.

CCS/AM3359: Device connection failure with debug running.

Part Number: AM3359

Tool/software: Code Composer Studio

Hi. there


I have an AM3359ICE and J-Link Debugger.

I am working on ehtercat_slave_full_AM335x_arm project.

I have a few questions.


Q1. What version of the SDK is applied to the on-board image (IASDK 1.1.0.5)?
  ( ex: Processor-SDK-RTOS-AM335x 2.0.2 )

Q2. Is it correct to use version 5.12 of Beckhoff SSC Tool?

Q3. ehtercat_slave_full_AM335x_arm The following tests were performed in debug mode.
  If I connect Ethernet to Port 1, the master device will not be able to scan the AM3359ICE2. 
  However, if I connect Ethernet to Port 0, the AM3359ICE2 scan will be successful on the master device.  
  What is the difference between Port 0 and Port 1?

Q4. ehtercat_slave_full_AM335x_arm The following tests were performed in debug mode.
  If I am using Ethernet Port 1 and attempting a connection from the master device, the red LED will blink on the AM3359ICE2 and the connection will fail.

  The below source code is debugging point, please check in your source code.

Ecatslv.c
====================================================================================
UINT8 CheckSmSettings(UINT8 maxChannel)
{
...
pSyncMan = GetSyncMan(MAILBOX_WRITE);

SMLength = pSyncMan->Length;                           // pSyncMan->Length is 0
SMAddress = pSyncMan->PhysicalStartAddress; // pSyncMan->PhysicalStartAddress is 0

if (!(pSyncMan->Settings[SM_SETTING_ACTIVATE_OFFSET] & SM_SETTING_ENABLE_VALUE))
{
result = ALSTATUSCODE_INVALIDMBXCFGINPREOP;
}
...
}
====================================================================================

  I think that Blinking Red LED was AlStatusCode=0x16 that means ALSTATUSCODE_INVALIDMBXCFGINPREOP.


Thank you in advance.

  • simon,

    Ans1: it's unsupported IASDK 1.1.0.5.
    Ans2: yes if you are using the latest PRU-ICSS EtherCAT 1.0.7
    Ans3: port 0 is input whereas port 1 is output
    Ans4: insure to use the TI_ESC.xml from PRU-ICSS-EtherCAT_Slave_01.00.07.02\protocols\ethercat_slave\ecat_appl\esi

    Regards,
    Garrett
  • Hi Garrett


    Ans3: port 0 is input whereas port 1 is output
      >> In the default on image, both port 0 and port 1 were able to scan and connect from the master device.
           Does port 0 and port 1 behave differently because ethercat_slave_full_AM335x_arm?

    Ans4: insure to use the TI_ESC.xml from PRU-ICSS-EtherCAT_Slave_01.00.07.02\protocols\ethercat_slave\ecat_appl\esi
      >> I used TI_ESC.xml and TiEtherCATLib from PRU-ICSS-EtherCAT_Slave_01.00.07.02\protocols\ethercat_slave\ecat_appl\esi in the master device
           The PRU-ICSS EtherCAT version is 01.00.07.02.
           The slave stack code version is 5.12.
           The project used is ethercat_slave_full_AM335x_arm.

           1. The scan is successful.
           2. Trying to connect will fail. At this time, the red LED is blinking.

    Are there other checkpoints?


    Regards,
    Simon

  • Simon,

    You must connect port 0 of EtherCAT slave to the master, and port 1 connecting to the 2nd slave if any.
    You should remove TiEtherCATLib.xml from TwinCAT and only use TI_ESC.xml. What's the error message in TwinCAT when the connection fails after scan?

    Regards,
    Garrett
  • Hi Garrett


    1. I connect port 0 of EtherCAT slave to the master.
    2. I removed TiEtherCATLib.xml from master and only use TI_ESC.xml.
    3. I can not used a twincat. I use a master program called WMX3.
        And it operates normally on the on-board image (IASDK 1.1.0.5).
    4. When debugging, the following error code is generated at this time.
        " AlStatusCode=0x16 "
        ALSTATUSCODE_INVALIDMBXCFGINPREOP : Invalid mailbox configuration (PreOP state)
        Which part of the mailbox configuration should I check?

        Where can I get ESC parameters in EtherCat Slave Stack to set bsp_set_sm_properties() function.
        Is read eeprom(const unsigned char tiesc_eeprom[] in Tiesc_eeprom.h), xml(TI_ESC.xml) or other memory for ESC configuration in EtherCat Slave Stack? 
        In void bsp_set_sm_properties(PRUICSS_Handle pruIcssHandle, uint8_t sm, uint16_t address, uint16_t length),
        address and length are set each zero by performing
        bsp_set_sm_properties(pruIcssHandle, channel, bsp_read_word(pruIcssHandle, sm_address), bsp_read_word(pruIcssHandle, (sm_address + 2)))
        because bsp_read_word() return each zero. And please refer source code below.

    Tiescbsp.c
    ------------------------------------------------------------------------------
    void bsp_pdi_write_indication(PRUICSS_Handle pruIcssHandle, uint16_t address,
    uint16_t length, uint16_t value)
    {

    ...

    else if(((address <= ESC_ADDR_SM0_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM0_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM1_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM1_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM2_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM2_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM3_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM3_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM4_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM4_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM5_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM5_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM6_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM6_PDI_CONTROL)) ||
        ((address <= ESC_ADDR_SM7_PDI_CONTROL)
        && ((address + length) > ESC_ADDR_SM7_PDI_CONTROL)))
        {
            uint8_t channel = (address - ESC_ADDR_SYNCMAN) >> 3;
            uint16_t sm_address = ESC_ADDR_SYNCMAN + (channel * SIZEOF_SM_REGISTER);
            bsp_send_command_to_firmware(pruIcssHandle, CMD_DL_USER_WRITE_SM_PDI_CTRL,
                                            (channel << 8) | value, 0);

            while(bsp_pdi_sm_config_ongoing(pruIcssHandle));

            bsp_set_sm_properties(pruIcssHandle, channel, bsp_read_word(pruIcssHandle,
                                sm_address), <<<----------------------------------------- address: return 0
                                bsp_read_word(pruIcssHandle, (sm_address + 2))); <<<----- length: return 0
        }
    ...
    }
    -------------------------------------------------------------------------
    I think that it is some problem to set esc configuration.
    I don't know exactly why address and length are returned as each zero yet.

    Therefore, next problem was already remarked in before case.
    Ecatslv.c
    -------------------------------------------------------------------------
    UINT8 CheckSmSettings(UINT8 maxChannel)
    {
    ...

        pSyncMan = GetSyncMan(MAILBOX_WRITE);

        SMLength = pSyncMan->Length;                          <------------------- // pSyncMan->Length is 0
        SMAddress = pSyncMan->PhysicalStartAddress; <------------------- // pSyncMan->PhysicalStartAddress is 0

        if (!(pSyncMan->Settings[SM_SETTING_ACTIVATE_OFFSET] & SM_SETTING_ENABLE_VALUE))
        {
            result = ALSTATUSCODE_INVALIDMBXCFGINPREOP;
        }

    ...
    }
    -------------------------------------------------------------------------
    I think that it is fail of esc PREOP(pre operation).


    Regards,
    Simon

  • Simon,

    From the thread - e2e.ti.com/.../2928021 so you are able to get the slave to OP status with TwinCAT but fail with the WMX3 master? If so, you might need check if the TI_ESC.xml is parsed correctly by WMX3 instead of debugging in slave side. Yes, ESC parameters are from eeprom which is converted from xml file as well.

    Regards,
    Garrett