On Target debugging on Serie 60 with Bluetooth

Login to reply to this topic.
Mon, 2005-11-21 09:53
Joined: 2005-11-14
Forum posts: 12
Hi all,

I've found a method to debug applications on Serie 60 phones and I just want to share with you guys. I've updated the tutorial I've found in the site with my own experiences. It's quite large but I think it will be worth reading...

Checklist

•   Hardware
o   PC
o   Compatible Bluetooth adaptor
o   Nokia Serie 60 Phone (IÂ’ve tested with 6600, 6670, 6680 and 7610)

•   Software
o   PC
   Symbian SDK Serie 60 (IÂ’ve tested it with 2.1 and 2.0. DonÂ’t know how it will work with later releases).
   Borland BuilderX Mobile Edition (only if you want to use a friendly interface for debugging)
   gdb.ini (only if you want to use command-line gdb)
   Nokia PC Suite
o   Symbian Phone
   gdbstub.sis
   gdbstub.ini
   FExplorer (or similar)
   BTComm Control

1.   Install gdbstub

Install gdbstub.sis on your phone. This file is installed by default by the Nokia SDK in the following directory:

Path: C:\Symbian\7.0s\Series60_v20\Epoc32\Release\armi\urel\


2.   Create gdbstub.ini

On the target you should create a folder C:\gdbstub. And in this folder using notepad in your PC, create a file gdbstub.ini file with following contents.

[COMMSERV]
PDD=EUART1
LDD=ECOMM
CSY=BTCOMM
PORT=0
RATE=9600


3.   Create gdb.ini

This step only must be done if you want to debug with the gdb command-line interface. If you prefer using BuilderX IDE youÂ’ll have to configure the remote connection with the same parameters.

On your PC create a directory in and only in c:\bbb and put the file gdb.ini in this folder. Gdb.ini file contents is

symbol-file //c/symbian/7.0s/series60_v20/epoc32/release/armi/udeb/aaa.sym
epoc-exec-file c:\system\apps\aaa\aaa.app
target epoc com4
break NewApplication
source //c/symbian/7.0s/shared/epoc32/gcc/share/epoc-des.ini

Replace all bbb and aaa with appropriate names

NOTE: Please check the port number which you are using in line 3 put the appropriate com number to it.

NOTE: com number must always be between 1 and 4 (this is a gdb limitation). This is an important drawback because surely this port will be occupied in your computer. To solve this you should disable all serial ports in your computer in order to the bluetooth adapter gets a low com port.

4.   Compilation

The application to debug shall be built using ARMI UDEB target:

abld build armi udeb

If you prefer, you can use BuilderX for building the application.

5.   Update the pkg file

Now go to your application xxx.pkg file and change the entire path so that compiled code is taken from armi\udeb directory.

Then create the sis file and install it in your phone (this is something that BuilderX can do for you)


6.   Install BTComm Control

The BTComm Control application allows one to configure the Bluetooth virtual serial ports of a Series 60 phone. Both the remote endpoint of a virtual serial port (i.e. the remote device) and the link's security settings can be set. You can download this application from the Symbian web.

http://www.symbian.com/developer/downloads/files/BTCOMM_control_S60_v1.zip

Install the .sis on the phone (actually there are two versions: Symbian OS v6.1, v7.0 and 7.0s using the older Bluetooth APIs as well as Symbian OS v8.0a).

7.   Cleaning up the environment

Close all the applications in the PC that are using the Bluetooth adaptator. This also includes any version of Nokia PC Suite or other connectivity software with the smart phone.

You must also close any application in the phone that uses Bluetooth. The phone canÂ’t be connected to any PC, PDA, etc.

8.   Launching the BTComm Control

Start the BTComm Control application from your phone. Then you must configure the connection. Enable the authentication, select port 0, and finally select the device you want to connect (this must be your PC). You can test the connection and in case all goes ok you must receive an advertisement in you PC informing you there is an active connection with the phone. Then you can exit the application.

9.   Launching the gdbstub

Using FExplorer (or similar) run c:\system\programs\gdbstub.exe.

In this moment you should receive an advert in your PC indicating there is an active connection with the phone.

10.   Launching the debugger

In the Dos-Shell of your PC, go to the directory c:\bbb (where we create gdb.ini) and run gdb.exe –nw

The following message should appear.

GNU gdb 4.17-psion-98r2
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or
Breakpoint 1 at 0x(some address): file <your source file that contains
NewApplication>
gdb>

Then in the gdb prompt, type run. The following message should appear.

Starting program:
warning: Application started but no document specified.
The application may panic at some point if it is document based and if there is no existing default document.
Breakpoint 1 0x(some address): file <your source file that contains
NewApplication>
Breakpoint 1, NewApplication ()
  at file <your source file that contains NewApplication>
  <some sourcecode>
Current language:  auto; currently c++

In case you are using BuilderX IDE, just open your project, make it for ARMI UDEB and click on Debug Project.

At this moment (supposing nothing went wrong) you can debug  your application either in the command-line, either in the BuilderX IDE.

Happy Debugging ; )

Fri, 2005-12-09 17:54
Joined: 2005-12-09
Forum posts: 1
Re: On Target debugging on Serie 60 with Bluetooth
 Huh Huh Huh

 Hello!

 Thanks for your Tips!
But i have still a problem with the "gdbstub.ini" file
 i have that in my gdbstub.ini:

[COMMSERV]
PDD=EUART1
LDD=ECOMM
CSY=BTCOMM
PORT=0
RATE=9600

when i lauch the gdbstub.exe i have in my log file ("log.txt"):


GDBSTUB - Copiright 2000-2
002 Symbian Ltd.09.12.2005
17:26:41 CFg File: error line1
PORT CURRENT PARAMETERS:M
ode: BTRemote adress: Remo
ote port: 1Error 5 while ope
ning port:Configuration faile
d
(epoc error is -1) Fatal Error


  Afro Afro Can someone could help me and tell me what's wrong
  in my gdbstub.ini file or anywhere elese Huh  Tongue



  Thanks !


   CHECK
  • Login to reply to this topic.