56
The Free TriCore Entry Toolchain And migrating Infineon SW Framework demo projects Copyright (C) 2017 HighTec EDV-Systeme, GmbH Version 1.0, September 2017

The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Embed Size (px)

Citation preview

Page 1: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

The Free TriCore Entry ToolchainAnd migrating Infineon SW Framework demo projects

Copyright (C) 2017 HighTec EDV-Systeme, GmbHVersion 1.0, September 2017

Page 2: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Table of ContentsGLOSSARY ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  2

1. Abbreviations ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  3

2. Terms ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  4

MIGRATION GUIDE ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  5

3. Introduction ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  6

4. Prerequisites∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  7

5. Creating a fictive framework demo project∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  8

5.1. Merge software components ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  8

5.2. Tweak project settings ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  13

5.3. Integrate simulated IO ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  15

5.4. Build and debug ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  16

6. Creating a makefile project ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  22

7. Migrating the makefile project to HighTec ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  26

7.1. Copying the codebase ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  26

7.2. Mapping the makefile rules ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  34

7.3. Build and compare ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  45

8. Conclusion ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  51

APPENDIXES ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  52

Appendix A: Bibliography ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  53

Appendix B: Document history ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙  54

Page 3: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

AbstractThis application note demonstrates how to migrate Infineon Software Framework projects to theFree TriCore Entry Toolchain. The end result is a HighTec project equivalent that can be furthertweaked through its compiler, assembler and linker project settings. In a subsequent stage youcan consider scaling up the migration by replacing the iLLD startup code with that of HighTec, butthat falls outside the scope of this application note.

About the authorHenk-Piet Glas (Principal Technical Specialist) received his Beng in Information Technology fromNHL college, Leeuwarden. With 20 years of experience he has worked in both the embedded anddata warehousing industry, before joining HighTec early 2017. His activities include dedicatedFAE support, on-site FAE training, developing application notes, hosting webinars and makingcontributions to the Infineon TriCore forum. He enjoys the creativity of independent coursework.His explorations include screenwriting, video editing, creative documentary, and writing shortstories and columns. For a while he aspired theatre making and briefly toured the UK with anunconventional British theatre company called Ridiculusmus.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   1

Page 4: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Glossary

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   2

Page 5: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

1. AbbreviationsIFX

Infineon

SFRSpecial Function Register

IOInput/Output

APIApplication Programming Interface

IFXSWFInfineon Software Framework

IDEIntegrated Development Environment

BSPBoard Support Package

iLLDInfineon Low Level Driver

DASDevice Access Server

UDEUniversal Debug Engine

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   3

Page 6: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

2. TermsHighTec

HighTec is a privately owned company since establishment in 1982 and the world’s largestcommercial open source compiler vendor.

InfineonLeading innovator in the international semiconductor industry. Infineon design, develop,manufacture and market a broad range of semiconductors and complete system solutions forselected industries.

PLSOne of the world’s leading manufacturers of development tools for 16-bit and 32-bitmicrocontroller families.

Free TriCore Entry ToolchainRestricted version of the TriCore Development Platform, containing a predefined selection ofAURIX derivatives. Following a 1 year duration its license automatically expires.

Infineon Software FrameworkAn application development environment that provides a unified platform for AURIX softwaredevelopment and upcoming microcontrollers. Target users include application engineers andcustomers who use the application examples or demo software drivers for prototyping within theautomotive domain.

Infineon Low Level DriverDeveloped by Infineon, its aim is to provide access and configuration functions for the integratedperipherals of Infineon Microcontrollers. Together with SFR header files they are a fundamentalpart of the infrastructure for tests and applications which are developed by several IFX teams.

MyInfineonAn online information portal hosted by Infineon that provides access to additional content,services, and customized information. Users must register to make use of this service.

AURIX™The next generation of Infineon’s TriCore™ 32-bit microcontroller architecture, featuring amulticore implementation. AURIX™ combines easy-to-use functional safety support, a strongincrease in performance and a future-proven security solution in a highly scalable product family.

Device Access ServerAn abstraction layer between any third party debugger and the target system, developed byInfineon. It includes several debug utilities that can be very useful when dealing with third partydebugger connection issues.

Universal Debug EngineDebugging solution by PLS featuring debug support for a wide range of 16-bit and 32-bitmicrocontrollers including AURIX.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   4

Page 7: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Migration Guide

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   5

Page 8: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

3. IntroductionThe Infineon Software Framework (IFXSWF) was developed with the intent of allowing applicationengineers and customers to develop application notes and demonstration software. By providingfeatures such as automatic makefile generation, compiler abstraction, utility integration, and a uniformstructure for projects, demo software development becomes less laborious with zero change to sourcecode when switching between compilers.

Having decided which toolchain suits your needs best, you will be up for the next challenge. Duringcompiler benchmarking the Infineon Software Framework served as a flexible sandbox. But setting outto develop application code you need to backup for a moment and consider your predicament. On theone hand you have some useful demonstration software that can serve as a steppingstone for yourown project. Yet on the other hand you feel the omission of a powerful IDE that allows you to easilyedit your codebase and tweak project settings through an intuitive GUI. As you’re reading this, we maysafely assume that you’d like that to be HighTec’s Free TriCore Entry Toolchain.

Making the transition is not so easy. Monsters are lurking and your road is set with traps. The learningcurve of a new toolset is challenging enough as it is and you’d like to avoid anything that prolongs it.What you need is a recipe that explains how to migrate your content and settings, stripping awayIFXSWF dependencies that no longer apply (utilities) but maintaining those that do (iLLD). Moreover,you want to be able to do this in an efficient and controllable way. In this application note we will dojust that.

We begin our journey by creating a fictive framework demo project, something you might actuallywant to migrate in real life. Using this framework demo we create a so-called makefile project. Amakefile project is not the same as a HighTec project. The key difference is that you build an externalmakefile rather than one that’s being generated from project settings. It extends the Infineon SoftwareFramework with a versatile editor but, other than that, nothing else. We will use it to create arepository of both existing and generated files to be used during the actual migration. This is a choice,not a necessity. Consider it a best practice at most.

Next we’ll create a HighTec project side-along the makefile project. We then migrate the project sourcecode and iLLD. Using the external makefile from our repository we will map all of its rules to matchingglobal project settings. We’ll mildly adapt the project folder structure and include the linker descriptionfile from the makefile project. The migration completes with a rudimentary comparison of the map fileand runtime results to those collected when we created the framework demo project. We estimate thatthis exercise takes between 1 and 2 hours to complete. This can be reduced to less than 20 minutes asyou become more practiced.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   6

Page 9: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

4. PrerequisitesThis exercise was executed on a 4G x64 Windows 10 Virtual Machine, running on a macOS host. Yourequire the following software components to reproduce its results:

Component Version Availability

Free TriCore Entry Toolchain v4.9.1.0 Free Entry Form

Infineon Software Framework v3.1r0_p1 MyInfineon Portal

AURIX iLLD Package v1.0.0.11.0 MyInfineon Portal

AURIX iLLD Demos v1.0.0.11.0 MyInfineon Portal

For runtime testing we used Application Kit TC277 TFT, fitted with TC277 D-step. Although thisdoesn’t restrict you from using something else, it is expected that in that case you will need to makesome adjustments as you go along. The Free TriCore Entry Toolchain includes UDE Starterkit 4.8,developed by PLS. We used both its client and its Eclipse UDE perspective to debug our target. Someadditional prerequisites apply when using the client. These are explained in chapter Build and debug.You also require a micro-USB cable to connect to the onboard wiggler.

Using the onboard wiggler is an imposed restriction of UDE Starterkit 4.8. External wigglers onlywork for the professional version of the Universal Debug Engine.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   7

Page 10: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

5. Creating a fictive framework demo projectAs a starting point for this application note we need a fictive framework demo project. As itsfunctionality is not of importance we’ll use a randomly chosen demo of the AURIX ILLD Demos archive.Preparing the framework demo project consists of four steps. First the framework demo must bepieced together from three individual Infineon software components. Next simulated IO support isadded to allow the PLS UDE to redirect printf statements to its integrated terminal. Then some tweaksmust be made to its config to allow it to build with v4.9.1.0 of the Free TriCore Entry Toolchain. Andfinally its functional behavior is briefly tested using UDE Starterkit 4.8. The next four chapters explainthese steps in detail.

5.1. Merge software componentsFor the fictive framework demo project three Infineon software components need to be merged intoone. These are:

1. AURIX iLLD CPU Synchronisation Demo

2. AURIX iLLD Base Framework template for TC277 Step-D (v1.0.0.11.0)

3. AURIX iLLD drivers for TC277 Step-D (v1.0.0.11.0)

These three can be obtained from the packages listed in chapter Prerequisites. During installation theInfineon Software Framework created several base framework templates. You need to copy the onethat is appropriate to your AURIX derivative and stepping. The same applies to the iLLD driver. Figure1 shows all three software components collected into one single work folder.

Figure 1. The CPU Synchronisation Demo, The Base Framework template and the iLLD driver

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   8

Page 11: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

As a first step drill down into BaseFramework_TC27xD to inspect the content of the template.

Figure 2. Contents of BaseFramework_TC27xD template

Since the 0_Src folder contains some default template application content, you may remove it. Nextgoto the CPUSynchronizationDemo folder and cut its entire contents.

Figure 3. Cut CPUSynchronizationDemo content

Return to the root of the BaseFramework_TC27xD folder and paste the (cut) contents into here. This

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   9

Page 12: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

installs the demo application code and its documentation.

Figure 4. Paste CPUSynchronizationDemo content into BaseFramework_TC27xD

Return to the work folder root and drill down into the ifx folder. Figure 5 lists its contents.

Figure 5. Subfolder content of the iLLD driver

Rename these to the folder names listed in Figure 6, to comply to the Infineon Software Frameworknaming convention.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   10

Page 13: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 6. Rename to match IFXSWF naming convention

Now cut its contents.

Figure 7. Cut renamed iLLD subfolders

And paste it into the folder 0_Src of the framework template.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   11

Page 14: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 8. Paste renamed iLLD subfolders into 0_Src

As a final step rename the framework demo to FrameworkDemo. This is not a must, but using a genericname seems fitting knowing that we could have selected any of the available iLLD demos.

Figure 9. Use a generic name for the framework demo project

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   12

Page 15: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

5.2. Tweak project settingsInfineon developed its base framework projects using v4.6.5.0 of the Free TriCore Entry Toolchain.Since we’ll be using v4.9.1.0 instead, some minor adjustments must be made toCfgCompiler_Gnuc.mk. This configuration file is stored in 1_ToolEnv\0_Build\1_Config relative tothe FrameworkDemo root. Start by loading it into your preferred editor.

Figure 10. Edit CfgCompiler_Gnuc.mk

Next adjust TOOLCHAIN_DIR_MAIN to point to the current toolchain, as demonstrated in Figure 11.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   13

Page 16: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 11. Adjust TOOLCHAIN_DIR_MAIN

And conclude by replacing -Wl,--mcpu=aurix with -Wl,--mcpu=tc161 in variable LD_OPTIONS_MAIN.Beginning v4.9.0.0 some of the core names for --mcpu=[core] have been altered to reflect thearchitecture instruction set version rather than its trademark name. Therefore aurix may no longer beused and, for now, will trigger a linker warning if you do. Future releases will cease to support old stylenames altogether, and report an error message instead. Save your tweaks before moving on to thenext step.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   14

Page 17: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 12. Configure LD_OPTIONS_MAIN to use device tc161

5.3. Integrate simulated IOFor debugging we’ll use UDE Starterkit 4.8. It incorporates a terminal window that can be used forsimulated IO. This allows C library functions like printf and scanf to interact with the user withoutthe need to first implement a communication channel. In order for this to work low level functions readand write must be overloaded to make use of the PLS API. The Free TriCore Entry Toolchain includessource code for this by means of simio_pls_tc.c and simio_pls.h, which can be found in the BSPfolder. Simply add them to your project as demonstrated in Figure 13.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   15

Page 18: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 13. Add simulated IO by means of simio_pls_tc.c and simio_pls.h

5.4. Build and debugLet’s build our fictive framework demo project.

1. Navigate to IFXSWF installation folder

2. Double-click StartFwDos batch file

3. Change directory to FrameworkDemo

4. Enter make

Figure 14 shows the resulting output.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   16

Page 19: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 14. Build the Framework Demo project

The build will produce an output file called FrameworkDemo_Tricore.elf. Use UDE Starterkit 4.8 toflash it onto the target:

1. Connect the micro-USB cable to the onboard wiggler

2. Start Windows explorer

3. Change directory to C:\Program Files (x86)\PLS\UDE Starterkit 4.8

4. Double-click UDEVisualPlatform

The last step will launch UDE Starterkit 4.8.

If UDE Starterkit 4.8 does not start then make sure to test its prerequisites. For this, launch acommand prompt and change directory to the Prereq folder within the UDE Starterkit 4.8installation folder. From here run UdePrereqCheck and validate if all prerequisites are in place. Ifnot, make sure to install them by running the appropriate installers within that same folder.Neither of the installers will however install the Microsoft .net Framework 3.5, because it needs tobe enabled rather than installed. This article explains how to do that.

Now create a new workspace by following these steps:

1. Select File → New Workspace

2. Choose an appropriate workspace name

3. Press Default

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   17

Page 20: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

4. Tick Use a default target configuration

5. Drill down to TriCore → Infineon → TC277D Application Kit

6. Select Application Kit with TC277 D-Step (Multicore Configuration)

7. Press Finish

8. Press Save

9. Press OK

Care must be taken selecting your default target configuration. Even small mistakes such asselecting the wrong stepping can result in connection errors. For Application Kit TC277 TFTneither the board nor the packaging mentions the exact stepping. Only solution to thispredicament is to first use Infineon’s simple DAS debug client and inspect the CHIPID SFR.

As soon as the new workspace is saved UDE Starterkit 4.8 will automatically try to establish aconnection with Application Kit TC277 TFT. On success you should see the following:

Figure 15. An example of a successful connection

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   18

Page 21: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

In case your application kit appears bricked

Some application kits - Application Kit TC277 TFT included - are fitted with the TLF35584 multi-voltage regulator. This device contains a watchdog that will shutdown all power if it is not fed in atimely manner. To the naked eye the application kit will briefly come alive and then completelyshutdown as if it were bricked. Suffice to say debuggers at that point will fail to connect.Infineon’s AP32260 Application Note carefully details how to revive boards that have beeneffected. One of those utilizes the SPI interface to restore operation. This workaround is actuallyintegrated into the selected target kit configuration for Application Kit TC277 TFT, by using aseries of debugger initialization commands. While the HighTec BSP supports feeding thewatchdog, the iLLD Demos (currently) do not, which means you are likely to run into connectionerrors. When that happens make sure to tick the Periodically Retry every checkbox and set it to afew seconds. You’ll then have to apply some of your best gaming skills by timely pressing thereset button, just before the retry commences. It may take a few attempts, but eventually theaforementioned debugger initialization commands will hit home and restore the connection.

Proceed to enable the simulated IO terminal via Views → Simulated I/O Terminal. Figure 16 picturesthe resulting terminal window in the lower right corner of UDE Starterkit 4.8.

Figure 16. View of UDE Starterkit 4.8 after enabling simulated I/O terminal

Proceed using the following steps:

1. Select File → Load Program

2. Browse to FrameworkDemo_Tricore.elf

3. Press Open

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   19

Page 22: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

4. Press OK

5. Press Program All

6. Press Exit

7. Press Exit

Open module cpusyncdemo.c and set identical breakpoints as depicted in Figure 17.

Figure 17. Setting some crucial breakpoints that validate functional behaviour

Run Debug → Start Program Execution twice in succession. This produces the output shown inFigure 18. Obviously we’ll have to reproduce these results once the framework demo project has beenmigrated to HighTec.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   20

Page 23: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 18. Inspect terminal window for runtime results

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   21

Page 24: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

6. Creating a makefile projectThe primary purpose of creating a makefile project prior to creating a HighTec project is to provide anaccessible repository of source files, configuration files and generated files. It is not required, however itmakes life easy. Rather than switching back and forth between your OS and your HighTec project youcan quickly navigate between your repository and HighTec project within the comforts of a singleworkspace. Copying files, reviewing files, comparing files, it will all be easier to do. To create a makefileproject use the following steps:

1. Select File → New → Project…

2. Select C/C++ → Makefile project with Existing Code and press Next

3. Select Browse

4. Navigate to the root of your framework demo and press OK

5. Press Finish

Figure 19 shows the resulting makefile project.

Figure 19. Makefile project based on framework demo project

You have arrived at an important junction. You can either choose to skip to chapter Migrating themakefile project to HighTec or you can actually build the makefile project. Moving on to the nextchapter is perfectly valid because the repository is all you need at this point. Actually building it is not anecessity, nor is it at this point possible. It’s not a necessity because you’d essentially be rebuilding theframework demo project of chapter Build and debug. And it’s not possible since the Free TriCore EntryToolchain requires the Infineon Software Framework utilities to be able to do so. You need to explicitlyadd those to its environment first.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   22

Page 25: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Think about this for a moment before making your choice. Crucial in making your decision iswhether you intend to do some intermediate development using the makefile project, beforecontinuing with the actual migration. Either way you choose, we’ll now explain how to add theInfineon Software Framework utilities.

First exit the Free TriCore Entry Toolchain. Next clone the StarFwDos batch file in the IFXSWFinstallation folder and rename it to, for example, StartFwEclipse. Now make a small edit to theMAKECMD_WITH_APP environment variable within that batch. When using the Infineon SoftwareFramework in command line mode (StartFwDos) it is set to a string called "SF Framework Tools" so asto provide a suitable caption to the command shell. But you must now change it to the location of yourHighTec Eclipse IDE as shown in Figure 20.

Figure 20. Assure that HighTec IDE knows where to find the IFXSWF utilities

Note that prior to calling the HighTec IDE the PATH environment variable is prepended with the locationof the Infineon Software Framework utilities. This is key in being able to build the makefile project.Having created the StartFwEclipse wrapper you can proceed to save it and double-click it. This willrelaunch the Free TriCore Entry Toolchain like your used to. First try cleaning the makefile project byright-clicking its name within the HighTec Project Explorer and selecting Clean Project.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   23

Page 26: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 21. Clean the makefile framework demo project

Next try building it using Build Project instead. If the utilities were properly added, it should result ina successful build. The console should list identical output as when building the framework demoproject from the command line.

Figure 22. Building the makefile project

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   24

Page 27: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

From now on you do not need the StartFwEclipse wrapper every time you start the FreeTriCore Entry Toolchain. It was of a temporary nature to support building the makefile project andis no longer required during or after chapter Migrating the makefile project to HighTec.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   25

Page 28: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

7. Migrating the makefile project to HighTecWe now start with the actual migration exercise. First thing we’ll need to be doing is to create a newHighTec project and copy the codebase from our makefile project repository. We also need toconfigure some initial project settings such as the include file search list. Next we will migrate thecompiler, assembler and linker makefile rules of the makefile project. The final step is to build and verifythe resulting HighTec project. We’ll do this by means of a rudimentary comparison to the makefilecreated during Build and debug and the simulated IO results in that same chapter.

7.1. Copying the codebaseFirst create a HighTec Project using the following steps:

1. Select File → New → HighTec Project

2. For Project name enter MigratedSWD and press Next

3. Select AppKit-TC277TFT from the hardware selection tree

4. Tick the Create empty project checkbox and press Finish

You now have an empty HighTec project that needs to be populated and configured. Its defaultconfiguration name is called iRAM. Yet if you skim linker description file Lcf_Gnuc.lsl (stored in1_ToolEnv\0_Build\1_Config relative to the FrameworkDemo root) it follows that all code sectionsare located in a flash memory called pfls0. Since it’s more logical to use a configuration name thatresembles the locating target, let’s see if we can change the default configuration to pfls0 instead.

1. Select Project → Properties

2. Navigate to C/C++ Build → Settings

3. Press Manage Configurations… button in top-right corner

This will pull up the Manage Configurations dialog shown in Figure 23.

Figure 23. The default set of configurations

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   26

Page 29: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Proceed to delete all configurations so that only iRAM remains. Then click the Rename… button andenter pfls0 as its new name. Press OK to confirm. Figure 24 shows that pfls0 is now the activeconfiguration.

Note that renaming is just one solution. What works equally well is that you create a newconfiguration name called pfls0, and change its status to Active. Either way you choose, thisstep is optional above all. It’s not the configuration name that decides where the application islocated. It’s the associated linker description file that does.

Figure 24. Changing the active configuration from iRAM to pfls0

Within the FrameworkDemo repository navigate to FrameworkDemo → 0_Src and copy folders0_AppSw, 1_SrvSw and 4_McHal.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   27

Page 30: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 25. Copy contents from 0_Src folder

Paste these folders to the src folder of your HighTec project.

Figure 26. Paste contents to HighTec src folder

Create a new folder.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   28

Page 31: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 27. Create new folder

And call it ld. As its abbreviation implies, this folder will be used to contain your linker description file.

Figure 28. Empty ld folder has been added to MigratedSDW project

Within the HighTec Project Explorer navigate to FrameworkDemo → 1_ToolEnv → 0_Build →

1_Config and copy module Lcf_Gnuc.lsl.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   29

Page 32: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 29. Copy the linker description file from FrameworkDemo repository

Then paste it into the newly created ld folder.

Figure 30. Populating ld folder with copy of linker description file

Copy cIncludePathList.opt from FrameworkDemo → 1_ToolEnv → 0_Build → 9_Make and pasteit to MigratedSDW → src.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   30

Page 33: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

If you do not see cIncludePathList.opt it means that you probably skipped the build detailed inchapter Build and debug during which the Infineon Software Framework automatically generatesthis file based on the framework demo folder structure.

Figure 31. cIncludePathList.opt copied into HighTec src folder

Double-click cIncludePathList.opt. This will open up an include file search list as seen in Figure 32.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   31

Page 34: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 32. Contents of cIncludePathList.opt contains generated include file search list

The paths listed have been generated relatively to the project root of the framework demo project,where its makefile resides. For the HighTec project the makefile will be generated and stored in a folderwho’s name is derived from the project configuration, in this case therefore pfls0. This means therelative paths are out of phase and must be realigned. The way to do this is by replacing all instancesof ./0_Src with ../src as demonstrated in Figure 33. Save your edits.

Figure 33. Realign include file search list

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   32

Page 35: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Include file search paths can also be added via Project → Properties and navigating to C/C++Build → Settings → TriCore C Compiler → General. However since you can only do that one-by-one and because the list is quite long, it is in this case more efficient to piggyback on generatedcontent from the Infineon Software Framework.

Next goto Project → Properties and navigate to C/C++ Build → Settings → TriCore C Compiler →

General. Enter "../src/cIncludePathList.opt" in the Option file (@<file>) editbox.

Figure 34. Add include file search list command line option file

One final step before we close this chapter. Select Project → Properties and navigate to C/C++ Build→ Settings → TriCore Linker → General. Enter "../ld/Lcf_Gnuc.lsl" in the Browse Linker DescriptionFile (-T) editbox.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   33

Page 36: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 35. Set the linker description file path

7.2. Mapping the makefile rulesMapping makefile rules is a step-by-step process of translating individual framework demo commandline options to their equivalent HighTec project settings. For this we return to moduleCfgCompiler_Gnuc.mk that we briefly introduced in chapter Tweak project settings. Note that itcontains several variables.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   34

Page 37: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 36. Makefile rules listed in CfgCompiler_Gnuc.mk

The ones that we’re interested in are CC_OPTIONS_MAIN, ASM_OPTIONS_MAIN and LD_OPTIONS_MAIN.For these we’ll need to map each individual option to its equivalent setting within the HighTec projectoptions. Although this is a relatively tedious process, it is however key to the migration. Let’s breakthem down one-by-one and start with -DGNU, the first option in CC_OPTIONS_MAIN. To map it, do thefollowing:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Symbols

3. Add GNU to the Defined Symbols (-D) block

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   35

Page 38: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 37. Mapped -DGNU equivalent

The next command line option -msmall-const=8 is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Addressing

3. Set the Selection dropdown box to Register Relative (Small)

4. Enable Boundary value of constants for relative addressing (-msmall-const=) editbox

5. Enter 8

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   36

Page 39: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 38. Mapped -msmall-const=8 equivalent

Command line option -Wall is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Warnings

3. Untick all checkboxes

4. Tick All Warnings (-Wall) checkbox

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   37

Page 40: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 39. Mapped -Wall equivalent

Command line option -g is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Debugging

3. From the Debug Level dropdown box select Default (-g)

Figure 40. Mapped -g equivalent

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   38

Page 41: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Command line option -O2 is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Optimization

3. From the Optimization Level dropdown box select Speed

Figure 41. Mapped -O2 equivalent

Command line option -fno-common is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → General

3. Tick Issue an error if same variable is declared twice (-fno-common) checkbox

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   39

Page 42: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 42. Mapped -fno-common equivalent

Command line option -fno-short-enums is mapped as follows:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → General

3. Tick Do not allocate to an enum type only as as many bytes as it needs (-fno-short-enums)checkbox

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   40

Page 43: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 43. Mapped -fno-short-enums equivalent

Command line option -mtc161 is next in line. There is no need to map this option as it is automaticallyinherited from the CPU type that we selected when we created our project in chapter Copying thecodebase. To review the current CPU type goto Project → Properties and select C/C++ Build →

Settings → Global Options.

Figure 44. TriCore architecture 1.6.1 (-mtc161) inherited from CPU type

Options -fsingle-precision-constant and -fstrict-volatile-bitfields have no equivalent

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   41

Page 44: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

HighTec project setting and need to be added as miscellaneous options:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler → Miscellaneous

3. Add -fsingle-precision-constant

4. Add -fstrict-volatile-bitfields

Figure 45. Miscellaneous (non-mapped) command line options

The last compiler command line option to be mapped is -c and tells the steering program (tricore-gcc) to only compile and assemble the input modules. Since HighTec projects generate compilermakefile rules using -c as well, there is not need to map it. To confirm that is so, use:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Compiler

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   42

Page 45: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 46. HighTec compiler makefile rules use -c as well

Next in line are the assembler command line options listed in variable ASM_OPTIONS_MAIN.

Figure 47. Variable ASM_OPTIONS_MAIN equals CC_OPTIONS_MAIN

Note that these are the same as those of CC_OPTIONS_MAIN. Obviously most of these options arededicated to the compiler. For assembly modules, the steering program will only redirect/translate alimited subset of these to the assembler. It is for this reason that there is no need to map any of theseoptions to equivalent assembler project settings. The default assembler project settings will suffice.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   43

Page 46: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

As a test we used the steering program to assemble a file using the command line options listedin CC_OPTIONS_MAIN and inspected stdout with --verbose. With the exception of -mtc161 allwere dropped and only compiler command line option -g was translated to assembler commandline -gdwarf.

The linker command line options are assigned to variable LD_OPTIONS_MAIN starting with -Wl,--mcpu=tc161. For the same reason as mentioned for compiler command line option -mtc161 there isno need to map it. We can therefore quickly move on to -Wl,--gc-sections which is mapped using:

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Linker → Optimization

3. Tick Remove unreferenced sections (-Wl,--gc-sections) checkbox

Figure 48. Mapped -Wl,--gc-sections equivalent

The last option that needs mapping is -nostartfiles.

1. Select Project → Properties

2. Select C/C++ Build → Settings → TriCore C Linker → General

3. Tick Skip standard system startup files when linking (-nostartfiles) checkbox

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   44

Page 47: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 49. Mapped -nostartfiles equivalent

The implications of dropping system startup files

Be aware of the implications of dropping system startup files. While iLLD will replace the HighTecstartup code and copy table code, it does not implement logic to process functions declared with__attribute__((constructor)). These will therefore not be called prior to the main entry point.For the same reason globally declared C++ constructors and destructors will also not work.

7.3. Build and compareIn chapter Merge software components we merged the entire contents of iLLD into the frameworkdemo. However since - in this case - we’ll not be needing most of its peripheral drivers we can speedup overall build time by disabling those. You can then simply reenable them if the situation requires so.Use the following steps:

1. Goto the HighTec Project Explorer

2. Expand MigratedSWD → src → 4_McHal

3. Select all folders except these: _Build, _Impl, _Lib, _Pinmap, _Reg, _Asclin, Ccu6, Cif, Cpu, Scu

4. RMC and select Resource Configurations → Exclude from Build…

5. Tick pfls0 and press OK

The folders that have been inactivated will be greyed and branded as observed in Figure 50.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   45

Page 48: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Inactivating a subset of iLLD folders is optional. Whether you do this or not doesn’t make adifference in terms of the application footprint because of having mapped option --gc-sectionsin chapter Mapping the makefile rules.

Figure 50. Inactivate non-used peripherals

Proceed to build the project using Project → Build Project. Figure 51 shows the result.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   46

Page 49: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 51. Successful build after migration

Following the build, a folder pfls0 has been created in the root of project MigratedSDW. Amongstothers it contains the project map file and the application elf file. A successful build alone is noguarantee that the application will work as designed. We need some reassurance that, to all intendsand purposes, we did things right. Before looking at the runtime results let’s first do a rudimentarycomparison of the framework demo project map file to our HighTec project map file.

1. Goto the HighTec Project Explorer

2. Double-click FrameworkDemo → 2_Out → Gnuc → 0_Src → FrameworkDemo_TriCore.map

3. Search for Memory Configuration block

4. Remove all rows with Used column set to 0x00000000

5. Double-click MigratedSDW → pflsh0 → MigratedSWD.map

6. Search for Memory Configuration block

7. Remove all rows with Used column set to 0x00000000

8. Rearrange both map files to horizontal side-by-side view

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   47

Page 50: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 52. Rudimentary comparison of retouched mapfiles

Note that in the framework demo project memory pfls0 consumes 0x001f7268 bytes of memory,starting from 0x80000000. The consumption for the migrated project appears identical. While this isnot a binary comparison it is promising nonetheless. Let’s proceed to take a look at the runtime results.This time we’ll use the UDE perspective.

1. Goto the HighTec Project Explorer

2. RMB MigratedSWD

3. select Debug As → Debug Configurations…

4. Click Universal Debug Engine icon

5. Click New launch configuration button

The Universal Debug Engine icon will spawn a child that inherits its name from our project. On therighthand side four tabs will appear called Main, UDE Startup, Source and Common.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   48

Page 51: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 53. New UDE debug configuration

Proceed as follows:

1. Click UDE Statup tab

2. Click Create Configuration button

3. Tick Use a default target configuration radiobutton

4. Drill down to Application Kit with TC277 D-Step (Multicore Configuration)

5. Press Finish

6. Choose location and press Save

7. Press OK

8. Press Debug

The UDE perspective will now be launched and the debugger will try to connect to the target. Onsuccess you may proceed to flash the application as you did when using the UDE Starterkit 4.8 client.Proceed to open a simulated IO terminal as demonstrated in Figure 54.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   49

Page 52: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Figure 54. Enable simulated IO terminal within UDE perspective

Proceed to set identical breakpoints as those that we used in chapter Build and debug and run Debug→ Start Program Execution twice in succession. This should produce identical output as before.

Figure 55. Runtime simulated IO results

There you have it. Our original framework demo project has been successfully migrated to anequivalent HighTec project!

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   50

Page 53: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

8. ConclusionIn this application note we showed how to migrate Infineon Software Framework demonstrationsoftware to the Free TriCore Entry Toolchain, developed by HighTec. We showed how to do this withthe least amount of effort. One of the biggest advantages, we found, was to create an intermediatemakefile project. Its purpose seems futile at first. But, like with so many things that appear futile, itstrue power only becomes apparent near to the end. It allowed us to quickly navigate between sourceand target within the HighTec project explorer, copy source and configuration files, and quicklycompare map files, without switching back and forth between the OS folder structure. While thisapplication note by no means reflects all possible paths that might unfold during a mainstreammigration, we hope nonetheless that it may serve as a stronghold when such a circumstance presentsitself.

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   51

Page 54: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Appendixes

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   52

Page 55: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Appendix A: Bibliography▪ [1] Highly integrated and performance optimized 32-bit microcontrollers for automotive and

industrial applications, Brochure, ©Infineon Technologies AG, 2017

▪ [2] AURIX™ Microcontroller Software Development, User Manual Software Framework Tools,©Infineon Technologies AG, 2015

▪ [3] TLF35584 (B-Step) regulator integration with TC2xx devices, Application Note AP32260,©Infineon Technologies AG, 2015

▪ [4] HighTec Partners, http://www.hightec-rt.com/en/company/partners.html

▪ [5] About HighTec, http://www.hightec-rt.com/en/company/about-us.html

▪ [6] PLS Universal Debug Engine, https://www.pls-mc.com/ude

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   53

Page 56: The Free TriCore Entry Toolchainfree-entry-toolchain.hightec-rt.com/...Free_TriCore_Entry_Toolchain... · Mapping the makefile rules ... on-site FAE training, ... GmbH The Free TriCore

Appendix B: Document historyVersion Date Changes to the previous version

1.0 October 2017 Initial Release

Copyright © 2017 HighTec EDV-Systeme, GmbH The Free TriCore Entry Toolchain - And migrating Infineon SW Framework demo projects   |   54