Tricore compilation

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

shanmu

Re: Tricore compilation

Post by shanmu »

Hi Errico,
Do I have to edit something in the make file rules_infineon_tc_generic.mk? The error indicates, it has multiple target platforms. How can I edit or change the target platform?

Thanks,
Shanmu
e.guidieri

Re: Tricore compilation

Post by e.guidieri »

Hi,

I don't think you have to edit the makefile.

I think that you have something weird that will put a path with c:/ string in target prerequisites.

I have the suspect that you are not using the cygwin make command.

could you please open a cygwin shell and execute "which make", to check wich make command is executed (it should been /usr/bin/make). If it's something else you have to edit your PATH variable to have /usr/bin/ as first path in your cygwin shell.

if the make is right try to launch make -pn (i.e. make --print-data-base --dry-run), on your project and collect info.

Errico
ozcannergiz

Re: Tricore compilation

Post by ozcannergiz »

Hello,

I am getting exactly the same error.

Could you find a solution already ?

O.
shanmu

Re: Tricore compilation

Post by shanmu »

@ozcannnergiz,
The error was not resolved. Afterwards I left this because of other works.
Let me know if you find solution for this error.

Thanks,
Shanmu
e.guidieri

Re: Tricore compilation

Post by e.guidieri »

The bug have been fixed. The fix shall be available with the next successfully built update site (hopefully, tomorrow).

http://www.evidence.eu.com/erika-builds ... uid_270_nb

Errico
NSR

Re: Tricore compilation

Post by NSR »

It appears that I too am experiencing similar problems, even after the update.

Platform is Windows 10 x64 with a TC275-based ShieldBuddy

Downloaded and installed eeCygwin_1_7_9

Downloaded Erika and installed at C:\erika

Updated the software as per Errico's post above: http://erika.tuxfamily.org/forum/viewto ... t=15#p2674

The following steps were carried out:

Create a new project->RT-Druid
Project Name: Test
Options for Toolchains are: --Other Toolchain--, Cross GCC, Cygwin GCC, GNU Autotools Toolchain, Microsoft Visual C++
No toolchain is selected: <Next>
Create a project using one of these templates: check
Select: tricore->Infineon_Triboard-TC2x5_V2.0->Schedule Tables->Schedule Table example
<Finish>
Right click on project and Build Project

This produces

Code: Select all

09:05:53 **** Build of configuration Default for project Test ****
"C:\\Users\\WinUser\\workspace\\Test\\Debug\\make_launcher.bat" all 
C:\cygwin\bin\bash found!
      0 [main] bash 17232 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Using erika files in /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
cygwin warning:
  MS-DOS style path detected: \\Users\\WINUSER\\WORKSP~1\\Test
  Preferred POSIX equivalent is: //Users//WINUSER//WORKSP~1//Test
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
/cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/cfg/arch/rules_infineon_tc_generic.mk:228: *** multiple target patterns.  Stop.

09:05:58 Build Finished (took 5s.289ms)
Following Errico's post above regarding the which make and make -pn at http://erika.tuxfamily.org/forum/viewto ... t=15#p2525 produces the attached code - it's too big to include here.

Any insight would very much be appreciated.
Attachments
DebugInfo.zip
(12.58 KiB) Downloaded 3073 times
e.guidieri

Re: Tricore compilation

Post by e.guidieri »

Hi NSR,

as I posted yesterday this should be fixed with the today nightly build, if you don't want to update or you have problems to do that, try to patch manually your ERIKA in this way

Code: Select all

===================================================================
--- repos/ee/trunk/ee/pkg/cfg/arch/rules_infineon_tc_generic.mk	2017-05-24 11:03:48 UTC (rev 3392)
+++ repos/ee/trunk/ee/pkg/cfg/arch/rules_infineon_tc_generic.mk	2017-05-31 12:59:05 UTC (rev 3393)
@@ -208,7 +208,7 @@
 T32ORTISTR :=
 endif
 
-RTD_MAKEFILE := $(call short_native_path, $(abspath .))/makefile
+RTD_MAKEFILE := makefile
 
 t32: $(T32TARGETS)
in yours folder

Code: Select all

/cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
Regards
NSR

Re: Tricore compilation

Post by NSR »

Hi

Thanks for your response.

I did run the update, but whether or not you can see if it actually updated from the debug file I submitted is another question.

I made the change that you suggested. However, the line in question was 211 and not 208 as may have been indicated in your post. The good news is that I've managed to get a lot further; the bad is that another problem presents itself - please see attached

I can clarify that I have the Hightec compiler installed at: C:\HIGHTEC\toolchains\tricore\v4.9.1.0-infineon-1.1

Regards
Attachments
DebugInfo2.zip
(1.8 KiB) Downloaded 3073 times
NSR

Re: Tricore compilation

Post by NSR »

Update:

I've made some edits to the Hightec file: C:\HIGHTEC\toolchains\tricore\v4.9.1.0-infineon-1.1\tricore\include\tc27xa\IfxMtu_regdef.h

The alternating lines from 136 - 198 inclusive and 205 - 251 inclusive have been commented out. I understand the use of a zero-length bit-field for alignment but I don't know why it is used here, especially if a compiler directive can be invoked to achieve the same thing. Anyway.....

I then received another error:

Code: Select all

13:13:05 **** Build of configuration Default for project Test ****
"C:\\Users\\WinUser\\workspace\\Test\\Debug\\make_launcher.bat" all 
C:\cygwin\bin\bash found!
Using erika files in /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
RM  tc27x.elf
MAKE_DIRECTORIES
make: Warning: File `obj/pkg/cpu/tricore/src' has modification time 0.0044 s in the future
CC    ee_tc2Yx_cstart.c
In file included from c:\hightec\toolch~1\tricore\v4910-~1.1\tricore\include\tc27xa\IfxMtu_reg.h:36:0,
                 from c:\hightec\toolch~1\tricore\v4910-~1.1\tricore\include\tc27xa\ifx_reg.h:54,
                 from C:\erika\eclipse\plugins\COMEUE~4.N20\ee_files\pkg/cpu/tricore/inc/ee_tc_cpu.h:99,
                 from C:\erika\eclipse\plugins\COMEUE~4.N20\ee_files\pkg/cpu/tricore/inc/ee_tc_internal.h:59,
                 from C:\erika\eclipse\plugins\COMEUE~4.N20\ee_files\pkg\mcu\infineon_common_tc2Yx\src\ee_tc2Yx_cstart.c:62:
c:\hightec\toolch~1\tricore\v4910-~1.1\tricore\include\tc27xa\IfxMtu_regdef.h:204:5: error: width of 'reserved_0' exceeds its type
     unsigned int reserved_0:64;             /**< \brief \internal Reserved */
     ^
make: *** [obj/pkg/mcu/infineon_common_tc2Yx/src/ee_tc2Yx_cstart.o] Error 1

13:13:12 Build Finished (took 7s.517ms)
This seems to relate to the _Ifx_MTU_MEMSTAT2_Bits structure at line 204 of the same file where according to the user manual, MTU_MEMSTAT2 is 32 bits wide and not 64. Why it was set to 64 is beyond me. I've changed this to 32 and the build makes significant progress but still fails:

Code: Select all

13:15:58 **** Build of configuration Default for project Test ****
"C:\\Users\\WinUser\\workspace\\Test\\Debug\\make_launcher.bat" all 
C:\cygwin\bin\bash found!
Using erika files in /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
RM  tc27x.elf
MAKE_DIRECTORIES
make: Warning: File `obj/pkg/cpu/common/src' has modification time 0.0075 s in the future
CC    ee_tc2Yx_cstart.c
CC    eecfg.c
CC    ee_hal_structs.c
CC    ee_context.c
CC    ee_tc_trapvec.c
CC    ee_tc_intvec.c
CC    ee_tc_oo.c
CC    ee_tc_internal.c
CC    ee_tc_context.c
CC    ee_as_schedule_tables.c
CC    ee_activate.c
CC    ee_schedule.c
CC    ee_force_schedule.c
CC    ee_gettaskstate.c
CC    ee_gettaskid.c
CC    ee_terminat.c
CC    ee_thendin.c
CC    ee_irqendin.c
CC    ee_iparam.c
CC    ee_tstub.c
CC    ee_tnterm.c
CC    ee_lookup.c
CC    ee_rq_exchg.c
CC    ee_rq_inser.c
CC    ee_shtdown.c
CC    ee_startos.c
CC    ee_chaintas.c
CC    ee_altick.c
CC    ee_getcountervalue.c
CC    ee_getelapsedvalue.c
CC    ee_evclear.c
CC    ee_evget.c
CC    ee_evset.c
CC    ee_evwait.c
CC    ee_tc2Yx_system.c
CC    ee_assert.c
AR libee.a
GEN ee_tc27x_gnu_ram.ld from /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/mcu/infineon_common_tc2Yx/cfg/ee_tc2Yx_gnu_ram.ld.tmpl
LD tc27x.elf
tricore-gcc.exe: error: obj/code.o: No such file or directory
make: *** [tc27x.elf] Error 1

13:17:33 Build Finished (took 1m:35s.36ms)
Regards
e.guidieri

Re: Tricore compilation

Post by e.guidieri »

Hi,

the first issue is tied to the new Ifx headers release (infineon standard headers) so you should contact Hightec (that probably will contact Infineon).
Issue with standard headers with hightec is something that happened to us too with the old compiler versions and it doesn't seems that they find a solution stable in time.

The second issue seems an out-of-sync eclipse folder (since make doesn't see the code.c project source file, weird)... Did you try to clean project + F5 + build again?

Errico
NSR

Re: Tricore compilation

Post by NSR »

Hi

Thanks for your update.

Yes, I cleaned and before the rebuild. Just to make sure, I've followed your steps exactly by adding the refresh in the also but still no further. Still, progress is being made.

Regards
NSR

Re: Tricore compilation

Post by NSR »

Update:

I've managed to successfully compile the example, but with a little messing about. After the Project Clean and Refresh stages, I copied the code.c file to the Debug folder and managed to get the project to finally compile:

Code: Select all

07:15:20 **** Build of configuration Default for project Test ****
"C:\\Users\\WinUser\\workspace\\Test\\Debug\\make_launcher.bat" all 
C:\cygwin\bin\bash found!
Using erika files in /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
RM  tc27x.elf
MAKE_DIRECTORIES
CC    ee_tc2Yx_cstart.c
CC    eecfg.c
CC    code.c
CC    ee_hal_structs.c
CC    ee_context.c
CC    ee_tc_trapvec.c
CC    ee_tc_intvec.c
CC    ee_tc_oo.c
CC    ee_tc_internal.c
CC    ee_tc_context.c
CC    ee_as_schedule_tables.c
CC    ee_activate.c
CC    ee_schedule.c
CC    ee_force_schedule.c
CC    ee_gettaskstate.c
CC    ee_gettaskid.c
CC    ee_terminat.c
CC    ee_thendin.c
CC    ee_irqendin.c
CC    ee_iparam.c
CC    ee_tstub.c
CC    ee_tnterm.c
CC    ee_lookup.c
CC    ee_rq_exchg.c
CC    ee_rq_inser.c
CC    ee_shtdown.c
CC    ee_startos.c
CC    ee_chaintas.c
CC    ee_altick.c
CC    ee_getcountervalue.c
CC    ee_getelapsedvalue.c
CC    ee_evclear.c
CC    ee_evget.c
CC    ee_evset.c
CC    ee_evwait.c
CC    ee_tc2Yx_system.c
CC    ee_assert.c
AR libee.a
GEN ee_tc27x_gnu_ram.ld from /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/mcu/infineon_common_tc2Yx/cfg/ee_tc2Yx_gnu_ram.ld.tmpl
LD tc27x.elf
************************************
Compilation terminated successfully!
GEN t32.cmm from /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/mcu/infineon_tc27x/cfg/t32_tc27x_ram.cmm
GEN orti.cmm from /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/mcu/infineon_common_tc2Yx/cfg/orti.cmm
GEN markers.cmm from /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files/pkg/mcu/infineon_common_tc2Yx/cfg/markers.cmm

07:16:58 Build Finished (took 1m:38s.461ms)
I wonder if there's something wrong with the makefile:

Code: Select all

### Setting Erika's variables:
# ERIKA_FILES= ../../..
# APPBASE = .
# 
# EEOPT =


RTDRUID_CONFIGURATOR_NUMBER:=1278



############################################################################
#
# User options
#
############################################################################
EEOPT += EE_DEBUG
EEOPT += __ASSERT__
EEOPT += EE_EXECUTE_FROM_RAM
EEOPT += EE_SAVE_TEMP_FILES


############################################################################
#
# Automatic options
#
############################################################################
EEOPT += __RTD_CYGWIN__
EEOPT += EE_TRIBOARD_TC2X5
EEOPT += EE_TRICORE__
EEOPT += EE_TC27X__
EEOPT += EE_GNU__
EEOPT += ENABLE_SYSTEM_TIMER
EEOPT += __OO_ORTI_LASTERROR__
EEOPT += __OO_ORTI_SERVICETRACE__
EEOPT += __OO_ORTI_PRIORITY__
EEOPT += __OO_ORTI_RES_LOCKER_TASK__
EEOPT += __OO_ORTI_RES_ISLOCKED__
EEOPT += __OO_ORTI_STACK__
EEOPT += __OO_ORTI_ALARMTIME__
EEOPT += __OO_ORTI_RUNNINGISR2__
EEOPT += __OO_ECC1__
EEOPT += __OO_EXTENDED_STATUS__
EEOPT += __MULTI__
EEOPT += EE_AS_SCHEDULETABLES__
EEOPT += __OO_NO_ALARMS__
EEOPT += __OO_NO_RESOURCES__
EEOPT += __OO_AUTOSTART_TASK__
EEOPT += EE_AS_AUTOSTART_SCHEDULETABLE__
EEOPT += __ALLOW_NESTED_IRQ__
EEOPT += __DISABLE_EEOPT_DEFINES__


############################################################################
#
# Erika base directory
#
############################################################################
ifdef ERIKA_FILES
ifdef EEBASE
    $(warning EEBASE is set, but it has been overridden by ERIKA_FILES)
endif
EEBASE := $(shell cygpath `cygpath -ms '${ERIKA_FILES}'`)

else # ERIKA_FILES

ifndef EEBASE
        EEBASE := $(shell cygpath `cygpath -ms 'C:\erika\eclipse\plugins\com.eu.evidence.ee_2.7.0.N20160609_1458\ee_files'`)
else
        $(warning The usage of EEBASE is deprecated. Please use ERIKA_FILES)
endif
endif # ERIKA_FILES
# ERIKA_FILES has fulfilled its role. Make sure it's not used inside Erika makefiles
ERIKA_FILES :=
$(info Using erika files in $(EEBASE))


############################################################################
#
# Tricore
#
############################################################################
export PLATFORM := CYGWIN

APPBASE := ..
OUTBASE := Debug

-include $(EEBASE)/pkg/cfg/path_helper.mk
$(eval $(call check_and_set_cygwin_compiler_path,TRICORE_GCCDIR,$(shell dirname "$(shell which tricore-gcc)")/../))
TRICORE_MODEL  := tc27x

# Add a flag for the linkerscript to set the minimum size of system stack
LDFLAGS += -Wl,--defsym=__USTACK_SIZE=8192
LDFLAGS += -Wl,--defsym=__CSA_SIZE=16384



############################################################################
#
# Flags
#
############################################################################
CFLAGS  += 
ASFLAGS += 
LDFLAGS += 
LDDEPS  += 
LIBS    += 



############################################################################
#
# Sources
#
############################################################################
APP_SRCS += eecfg.c code.c


############################################################################
#
# end
#
############################################################################
include $(EEBASE)/pkg/cfg/rules.mk
or the make_launcher.bat:

Code: Select all

@REM   WARNING   this file is automatically generated by RT-Druid

@REM   If you want modify this file, you should move it to a safe folder,
@REM   like the project's root, and update the path inside the project 
@REM   properties "C/C++ Make Project" -> "Build command"
@REM   i.e.   ${workspace_loc:Test}/make_launcher.bat

@REM   Unset CWD and PWD. They may cause cygwin warning.
@set CWD=
@set PWD=

@set EE_BASH_PATH=C:\cygwin\bin\bash

@if EXIST %EE_BASH_PATH%.exe goto endok

@echo %EE_BASH_PATH% not found.

@echo Trying c:\cygwin\bin\bash.exe
@set EE_BASH_PATH=c:\cygwin\bin\bash.exe
@if EXIST %EE_BASH_PATH% goto endok
@echo %EE_BASH_PATH% not found.

@echo Trying c:\cygwin\usr\bin\bash.exe
@set EE_BASH_PATH=c:\cygwin\usr\bin\bash.exe
@if EXIST %EE_BASH_PATH% goto endok
@echo %EE_BASH_PATH% not found.

@echo Trying d:\cygwin\bin\bash.exe
@set EE_BASH_PATH=d:\cygwin\bin\bash.exe
@if EXIST %EE_BASH_PATH% goto endok
@echo %EE_BASH_PATH% not found.

@echo Trying d:\cygwin\usr\bin\bash.exe
@set EE_BASH_PATH=d:\cygwin\usr\bin\bash.exe
@if EXIST %EE_BASH_PATH% goto endok
@echo %EE_BASH_PATH% not found.

@echo ERROR: bash not found.
@echo Please check the location of your cygwin installation and enter it in Eclipse in "Windows/Preferences/RT-Druid/Cygwin paths".
@exit

:endok
@echo %EE_BASH_PATH% found!

@set ERIKA_FILES=C:\erika\eclipse\plugins\com.eu.evidence.ee_2.7.0.N20160609_1458\ee_files

@%EE_BASH_PATH% -l -c "cd \"%CD%\"; make %1 %2 %3 %4 %5 %6 %7 %8 %9"
Regards
e.guidieri

Re: Tricore compilation

Post by e.guidieri »

Hi NSR,

the problem in this case seems to be VPATH variable tied with an old version of make command (which is your version? my collegue that tested this uses 4.2.1)

in $(ERIKA_FIKES)/pkg/cfg/arch/rules_infineon_tc_generic.mk makefile

my collegue used to transform APPBASE from relative to absolute path (the same thing it did for makefile dependency)

Code: Select all

vpath %.c $(EE_VPATH) $(call short_native_path,$(APPBASE))
vpath %.c $(EE_VPATH) $(call short_native_path,$(APPBASE))
It seems that old version of make on cygwin cannot handle the "C:\\" stuff that this approach generate. I suggest you to be always aligned to last cygwin setup release.

If you cannot, don't want to do that you cold try to change the line above like this and let me know if this approach works.

Code: Select all

vpath %.c $(EE_VPATH) $(APPBASE)
vpath %.c $(EE_VPATH) $(APPBASE)
Regards,
Errico
NSR

Re: Tricore compilation

Post by NSR »

Hi Ericco, thanks for your update

Interrogating the version of make that I am using I get the following

Code: Select all

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-cygwin
So it would appear that this could well be a determining factor. I am using the eeCygwin_1_7_9 that was made available with the distribution. I am unsure about updating it and I don't about a process for selecting packages for installing it afresh.

In lieu of completing an update/install, I've tried your suggestion. I am assuming that instead of repeating the line that you suggested to change, that the line referencing the .S file as well as the .c file also requires changing? For what it's worth I have therefore modified as follows:

Code: Select all

#vpath %.c $(EE_VPATH) $(call short_native_path,$(APPBASE))
vpath %.c $(EE_VPATH) $(APPBASE))
#vpath %.S $(EE_VPATH) $(call short_native_path,$(APPBASE))
vpath %.S $(EE_VPATH) $(APPBASE))
This still didn't work, so thinking that $(APPBASE) appears to be particularly relevant in this scenario, I added @echo "Building using $(APPBASE)" in an appropriate place as follows:

Code: Select all

# produce the object file from C code in a single step
$(OBJDIR)/%.o: %.c $(OBJDEP)
	@echo "Building using $(APPBASE)"
	$(VERBOSE_PRINTCC) $(EE_CC) $(DEFS_CC) $(OPT_INCLUDE) $(OPT_CC) $(DEPENDENCY_OPT) \
	$(TARGET_C_FILE) $(SOURCE_C_FILE)
	$(QUIET)$(call make-depend, $(subst .o,.d,$(@)))
This produces the following:

Code: Select all

[/11:03:44 **** Build of configuration Default for project Test ****
"C:\\Users\\WinUser\\workspace\\Test\\Debug\\make_launcher.bat" all 
C:\cygwin\bin\bash found!
Using erika files in /cygdrive/c/erika/eclipse/plugins/COMEUE~4.N20/ee_files
RM  tc27x.elf
MAKE_DIRECTORIES
Building using ..
CC    ee_tc2Yx_cstart.c
Building using ..
CC    eecfg.c
Building using ..
CC    ee_hal_structs.c
]<snip>
Notice that there are two dots '..' and not one as I would have expected. This may or not be relevant but felt it was worth investigating anyway.

If there is a package list available or a procedure to install Cygwin from afresh then I would be very keen to pursue this so that I would at least be in a more up to date position.

Regards
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: Tricore compilation

Post by paolo.gai »

Hi!

Please update cygwin. The distribution we have on the web site is really old.

Just go on the cygwin website. download the installer (32 bit in this case). just run it, it will update the installed packages.

Ciao,

PJ
Locked