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.

AM3359: Beckhoff SSC code build warnings

Part Number: AM3359

I have installed the following all under my c:\ti directory under Windows 10:

PRU-ICSS-EtherCAT_Slave_01.00.08.01
processor_sdk_rtos_am335x_6_03_00_106

Code Composer Studio is installed at
C:\ti\ccs900 and the version is 9.3.0

The cross compiler version I have used is GNU v7.2.1 (Linaro) - Also GNU 9.2.1 (Linaro) is avaiable but I haven't used it.

I have been able to compile the EtherCAT SSC version 5.12 which I have downloaded from ETG with zero errors, but many warnings. Before starting to test the software with Beckhoff TwinCat, I would like to ensure that the warnings are not significant and are not going to impact the tests in a negative manner.

The Target configuration is for AM335x ICE V2.

I get NO ERRORS but 21 Warnings after compilation is finished. The code is also build successfully. Before testing, I would like to know if I can manually interfere with the code generation process and eliminate the warnings. Also I hope to get some feedback about which Warnings are significant and should be dealt with.

I have also provided a word document showing a picture of the Problems as seen in CCS Problems page.



=============================================================================================
14 of the warnings are about some Macro being redefined. I have enclosed here a sample message from the compiler for
the file tiesc_soc.

Building file: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x/tiesc_soc.c"
Invoking: GNU Compiler
"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe" -c -mcpu=cortex-a8 -march=armv7-a -mtune=cortex-a8 -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -DSOC_AM335x -Dicev2AM335x -DAM335X_FAMILY_BUILD -Dcore0 -DNO_UART_MSG_APP -DTIESC_APPLICATION=1 -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/projects/ethercat_slave_full/ethercat_slave_full_AM335x_arm" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include/am335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/include" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/firmware/v1.0" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/examples" -I"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -O2 -ffunction-sections -fdata-sections -g -gdwarf-2 -gstrict-dwarf -Wall -mno-unaligned-access -MMD -MP -MF"tiesc_soc.d" -MT"tiesc_soc.o" @"configPkg/compiler.opt" -o"tiesc_soc.o" "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x/tiesc_soc.c"
In file included from C:/ti/pdk_am335x_1_0_17/packages/ti/drv/spi/soc/ESPI_v2.h:64:0,
from C:/ti/pdk_am335x_1_0_17/packages/ti/drv/spi/soc/SPI_soc.h:113,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/examples/board/include/board_mcspi.h:50,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x/tiesc_soc.c:68:
C:/ti/pdk_am335x_1_0_17/packages/ti/drv/spi/soc/tispi_pruss_intc_mapping.h:22:0: warning: "PRU_ARM_EVENT0" redefined
#define PRU_ARM_EVENT0 20 /* SYS_EVT_AL_EVENT_REQUEST */

====================================================================
Many of the next set of warnings are related to type mismatch and they occur only in compiling sdoserv.c file.
These are the warnings that I am most concerned about. See for yourself:
Finished building: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c"

Building file: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c"
Invoking: GNU Compiler
"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe" -c -mcpu=cortex-a8 -march=armv7-a -mtune=cortex-a8 -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -DSOC_AM335x -Dicev2AM335x -DAM335X_FAMILY_BUILD -Dcore0 -DNO_UART_MSG_APP -DTIESC_APPLICATION=1 -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/projects/ethercat_slave_full/ethercat_slave_full_AM335x_arm" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include/am335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/include" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/firmware/v1.0" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/examples" -I"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -O2 -ffunction-sections -fdata-sections -g -gdwarf-2 -gstrict-dwarf -Wall -mno-unaligned-access -MMD -MP -MF"EcatStack/sdoserv.d" -MT"EcatStack/sdoserv.o" @"configPkg/compiler.opt" -o"EcatStack/sdoserv.o" "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c"
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c: In function 'SdoUploadSegmentInd':
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c:529:44: warning: overflow in implicit constant conversion [-Woverflow]
pSdoSegRes->SdoHeader.SegHeader &= ~SEGHEADER_MASK;
^
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c: In function 'SDOS_SdoInd':
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c:1131:92: warning: overflow in implicit constant conversion [-Woverflow]
pSdoResStored->SdoHeader.Sdo[SDOHEADER_COMMANDOFFSET] &= ~SDOHEADER_COMMANDMASK;
^
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c:1187:86: warning: overflow in implicit constant conversion [-Woverflow]
pSdoResStored->SdoHeader.Sdo[SDOHEADER_COMMANDOFFSET] &= ~SDOHEADER_COMMANDMASK;
^
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c:1214:86: warning: overflow in implicit constant conversion [-Woverflow]
pSdoResStored->SdoHeader.Sdo[SDOHEADER_COMMANDOFFSET] &= ~SDOHEADER_COMMANDMASK;
^
Finished building: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/sdoserv.c"

I don't understand what these -Woverflows refer to. I have not had a chance to investigate what ~SDOHEADER_COMMANDMASK really means. Perhaps you can help.
=======================================================================

And this group is mostly about type mismatch but seems like a minor problem:

Building file: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c"
Invoking: GNU Compiler
"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe" -c -mcpu=cortex-a8 -march=armv7-a -mtune=cortex-a8 -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -DSOC_AM335x -Dicev2AM335x -DAM335X_FAMILY_BUILD -Dcore0 -DNO_UART_MSG_APP -DTIESC_APPLICATION=1 -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/projects/ethercat_slave_full/ethercat_slave_full_AM335x_arm" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include" -I"C:/ti/pdk_am335x_1_0_17/packages/ti/starterware/include/am335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/include" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/firmware/v1.0" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/iceAM335x" -I"C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/examples" -I"C:/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -O2 -ffunction-sections -fdata-sections -g -gdwarf-2 -gstrict-dwarf -Wall -mno-unaligned-access -MMD -MP -MF"EcatStack/objdef.d" -MT"EcatStack/objdef.o" @"configPkg/compiler.opt" -o"EcatStack/objdef.o" "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c"
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c: In function 'OBJ_GetDesc':
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:613:37: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
strSize = (UINT16) OBJSTRLEN((OBJCONST CHAR OBJMEM *) pDesc);
^
In file included from c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\stdlib.h:11:0,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecat_def.h:21,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:123:
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\string.h:41:16: note: expected 'const char *' but argument is of type 'const int8_t * {aka const signed char *}'
size_t _EXFUN(strlen,(const char *));
^
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\_ansi.h:65:30: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^~~~
In file included from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:127:0:
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecatslv.h:70:83: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
#define OBJGETNEXTSTR(p) ( (OBJCONST CHAR OBJMEM * )( &((p)[OBJSTRLEN( (OBJCONST CHAR OBJMEM *) (p) ) + 1]) ) ) /**< \brief Macro to get next name within the objetc name string*/
^
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:662:74: note: in expansion of macro 'OBJGETNEXTSTR'
OBJCONST UCHAR OBJMEM * pSubDesc = (OBJCONST UCHAR OBJMEM *) OBJGETNEXTSTR( pDesc );
^~~~~~~~~~~~~
In file included from c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\stdlib.h:11:0,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecat_def.h:21,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:123:
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\string.h:41:16: note: expected 'const char *' but argument is of type 'const int8_t * {aka const signed char *}'
size_t _EXFUN(strlen,(const char *));
^
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\_ansi.h:65:30: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^~~~
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:670:49: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
strSize = (UINT16) OBJSTRLEN((OBJCONST CHAR OBJMEM *) pSubDesc);
^
In file included from c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\stdlib.h:11:0,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecat_def.h:21,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:123:
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\string.h:41:16: note: expected 'const char *' but argument is of type 'const int8_t * {aka const signed char *}'
size_t _EXFUN(strlen,(const char *));
^
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\_ansi.h:65:30: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^~~~
In file included from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:127:0:
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecatslv.h:70:83: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
#define OBJGETNEXTSTR(p) ( (OBJCONST CHAR OBJMEM * )( &((p)[OBJSTRLEN( (OBJCONST CHAR OBJMEM *) (p) ) + 1]) ) ) /**< \brief Macro to get next name within the objetc name string*/
^
C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:680:58: note: in expansion of macro 'OBJGETNEXTSTR'
pSubDesc = (OBJCONST UCHAR OBJMEM *) OBJGETNEXTSTR( pSubDesc );
^~~~~~~~~~~~~
In file included from c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\stdlib.h:11:0,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/ecat_def.h:21,
from C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c:123:
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\string.h:41:16: note: expected 'const char *' but argument is of type 'const int8_t * {aka const signed char *}'
size_t _EXFUN(strlen,(const char *));
^
c:\ti\bios_6_76_03_01\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\_ansi.h:65:30: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^~~~
Finished building: "C:/ti/PRU-ICSS-EtherCAT_Slave_01.00.08.01/protocols/ethercat_slave/ecat_appl/EcatStack/objdef.c"

  • Hi Farrokh,

    This has been tracked in internal JIRA, will be taken care of in next maintenance release. These warnings should have no impact to the EtherCAT functionality.

    Regards,

    Garrett

  • Garret,

    Thanks for the quick reply. Please also note that the document provided with the installation of PRU-ICSS-EtherCAT_Slave_01.00.08.01 under doc section is essentially ok but quite inaccurate in some sense. If they are going to do things about the warnings perhaps the document can be improved too. The main problem with the document is the patch section. The instruction in the document titled USER GUIDE in the DOCS directory of the installation, indicated under section 

    1.1.10. Building full feature EtherCAT Slave
    Application

    - - -

    2. - -

    3. Copy the patched Beckhoff source files (.c and .h) to
    [INSTALL-DIR]/protocols/ethercat_slave/ecat_appl/EcatStack

    4. - - 

    ---

    ---

    The total number of files out of the patch process are perhaps 8 to 10. However many other files must also be copied to the EcatStack directory before the compilation can be successful. So the document is not sufficiently explicit and accurate. In addition to copying the patched files, I had to copy quite a few other files from the CCS5.12 directory into the EcatStack folder to make the project compile. Originally, I had in excess of 20 errors which looked daunting. However, a closer look showed that there are more missing files. I simply used the preprocessor option of the compiler to determine the missing files one by one and copied the files based on compiler messages and errors to the EcatStack directory until the issues went away.

    I think it will be helpful to other users if you either guide them about copying and pasting additional missing files, or if it is at all possible, provide a simple script to audit the EcatStack folder and provide feedback to the user about the required files to add to the directly. This script may be project dependent but it will help to simplify and speed up the compilation process. 

    Thanks

    Farouk