Create or reopen the project myproject
as created in Create a Project. Use the default values and make sure that you:
select Hello World C project in the New C/C++ Project wizard.
enable at least the Debug configuration.
Edit the file myproject.c
as follows:
#include <stdio.h> int main( void ) { int i; for (i=1; i<=3; i++) { printf( "%d\n",i ); } printf( "Hello world, " ); printf( "this is \n" ); printf( "a small %dst\n",i-3 ); printf( "debugging example.\n" ); }
Save the file.
Build your project.
To be able to debug, it is essential that your project has been built properly!
All steps required above are demonstrated in Setting up a Project.
A PCP project is always part of a TriCore project. The TriCore project must have a project reference to the PCP project. In order to debug the PCP project part, you need to disable debug for the TriCore project, because we want to debug the PCP project.
In the active TriCore project, select Project » Properties for » C/C++ Build » Settings.
In the Tool Settings tab, expand the C/C++ Compiler entry and select Debugging.
Set the option Generate symbolic debug information to None .
When you use the simulator, the Debug view will show the TriCore core and the PCP as separate threads. When you select a thread this changes the context in the Disassembly view.
In order to debug an 8051 project, follow the steps below.
Create an 8051 project (for example, myproject
), as explained above.
(Optional) Build the 8051 project. This step is optional because the .out
file is built automatically when the project is referenced and built from a TriCore project. See step 5.
This results in a linked output file (.out
).
Create a TriCore project.
In the TriCore project, make a project reference to the 8051 project.
Build the TriCore project.
This builds the referenced 8051 project and creates the .out
file in the Debug directory of the 8051 project. Furthermore this creates a TriCore ELF file and an 8051 ELF file in the Debug directory of the TriCore project.
Make the 8051 project the active project.
Create a debug configuration for the 8051 project, as explained in Create a Debug Configuration.
Start the debugger, as explained in Start a Debug Session.
Copyright © 2019 TASKING BV.