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/PRU-ICSS-INDUSTRIAL-SW: EtherCAT Slave demo issue

Part Number: PRU-ICSS-INDUSTRIAL-SW
Other Parts Discussed in Thread: AM3359, SYSBIOS

Tool/software: TI-RTOS

Hello,

I am testing the PRU ICSS EThercat slave demo project PRU-ICSS-EtherCAT_Slave_01.00.04.02 with processor_sdk_rtos_am335x_4_00_00_04 (pdk_1_0_7). I have checked the system requirements and i have installed all the recommended version from http://processors.wiki.ti.com/index.php/PRU_ICSS_EtherCAT#Component_Version 

I am using Code Composer Studio 7.1.0, bios_6_46_05_55 and AM3359 Sitara IceV2 evaluation board. I have not done any change to the sample code.

I am getting an exception at the call of UART_printf("\nVersion - "); in task1(). When I did step by step debugging then I found that it is throwing exception at semaphore_pend in Semaphore.c file. The sem variable is not getting initialized and sem->count is throwing exception. What could be causing this un-initialized semaphore. I am using the gel file of CCS7.1.0 so it if 2.1 version. 

I tried this same sample application on different machine and I see exception issue with semaphore access only. Earlier I had seen this issue at the call SPI_open() where exception was thrown at semaphore access.

Can some one please help me on whether I need to do some changes in build environment which I am missing? I can run the pre-built binary on my setup without any issue.

regards

Mohit

  • The RTOS team have been notified. They will respond here.
  • Hi Mohit

    It is a good practice to do a clean install of each Processor SDK and CCS version in an empty directory to avoid potential issues. To speed up the install and to have a local copy, the PRU_ICSS_Protocol, Processor SDK and CCS can be first downloaded to a directory such as Downloads and then installed from disk.

    As a first sanity check - let's verify the CCS version information is version 7.1.0.00016 (Mar 17, 2017). This is don a CCS > Help > About code composer studio. The reason that we are being careful is that CCS will offer to install a 7.2 update which should not be accepted.

    Another potential issue could be - If you previously used the SYSBIOS Industrial SDK there will be a definition for IA_SDK_HOME in the windows environment which should be removed.

    If you have installed the Processor SDK, Pru-ICSS_Protocol, or CCS in a directory other than C:\ti then we need to make sure that CCS knows where all of the related files are location. This is done by going to CCS -> Window -> Preferences -> Products and then entering the Install Directory path for CCS, Processor SDK and the EProtocol (EtherCAT) . Remove any directories which are not part of this configuration. You will also need to edit the EtherCAT - project create script in [INSTALL-DIR]/PRU-ICSS-EtherCAT_Slave_01.00.04.02/projects/projectCreate.bat to point to the correct locations of CCS, Processor SDK and EtherCAT.


    David

  • Hello David,
    I am using CCS 7.1.0.00016 version. I have also tested this on a system where no SDK/PDK was installed. I have installed all the tools to c:\ti folder.
    But I get the exception issue with the ethercat_slave_demo project. The issue is always at semaphore access.

    How can I uninstall processor SDK? Can I just delete the folders of pdk, xdctools or rename the folder as c:\ti_old. Then should I do a fresh installation?
    Is there a preferred order of installation i.e. PRU_ICSS_Ethercat shall be installed after installing CCS and PSDK? I understand that that it is only extraction of package and copy to c:/ti folder. Do we also update some environment variables during installation?

    regards
    Mohit
  • Hi Mohan

    The simplest test configuration is where Processor SDK, CCS, and PRU-ICSS Industrial is loaded into an empty c:\ti directory. There are many other configurations that will work - but this is the simplest to install .

    1) Remove all other versions of CCS by going to control panel > Programs and Features >  uninstall all other versions of CCS. 

    2) Remove all files and directories in c:\ti so that C:\ti is completely empty. We can also rename the previous C:\ directory to something else and then created a empty c:\ti directory as well.

    I have not seen a dependency on load order but the order I use is :

    3) Disable virus protection.

    4) Download and install Processor SDK

    5) Install CCS.

    6) At this point CCS 7.1 starts.  I typically change the workspace name for each CCS installation to avoid potential conflicts. However we will do that in the PRU-ICSS-EtherCAT project creation in a later step. Permit CCS to go through it's initialization. CCS will then recommend the available updates.  For this Processor SDK version - select all of the updates except for the CCS Service Release Windows 7.2.0.00013 since we want to use CCS 7.1 .   

    7) Since we are installing everything in C:\ti - CCS will automatically find the support tools XDCtools, SYSBIOS, NDK, .... without additional configuration.

    8) Close CCS

    9) Install PRU-ICSS EtherCAT .

    At this point C:\ti should look like

    10) Restart CCS and permit it to go through it's initialization so that it recognized the files that are downloaded with PRU-ICSS EtherCAT.

    CCS should show

    11) Close CCS

    12) Edit C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\projectCreate.bat

    In this case we want to change line 37 From  set "CCS_WORKSPACE_LOC=%USERPROFILE%\ccs_workspace"  to another name (for example) set "CCS_WORKSPACE_LOC=%USERPROFILE%\ccs_ECS" to avoid potential conflicts.

    13) Save the file and create a dos window

    14) cd to C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects

    15) enter projectCreate.bat AM335x arm ethercat_slave_demo

    you should see

    C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects>projectCreate.bat AM335x arm ethercat_slave_demo
    **************************************************************************
    Environment Configuration Summary:
        CCS Install Directory          : C:\ti\ccsv7
        CCS Workspace Directory        : C:\Users\a0122356\ccs_ECS
        SDK Install Directory          : C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\..\..\..
        PDK Install Directory          : C:\ti\pdk_am335x_1_0_7\packages
        Projects create Directory      : C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\..\..\..\protocols\ethercat_slave\projects
        Project create args directory  : C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\..\..\..\protocols\ethercat_slave\projects\ccsproject_args
    **************************************************************************

    Creating project 'ethercat_slave_demo_AM335x_arm' for 'AM335x' platform in directory 'C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\..\..\..\protocols\ethercat_slave\proj
    ects\ethercat_slave_demo_AM335x_arm' by overwriting the project if it exists already...

    --------------------------------------------------------------------------------
    Creating project 'ethercat_slave_demo_AM335x_arm'...


    Done!

    C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects>

    16) Restart virus protection

    17) Start CCS and select workspace ccs_ECS.

    18) Open Project ethercat_slave_demo_AM335x_arm

    19) Rebuild the project

    I use the EVM USB port. For this I configure a  ICE_AM3359 target configuration with a Texas Instruments XDS100v2 Debug Probe.

    My AM335x has has a program in the Flash so I have configure a hardware breakpoint at 0x402f0400 and follow the instructions at

    http://processors.wiki.ti.com/index.php/Industrial_Protocol_Package_Getting_Started_Guide#Launching_and_Debugging_application_in_CCS

    to run the project.

    David

     

  • Hello David,
    Thanks for detailed steps on the installation procedure.
    But I found the root cause of the exception issue. I observed that in my installation "AM335x.lds" file is getting generated in "C:\ti\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\projects\ethercat_slave_demo_AM335x_arm", when I am generating the project files for ethercat. I could also see in the build console that this file is getting used in the build. As a trial, I deleted this file and built the project. This time the exception issue did not come.

    After searching further, I found the following
    processors.wiki.ti.com/.../SYSBIOS_Industrial_SDK_Getting_Started_Guide

    NOTE : When building projects with am335x_debug/am335x_release configuration for ICE_AM3359[CortexA] device, ensure link command file AM335x.lds is removed from Properties->CCS General->Linker command file under Main tab.

    So this linker script file shall not be used with ICE_AM3359[CortexA] build. I am not sure how it is automatically getting generated but after deleting the "AM335x.lds" file from project folder I am not getting the exception issue.

    regards
    Mohit
  • Mohit

    Thank you. I will add that failure indication and cause to our Sitara Industrial FAQ - http://processors.wiki.ti.com/index.php/FAQ_Sitara_Industrial .

    David