Albatron Technology ARM11/Cortex-A8 Debugging with GDB, Target setup, Connecting to the target

Page 40

bdiGDB for GNU Debugger, BDI2000 (ARM11/Cortex-A8)

User Manual 40

3.3 Debugging with GDB

Because the target agent runs within BDI, no debug support has to be linked to your application. There is also no need for any BDI specific changes in the application sources.Your application must be fully linked because no dynamic loading is supported.

3.3.1 Target setup

Target initialization may be done at two places. First with the BDI configuration file, second within the application. The setup in the configuration file must at least enable access to the target memory where the application will be loaded. Disable the watchdog and setting the CPU clock rate should also be done with the BDI configuration file. Application specific initializations like setting the timer rate are best located in the application startup sequence.

3.3.2 Connecting to the target

As soon as the target comes out of reset, BDI initializes it and loads your application code. If RUN is selected, the application is immediately started, otherwise only the target PC is set. BDI now waits for GDB request from the debugger running on the host.

After starting the debugger, it must be connected to the remote target. This can be done with the fol- lowing command at the GDB prompt:

(gdb)target remote bdi2000:2001

bdi2000

This stands for an IP address. The HOST file must have an appropriate

 

entry. You may also use an IP address in the form xxx.xxx.xxx.xxx

2001

This is the TCP port used to communicate with the BDI

If not already suspended, this stops the execution of application code and the target CPU changes to background debug mode.

Remember, every time the application is suspended, the target CPU is freezed. During this time no hardware interrupts will be processed.

Note: For convenience, the GDB detach command triggers a target reset sequence in the BDI.

(gdb)...

(gdb)detach

... Wait until BDI has resetet the target and reloaded the image (gdb)target remote bdi2000:2001

Note:

GDB sometimes fails to connect to the target after a reset because it tries to read an invalid stack frame. With the following init list entries you can work around this GDB startup problem:

WGPR

11

0x00000020

;set frame pointer to free RAM

WM32

0x00000020

0x00000028

;dummy stack frame

© Copyright 1997-2007 by ABATRON AG Switzerland

V 1.04

Image 40
Contents BdiGDB Installation Using bdiGDBIntroduction BDI2000 BDI ConfigurationTroubleshooting Maintenance Trademarks AppendicesIntroduction BDI2000BDI Configuration Connecting the BDI2000 to Target InstallationFor BDI Main / Target a connector signals see table on next BDI Main / Target a Connector Signals Jtag Test ResetChanging Target Processor Type For Target B connector signals see table on next Adaptive ClockingBDI Target B Connector Signals Returned Jtag Test ClockPlease switch on the system in the following sequence External power supply Target systemPower Supply from Target System 142Status LED «MODE» Built in LED indicates the following BDI statesRS232 Connector BASE-T Connector Ethernet communicationPC Host Name DescriptionOverview of an installation / configuration process Installation of the Configuration SoftwareActivating Bootp Build the setup tool Load/Update the BDI firmware/logic1 Configuration with a Linux / Unix host Following the steps to bring-up a new BDI2000Check configuration and exit loader mode Transmit the initial configuration parametersfile name without any path For more information about Tftp use man tftpd2 Configuration with a Windows host Ory / programmable logicRecover procedure Reassemble the unit as described in Appendix «Maintenance»Testing the BDI2000 to host connection Tftp server for Windows NTUsing bdiGDB Principle of operationConfiguration File Part Init BdiGDB for GNU Debugger, BDI2000 ARM11/Cortex-A8 Using a startup program to initialize the target system ROM on the target, select ROM as the formatFormat COFF, SREC, AOUT, BIN, ELF or ROM Example Format CoffPart Target Cputype ARM1136None PushpullHalt StopRUN LoadonlySoft HardBreakmode Hard CoreDaisy chained Jtag devices Low level Jtag scan chain configuration Part Host Prompt ARM11 Dump filenamePart Flash BLOCK, CHIP, Unlock Supported Flash Memories AM29BX8 MIRRORX8, I28BX8 STRATAX8, AT49X8Or use the Telnet unlock command Tor. In other words, this is the size of one sector in bytesPart Regs Entry in the configuration file Example for a register definitionRegister definition file Connecting to the target Target setupDebugging with GDB GDB monitor command Breakpoint HandlingTarget serial I/O via BDI Target DCC I/O via BDI Telnet Interface Command list DumpCPxx Registers Some examples CP15 ID register CRn = 0, opcode2 =CP15 Cache Type CRn = 0, opcode2 = CP15 Invalidate I cache line CRn = 7, opcode2 = 1, CRm =Multi-Core Support Specifications BASE-TEnvironmental notice Declaration of Conformity CEWarranty Troubleshooting Problemfirmware can not be loaded Possible reasonsMaintenance Unplug the cablesReinstallation Trademarks All trademarks are property of their respective holders