Using openocd with an Infineon Aurix TC3xx cpu.

March 14, 2025 - Reading time: 8 minutes

Using openocd with an Infineon Aurix TC3xx cpu. 3/13/2025 brad@heeltoe.com

Overview

This will allow you to program the flash on an AURIX TC3xx cpu and control it somewhat. It doesn't replace a full blown debugger (like an iSystems bluebox) but it does allow for use cases like automation and will allow you to automate a test stand so you can fully erase the flash, reset the target, program it and run code.

Basics

The basic picture is:

+--------------+                                 +----------------------------------------------+
| TC3xx target | <--DAS--> mini-wigger <--usb--> | linux box; FTDI driver + TAS + aurix-openocd |
+--------------+                                 +----------------------------------------------+

You will need:

Downloads

  • Open an Infineon account so you can download the TAS server https://softwaretools.infineon.com/tools/com.ifx.tb.tool.infineontoolaccesssockettas

  • Download the x86 64-bit FTDI driver https://ftdichip.com/wp-content/uploads/2025/02/libftd2xx-linux-x86_64-1.4.32.tgz

  • download openocd from github git clone https://github.com/lisper/aurix-openocd.git

High level Tasks

Using Ubuntu 22.04:

  • Pull aurix gcc, gdb and openocd from github

  • build and install them all (no small task)

  • download and install infineon "TAS" debug interface

  • download and install FTDI driver

  • build example using aurix gcc

  • debug it with stock "ddd"

Details

I've configured everything so it gets installed in /opt/aurix. My recommendation is to make sure you can create files and subdirs under /opt/aurix. That way you can build and install things as your native user without playing with sudo.

I run everything in a separate window. You could use "tmux" or X windows. I would start the TAS server, openocd and gdb in separate windows so you can see their output.

  • FTDI driver Just unpack the tar file and copy the ".so" shared library to the same subdir as the TAS server.

    The library you want is called "libftd2xx.so". In the tar file it's in the subdir "linux-x86_64/libftd2xx.so"

  • TAS TAS is part of "DAS v8". You should download the file DAS_v8_0_5_Linux.tar.gz from Infineon. Unpack the tar file. Once unpacked in DASv805/TASV110/bin you will find tas_server which is a linux executable. tas_server must be run as root, on the same machine which has the "mini-wigger" connected via USB. The TAS server needs the FTDI shared libary and you need to tell it where to find it using LD_LIBRARY_PATH.

    Blah blah blah.
    
    Run the TAS server like this:
    
        sudo -s
        LD_LIBRARY_PATH=. ./tas_server
    
    It will just sit there and run with no output.
  • OpenOCD Once the TAS server is running, you can run the openocd server on the same machine.

        /opt/aurix/bin/openocd -f board/infineon/kit_a2g_tc375_lite.cfg -s /opt/aurix/share/openocd/scripts
    
    Starting openocd should produce a bunch of output showing it connecting to TAS
    and finding your target.  This is assuming you plugged in a mini-wiggler to USB
    and connected that to a TC3xx target which has power.
  • GDB Aurix gdb gets installed as /opt/aurix/gdb/bin/tricore-elf-gdb. You can run this as a comment and then type:

    target remote :3333

    When you hit return you should see the openocd program spit out some output showiung it's connected.

  • ddd You may have to run ddd one to create a ".ddd" directory in your home dir. Once created, modify the ~/.ddd/init file; otherwise it hangs talking to gdb:

    (remove the line with "not set" and replace it with "(gdb)")

       -set extended-prompt not set\n\
       +set extended-prompt (gdb) \n\
    I use this command:
    
        ddd --debugger /opt/aurix/gdb/bin/tricore-elf-gdb main.elf
    
    which I run in the same directory as my firmware build output.

Building

You'll need to arrange TAS server and it's FTDI library somewhere. And once that's done you'll need to build OpenOCD.

Find a nice home for your github clones, like ~/git . Then clone the repo there.

   mkdir ~/git
   cd ~/git
   git clone https://github.com/lisper/aurix-openocd.git

You can build in the cloned repo, but don't. It's bad hygiene. Instead, create a build subdir and build there. Once the nice things about gnu it's it's "configure" systems which allow one to easily build in a separate directory.

   cd ~/git
   mkdir build
   cd build`

Create a file called "make-aurix-openocd.sh" in the build subdir:

   mkdir -p aurix-openocd
   cd aurix-openocd && ~/git/aurix-openocd/configure --srcdir=/home/brad/git/aurix-openocd --enable-jlink --enable-ftdi --enable-stlink --enable-tas-client  --prefix=/opt/aurix

Run the shell script to configure the build dir

   cd ~/git/build
   chmod +x make-aurix-openocd.sh
   ./make-aurix-openocd.sh

Now build it

   cd aurix-openocd
   make

If the build completes, install it

  `make install`

Now you're ready to connect to the target.

About

"Picks and Pans" technology blog

Categories

    Navigation: