STM MPC simulator

Parent Previous Next

Environment Requirements


winIDEA 2012 must be installed on the PC.

A full winIDEA install is available for download on the iSYSTEM web page:

The minimum required version of winIDEA is 9.12.17.

The iSYSTEM GDB Client adapter (HGDB.dll) is at this time not a part of winIDEA installation. It is delivered separately and must be copied manually into the winIDEA installation directory.

STM Simulator

The simulator should be installed per STM instructions.

config.xml file adjustments

This TCP/IP port entry in the config.xml should be set to value above 1024:

<st_config:parameter st_config:name="dbg_port" st_config:prompt="TCP/IP port to communicate with debugger (must be greater than 1023, 0 means no debugger)">2012</st_config:parameter>

In this example a value of 2012 is set (if you have more configurations in config.xml, only one should have port set above 1024 and others set to 0).

Select your download file in config.xml:

<st_config:parameter st_config:name="esw_files" st_config:prompt="eSW to be loaded">T:\Test\sample.elf</st_config:parameter>

Setting up winIDEA workspace

A one-time configuration of a winIDEA workspace is required.

Using an existing workspace

Note: an example workspace with a demo application is provided. It is recommended that for first use and for future reference this workspace is used.

Start winIDEA

Open the example workspace, using File/Workspace/Open Workspace and browse to the folder where the example was copied. Open the Diab56xx_STM.xjrf file.

Select GDB/Options…

Configure the GDB Server TCP port and GDB Server executable path.

Confirm with the OK button and save workspace via File/Workspace/Save Workspace.

When winIDEA opens the next time, the last workspace is loaded automatically.

Creating a new workspace

A new workspace is best created from an existing workspace, simply by copying it to a different folder and then changing only a few specific settings in winIDEA.

To create a new workspace from scratch:

Start winIDEA

Create a new workspace, using File/Workspace/New Workspace. Specify the name and the location where you wish to create the workspace file.

If a wizard starts, dismiss it.

In Tools/ Plug-in select iSYSTEM GDB Client

Select GDB/Options…

Configure all options accordingly. For example:

In Debug/Files for download configure the application download file(s), with the New button:

winIDEA can determine PPC/VLE mode from an Elf file. If code-only file will be loaded, specify VLE regions in Debug/Files for download/VLE (in this example entire memory space is considered VLE):

Confirm with the OK button and save workspace via File/Workspace/Save Workspace.

When winIDEA opens the next time, the last workspace is loaded automatically.

Working with winIDEA

Refer to winIDEA manual for detailed information on specific features. This section lists only vital steps briefly:

Loading the Application

Before the download you have to run tlmdevice_server_gui.bat  to be able to connect to the simulator. Once Tlmdevice server is running, select Debug/Download, or click the Download toolbar button. This command will (if so configured) launch the simulator and connect to it.

For ease of use these After download actions can be configured in Debug/Files for download/Options:

This will preset program counter to Elf’s program entry point and then run the simulation until function main is entered.

Inspecting application state

Select windows of interest from the View menu, most notably:

Disassembly – to view and debug on object level

Memory – to inspect memory contents

Special function register – to inspect SoC peripherals

Watches – to inspect high level symbolic objects

Variables – to inspect current function’s local variables and the call frame.

Application run control

Use Debug menu, toolbar buttons or keyboard shortcuts to:

Set execution breakpoints (F9)

Execute single instruction or source step (F11)

Execute step-over on object or source level (F10)

Run until an instruction or source code position (Ctrl+F10)