## On-device Debugging Troubleshooting

If you are having problems with on-device debugging, see if the following solutions can solve the problem.

### Deploying SIS Files using Carbide (Application TRK)

#### Am unable to create my SIS file, what can cause this ?

> Ensure that you are using symbols in your PKG file to generate the SIS file. See Working with PKG and SIS Files for more details.

#### How do I know my SIS file got installed correctly?

> If you did not receive an error message that Carbide.c++ could not install the SIS file, then go to the Application Manager on the phone and look for the SIS file. If the SIS file is there it tells you that Carbide.c++ successfully deployed the application to the device.

> Next, check the target directory on the device for the executable. If the executable is present, attempt to launch the executable. If the executable launches this lets you know the binaries were built correctly for the device. If the executable does not launch, try to build the application again using the command-line version of the tool.

> To verify the install process, go to the Installation tab of your launch configuration and disable the Do not show installer UI on the phone option. The next time Carbide.c++ attempts to deploy the application, prompts will appear on the phone verifying that it is okay to install the application. You can then watch the SIS file being installed on the phone.

#### How do I force the install of a SIS file to a device?

> In Carbide.c++, go to the Installation tab of your launch configuration and enable the Install each launch even if installer file has not changed option. Once set, just click the Debug control again to deploy the new application binaries to the device.

#### Am getting the an error when attempting to install my SIS file, what can I do?

> To get better error messages about possible install failures, go to the Installation tab of your launch configuration and disable the Do not show installer UI on the phone option. The next time Carbide.c++ attempts to deploy the application, prompts will appear on the phone verifying that it is okay to install the application. You can then watch the SIS file being installed on the phone. When the SIS file fails to install again, TRK will provide more specific errors on why the installation failed.

#### Am getting the error "process fails to launch", what can I do to correct this?

> There are several things that can cause this error including:

- Verify deployment of the SIS file, see How do I know my SIS file got installed correctly? above.
- Verify that the MMP or PKG files does not contain any errors.
- If the application uses a self-signed SIS, a UID3 is required that is set within the proper address range. See https://www.symbiansigned.com/app/page/uidfaq for more info.
- Verify that the UID3 address matches between the MMP and PKG file if using Application TRK. If using Sys TRK, verify the File Transfer tab on the System TRK launch configuration is correct.
- Verify that your binaries are built correctly by attempting to launch the executable on the phone from the target directory. If this fails, rebuild the application using the command-line tools, then see How do I force the install of a SIS file to a device? above to redeploys and debug again.
- If debugging a DLL from an application and using System TRK, ensure that the DLL is included in the File Transfer tab of the launch configuration so that it is deployed to the device with the application. It is not added by default.

#### Am getting an exception when trying to debug with Application TRK

> The main reason for this is that you have entered ROM code or another prohibited address space. You can confirm this by checking the Disassembler view. When in a prohibited memory address the view may be blank. To correct, click Step Over or Resume to move to the next breakpoint in your code.

#### I'm running out of memory on the device, what can I do?

> On platforms that include Platform Security there are several directories like c:\sys\bin where you cannot easily delete files that are no longer required. Over time the device's memory becomes full, making it difficult or impossible to install and debug additional programs.

> If using Application TRK to install and debug programs, use the Application Manager on the device to remove all the files specified in the program's PKG file, but not the SIS file itself.

> If you are using System TRK to install and debug programs and additional files, you will need to create a SIS that includes the files listed in the File Transfer pane, deploy it manually to the device, then run the Application Manager on the device to remove the files.

### Connectivity

#### How can I use USB instead of Bluetooth to debug my application?

> For USB support in TRK 2.5 or greater, while the TRK application is running on the phone, choose Options > Settings, then set Connection to USB.

> For USB support in TRK v2.1, include the metrotrk_usb.ini file instead of the metrotrk_bt.ini file in your ROM image. You do this by modifying the metrotrk.iby file like this:

> Replace the line:

> data=ZSYSTEM\..\metrotrk\metrotrk_bt.ini \metrotrk.ini

> With:

> data=ZSYSTEM\..\metrotrk\metrotrk_usb.ini \metrotrk.ini

> Then rebuild the ROM image.

> NOTE With the S60 wk46 release onwards, the port number needs to be set to 1 instead of 0.

> ##### Installing Latest USB Drivers

> On the host PC, you need to update the USB drivers to work with the latest S60 devices. The latest drivers create a virtual com port on the host which you can specify in Carbide. Download and install the latest Nokia Connectivity Cable Drivers from PC Suite Vivaldi web site.

> When you first connect the USB cable to the phone you'll get a prompt to choose the "PC Suite" or "File Transfer" mode. Choose "PC Suite" mode to use TRK with USB. Also you will get several “New Hardware found” wizards. You need to go through the installation each time to successfully use the USB connection to access the device.

> ##### Connecting to Device using USB

> If the current Connection setting on the phone is Bluetooth, when you start the TRK application on the phone you should see a list of Bluetooth devices. Press Cancel. In the TRK Welcome Screen press Options, then the Settings control. You should see the connection set to Bluetooth. Select the Options > Change option and change the connection option to USB. Your connection should now show as USB. Press Back to go to the TRK Welcome screen. In the TRK Welcome screen press Select > Connect. The status in the TRK welcome screen should show as connected.

> The next time you connect the USB cable to the phone you’ll get a prompt to choose the "PC Suite" or "File Transfer" mode. Choose "PC Suite" mode to use TRK with USB. Then start the TRK application.

#### What is the virtual COM port number for my S60 phone on the host PC if I am using USB?

> Normally, you can determine the COM port ID using the Device Manager if TRK is already connected via USB.

> To check, choose Start > Settings > Control panel > System > Hardware > Device Manager. In the Device Manager, choose "Ports" to view the active ports (Figure 1).

> Figure 1. Ports displayed in Ports section of Device Manager.

> In some situations all USB virtual COM ports are installed under "Modems" in the Device Manager. In the Device Manager dialog, choose "Modems" and see if there are two COM ports listed. One of them will work for debugging. Most of the time, the higher port number works for debugging with TRK.

#### I am having difficulty getting a Bluetooth connection to work with AppTRK, any suggestions?

> The following are known issues when trying to use Bluetooth serial port on the host:

- XP Microsoft Bluetooth stack does not work correctly with bt serial port emulation (on the PC side). For using TRK, you need BT serial port emulation. Some of the BT dongle manufacturers recommend changing to their own drivers to enable Bt stack serial port emulation.
  - Resolution at the moment: Change the XP drivers to bt dongle manufacturers (IBM, TDK, MSI) own drivers by uninstalling the XP drivers and installing the dongle drivers. After the installation the Microsoft Bluetooth Enumerator and Microsoft Bluetooth Services must be shut down.
  - From Computer Management -> Device Manager uninstall the Microsoft BT Enumerator
  - From Computer Management -> Services and Applications -> Services shutdown the Microsoft Bluetooth Services
  - On the desktops, the Belkin Bluetooth dongle is known to properly provide BT Serial port emulation. Other Bluetooth dongles should work as long as the serial port service is provided by the Bluetooth driver

#### TRK is launched on the device, but I am getting “Can’t connect to TRK” error message in the Carbide.c++ tools, any suggestions?

> Check that Carbide.c++ and your USB Virtual COM port or BT Serial Port agree on the port settings.

- Use the On-Device Connections dialog to quickly determine if you can communicate with the device in the Check TRK version pane
- Open your Bluetooth or USB cable's connection settings: Start -> Settings -> Control panel -> System -> Hardware -> Device Manager. In the Device Manager dialog, click open the Ports directory, then you will see all the com ports available on the machine. Here you will be able to see the COM port for Bluetooth or USB. Sometimes you will have two COM ports for Bluetooth, so you might have to try specifying either of them.
- In the Carbide tools, open the launch configuration associated with the target device and verify that you have specified the correct launch configuration for TRK. For example, the launch configuration should be either Symbian OS Application TRK or Symbian OS System TRK configuration.
- In the Carbide tools, open the launch configuration associated with the target device. In the Connections tab make sure you specify the same COM port number as in the device manager. For Bluetooth, if two ports are listed in the device manager, then you need to try to both, to see which one works. For USB, don't select the COM port assigned to the serial port. Always select the COM port assigned to the virtual COM port ID for the phone that is specified in the Device Manager.
- Make sure the settings in these two dialogs are the same and that the launch configuration settings refer to the right COM port. You shouldn't have to touch the other settings, but they're Data Bits: 8; Parity: None; Stop Bits: 1; Flow Control: None.