Skip to content

Debug Adaptor Support

danwalmsley edited this page May 23, 2017 · 2 revisions

JLink

Jlink is supported directly simply select the JLink debug adaptor from the projects debug configuration page.

OpenOCD

OpenOCD is supported directly simply select the OpenOCD debug adaptor from the projects debug configuration page.

Generic GDB Server

This allows direct use of almost any GDB Server. AvalonStudio will automatically launch and manage your gdb server. To configure follow these steps:

  1. Select the Remote GDB Debugger from the projects debugger settings.

  2. Set the IP And Port to the address of the debugger, if you leave the IP blank, localhost (127.0.0.1) is used.

  3. Set the Run server command to the command required to launch the gdb server.

  4. Set the Run server command arguments to any arguments needed to be passed when launching the gdb server.

  5. Enter a set of GDB init commands, these commands need to:

    • Halt and Reset the target. (unless attaching)
    • Load code to be debugged. (unless attaching)
    • Prepare target for execution.
    • Leave the target in a paused state.
  6. Use post init command and post init command arguments to launch a tool as soon as the code starts to run. Leaving this blank will do nothing. This is used to if external tool is required to download software onto the target.

  7. On Exit GDB commands These are optional GDB commands that the debugger will send to the GDB Server just before the session exits. Use this to terminate the GDB server. (AvalonStudio will try to kill it anyway, but some debuggers require a cleaner shutdown)

Lauterbach Trace32

This is an a very advanced and specialised debugger. Support is provided via the Remote GDB Debugger.

  1. Select the RemoteGDBDebugger adaptor.
  2. Enter port 30000.
  3. Set GDB Server run command to: C:\T32\bin\windows64\t32start.exe
  4. Set GDB Run Command Arguments to: -RUNCFGFILE ../Debugging/t32StartScript.ts2 -QUIT
  5. Set the GDB Init Commands to match the commands in your debug script file by prepending them with monitor B::

i.e. for Telit UE910 module.

monitor B::SYS.CPU XGOLD626
monitor B::SYS.JTAGCLOCK 10MHz
monitor B::SYS.CpuAccess Denied
monitor B::sys.option.enreset on
monitor B::sys.option.resbreak off
monitor B::sys.config slave off
monitor B::sys.o SYSPWRUPREQ on
monitor B::sys.o PWRDWN off
monitor B::continue
monitor B::sys.o PWROVR on
monitor B::map.BONCHIP 0x00000000--0xFFFFFFFF
monitor B::setup.imaskasm ON
monitor B::setup.imaskhll ON
monitor B::sys.m a
monitor B::break
monitor B::wait !STATE.RUN()
monitor B::data.set E:0xE4900248 %LONG 0xaa
monitor B::data.set E:0xE4300010 %LONG 0x6000
monitor B::data.set E:0xE4900248 %LONG 0
monitor B::per.s C15:0x42F %LONG 0xE0000013
monitor B::data.set 0xE490007C %L 0x0
monitor B::TrOnChip.SET DABORT OFF 
monitor B::TrOnChip.SET PABORT OFF 
monitor B::LIST 
monitor B::REGISTER
monitor B::ENDDO
  1. If you have a program that can load code into your device (i.e. where you cant do this in the script above) You can use the Post Init Command and Post Init command arguments to launch a program loading tool.

  2. Set On Exit GDB Commands to: monitor B::quit