Changes between Version 10 and Version 11 of DevelopingSymbianAppWithCarbide


Ignore:
Timestamp:
Dec 29, 2007 11:08:05 AM (16 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevelopingSymbianAppWithCarbide

    v10 v11  
    1 = Developing PJSIP for Symbian S60 3rd Edition Device using Carbide C++ = 
     1= Developing, Building and Debugging PJSIP for Symbian S60 3rd Edition Device using Carbide C++ = 
    22 
    33== Introduction == 
    44 
    5 Previously PJSIP did not support Carbide C++ as the development tools for Symbian target, since Carbide did not import PJSIP's MMP files properly. But with the release of Carbide C++ version 1.2, it seems that Carbide is now able to build PJSIP projects properly. And since it seems that Nokia strongly suggests to use Carbide for the development tools instead of !CodeWarrior, it may worth to write some small documentation to help you get started with developing PJSIP applications on Symbian using this tool. 
     5Previously PJSIP did not support Carbide C++ as the development tools for Symbian target, since Carbide did not import PJSIP's MMP files properly. But with the release of Carbide  
     6 
     7C++ version 1.2, it seems that Carbide is now able to build PJSIP projects properly. And since it seems that Nokia strongly suggests to use Carbide for the development tools  
     8 
     9instead of !CodeWarrior, it may worth to write some small documentation to help you get started with developing PJSIP applications on Symbian using this tool. 
    610 
    711This document covers the following topics: 
     
    1519 
    1620For this tutorial, we will need: 
    17  - [http://www.forum.nokia.com/info/sw.nokia.com/id/4a7149a5-95a5-4726-913a-3c6f21eb65a5/S60-SDK-0616-3.0-mr.html Symbian S60 3rd Edition Maintenance Release (MR)]. Other SDK versions may work, but I did not test it. 
    18  - [http://www.forum.nokia.com/info/sw.nokia.com/id/dbb8841d-832c-43a6-be13-f78119a2b4cb.html Carbide C++ version 1.2]. You will need the Developer Edition to do on-device debugging (21 days evaluation is available). 
     21 - [http://www.forum.nokia.com/info/sw.nokia.com/id/4a7149a5-95a5-4726-913a-3c6f21eb65a5/S60-SDK-0616-3.0-mr.html Symbian S60 3rd Edition Maintenance Release (MR)]. Other SDK  
     22 
     23versions may work, but I did not test it. 
     24 - [http://www.forum.nokia.com/info/sw.nokia.com/id/dbb8841d-832c-43a6-be13-f78119a2b4cb.html Carbide C++ version 1.2]. You will need the Developer Edition to do on-device  
     25 
     26debugging (21 days evaluation is available). 
    1927 - [http://europe.nokia.com/A4144903 Nokia PC Suite] for the connectivity between the device and your PC (I use version 6.85) 
    2028 - Latest PJSIP from SVN trunk 
     
    2634== Installations == 
    2735 
    28 === SDK and Carbide Installations === 
    29  
    30 Follow the installation instructions in the SDK and Carbide documentation. Please install Symbian SDK on the same drive as PJSIP. 
     36=== SDK === 
     37 
     38Follow the installation instructions in the SDK documentation (make sure that the SDK requisites, such as Perl version, are satisfied). Please install Symbian SDK on the same  
     39 
     40drive as PJSIP. 
     41 
     42=== Carbide === 
     43 
     44Follow the installation instructions in the Carbide C++ documentation. The installation should be straightforward, but don't forget to '''select the Developer's Edition'''  
     45 
     46(instead of Personal Edition) to get the On-Device debugging/TRK Debugging feature. 
     47 
     48(There is a 21 days evaluation period for the Developers Edition. If you have installed Carbide before and your evaluation period is over, you may not be able to select the  
     49 
     50Developers Edition, and you will have to purchase the Developers license) 
     51 
    3152 
    3253=== Nokia PC Suite === 
     
    6788[[Image(import_bld.JPG)]] 
    6889 
    69 Then on the SDK selection dialog, select the build configurations that you want to support. For this tutorial, select WINSCW and GCCE from S60 3rd Edition MR SDK, and press '''Next''' button: 
     90Then on the SDK selection dialog, select the build configurations that you want to support. For this tutorial, select WINSCW and GCCE from S60 3rd Edition MR SDK, and press  
     91 
     92'''Next''' button: 
    7093 
    7194[[Image(import_sdk.JPG)]] 
     
    97120== Building the Projects == 
    98121 
    99 First select the build target by selecting '''Project''' --> '''Active Build Configuration''' from main menu, or right clicking the ''Bld.inf'' or ''pjproject'' item from ''Symbian Project Navigator'' pane from the bottom left part of the main window. Select '''Phone Debug (GCCE) [S60_3rd_MR]''' from the menu: 
     122Lets try to build the project first to make sure that the source is okay. 
     123 
     124=== Select the Build Configuration === 
     125 
     126First select the build target by selecting '''Project''' --> '''Active Build Configuration''' from main menu, or right clicking the ''Bld.inf'' or ''pjproject'' item from  
     127 
     128''Symbian Project Navigator'' pane from the bottom left part of the main window.  
     129 
     130Select '''Phone Debug (GCCE) [S60_3rd_MR]''' from the menu: 
    100131 
    101132[[Image(build_config.JPG)]] 
    102133 
     134=== Build the Project === 
     135 
    103136Then right click ''Bld.inf'' or ''pjproject'' item from ''Symbian Project Navigator'' pane from the bottom left part of the main window, and select '''Build Target Only''': 
    104137 
    105138[[Image(build.JPG)]] 
    106139 
    107 Wait for the build process to complete. Once it completes, watch out for any errors in the ''Problems'' pane (at the bottom center). There shouldn't be any errors, although there may be few warnings which I think can be ignored, for now: 
     140Wait for the build process to complete. Once it completes, watch out for any errors in the ''Problems'' pane (at the bottom center). There shouldn't be any errors, although there  
     141 
     142may be few warnings which I think can be ignored, for now: 
    108143 
    109144[[Image(build_problems.JPG)]] 
     
    111146We are now ready to build the .SIS file to be deployed to the phone. 
    112147 
     148 
     149---- 
     150 
     151 
     152== Preparing the .sis File == 
     153 
     154The .sis file is the packaging for the executable to be deployed in the device. The .sis file can be created very easily with Carbide C++. 
     155 
     156 
     157=== Set the .pkg File to be Used === 
     158 
     159First we'll need to configure the .pkg file to be used to generate the .sis file. PJSIP provides some sample .pkg files which can be used, however there may be few editing needed  
     160 
     161befor you can use them (this is because the .pkg file contains absolute directory path for your Symbian SDK, which may be different on your installation). 
     162 
     163Assign the .pkg file to be used by the project by selecting Project Properties: 
     164 
     165[[Image(project_properties_menu.JPG)]] 
     166 
     167Then this dialog below will appear. On this dialog: 
     168 1. Select ''Carbide Build Configuration'' from the tree. 
     169 1. Make sure that the Active Configuration is set to '''Phone Debug (GCCE) [S60_3rd_MR]''' 
     170 1. Set the ''PKG File'' by clicking ''Browse...'' button, and choose {{{symbian_ua.pkg}}} from PJSIP's {{{build.symbian}}} directory. 
     171 
     172We can leave the SIS creation and Signing settings empty. 
     173 
     174The dialog window now should look like this: 
     175 
     176[[Image(project_properties_menu.JPG)]] 
     177 
     178Press ''OK'' button to save the project configuration. 
     179 
     180Now right click '''bld.inf''' and click '''Refresh''': 
     181 
     182[[Image(project_refresh.JPG)]] 
     183 
     184Wait for few seconds (30 seconds on my computer) for Carbide to do its job, once it's done, you will see the .pkg file in the ''Project Navigator'' pane: 
     185 
     186[[Image(project_pkg.JPG)]] 
     187 
     188 
     189=== Edit the PKG File === 
     190 
     191As said earlier, the PKG file contains absolute directory path for the SDK, so you may need to edit it if your SDK location is different than the one specified in the PKG. 
     192 
     193Edit the PKG by ''double clicking'' it in the ''Symbian Project Navigator'' pane. Check out these lines in the PKG file: 
     194 
     195{{{ 
     196; Target 
     197"C:\Symbian\9.1\S60_3rd_MR\epoc32\release\gcce\UDEB\symbian_ua.exe"-"!:\sys\bin\symbian_ua.exe" 
     198}}} 
     199 
     200Check that: 
     201 - the SDK path is correct 
     202 - later, if you ever want to create the Release version of the application, you will need to rename '''UDEB''' to '''UREL'''. But we can leave this to '''UDEB''' for now, since  
     203 
     204we want the Debug version of the application. 
     205 
     206Once you are done with the modification, save the file. We can close the file editor window now. 
     207 
     208 
     209=== Build the SIS File === 
     210 
     211Once PKG has been setup on the project, a SIS file will be created everytime we build the project. So lets build the project now. 
     212 
     213Right click ''pjproject'' and select '''Build Target Only''': 
     214 
     215[[Image(build.JPG)]] 
     216 
     217The build process will start. You can take a peek on the '''Console''' tab to see what's being done. Once the build process completes, you should see something like this on the  
     218 
     219'''Console''' tab: 
     220 
     221{{{ 
     222Signing 
     223 
     224***SIS Creation Complete 
     225 
     226Total Time: 12 sec 
     227}}} 
     228 
     229 
     230Check the '''Problems''' tab again to see if we have any errors (there shouldn't). 
     231 
     232 
     233---- 
     234 
     235 
     236== Configuring On-Device Debugging == 
     237 
     238=== Connect Data Cable === 
     239 
     240Connect the USB cable to the phone, and on the phone, select '''PC Suite''': 
     241 
     242[[Image(phone_usb.JPG)]] 
     243 
     244If this is the first time you connect your phone to the PC, then it may take some time for Windows to install the USB drivers for the phone. Wait for it to complete and the Nokia  
     245 
     246PC Suite and PC Sync icons on the task bar tray become green: 
     247 
     248[[Image(pc_suite.JPG)]] 
     249 
     250 
     251=== Installing TRK Application on the Phone === 
     252 
     253Install TRK support on the phone. The TRK application can be found in {{{C:\Program Files\Nokia\Carbide.c++ v1.2\plugins\com.nokia.carbide.trk.support_1.2.0.29\trk\s60}}}  
     254 
     255directory. For my phone, the one that works is {{{s60_3_0_app_trk_2_7.sisx}}}. Right click this .sisx file and select '''Install with Nokia Application Installer''': 
     256 
     257[[Image(trk_path.JPG)]] 
     258 
     259When asked if we want to install, click '''Yes''': 
     260 
     261[[Image(trk_install.JPG)]] 
     262 
     263On the PC, this window should be displayed.  
     264 
     265[[Image(trk_wait.JPG)]] 
     266 
     267Leave it this way, the installation will start on the phone now. Your phone should display something like this: 
     268 
     269[[Image(trk_p_install.JPG)]] 
     270 
     271Click Yes. 
     272 
     273Now the phone will display '''Details''' information: 
     274 
     275[[Image(trk_p_details.JPG)]] 
     276 
     277Click Continue. 
     278 
     279Your phone may now display the target memory location: 
     280 
     281[[Image(trk_p_mem.JPG)]] 
     282 
     283Select the memory and press '''Select''' menu. 
     284 
     285Now the phone will display license agreement: 
     286 
     287[[Image(trk_p_lic.JPG)]] 
     288 
     289Click '''OK''' (if you agree, of course). The phone should display installation progress window for couple of seconds now: 
     290 
     291[[Image(trk_p_progress.JPG)]] 
     292 
     293Once it's done, '''Installation Complete''' window will appear briefly: 
     294 
     295[[Image(trk_p_complete.JPG)]] 
     296 
     297TRK is now installed on the phone. Next step is to run it. 
     298 
     299 
     300=== Running TRK Application on the Phone === 
     301 
     302 1. Run it from '''Menu''' --> '''Installations''' --> TRK (it may be different on your phone). 
     303 1. When it asks to switch on Blueetooth, click '''No'''. We use USB cable for this session. 
     304 1. The TRK window will appear. We can ignore the error message for now: 
     305 
     306[[Image(trk_r_welcome.JPG)]] 
     307 
     308 1. Select '''Options''' --> '''Settings''' menu. 
     309 1. Change the '''Connection''' to USB, and leave all settings unchanged: 
     310 
     311[[Image(trk_p_usb.JPG)]] 
     312 
     313 1. Click '''Back''' to get back to TRK main window. 
     314 1. Now select '''Options''' --> '''Connect''' from the menu. 
     315 1. TRK main window should display '''Status: Connected''' now: 
     316 
     317[[Image(trk_p_connected.JPG)]] 
     318 
     319Leave TRK running on the phone for the duration of this tutorial. 
     320 
     321 
     322=== Finding the COM Port Mapping for the Phone Connection === 
     323 
     324Find out which COM port is the phone connection mapped to, in Device Manager: 
     325 
     326[[Image(dev_mgr_com.JPG)]] 
     327 
     328In this case, the COM port is COM3. Note this COM port number, as we will need to specify it in Carbide. 
     329 
     330 
     331=== Configure the Debug Settings in Carbide === 
     332 
     333Back to Carbide. 
     334 
     335Next we will need to create a new on-device debugging configuration. 
     336 
     337Select '''Run''' --> '''Debug...''' from the main menu: 
     338 
     339[[Image(run_debug.JPG)]] 
     340 
     341'''Debug''' dialog will appear like below: 
     342 
     343[[Image(run_debug.JPG)]] 
     344 
     345==== Create a new Debug configuration for on-device debugging ==== 
     346 
     347Right-click '''Symbian OS App TRK''', and click '''New'''. 
     348 
     349New configuration will appear on the dialog. We need to edit few things: 
     350 1. Rename the configuration name from '''pjproject Phone Debug...''' to '''symbian_ua Phone Debug...''', as seen in the picture below. (Hints: when we have different executable  
     351 
     352to debug, we will create different configuration). 
     353 1. Set the ''Executable'' 
     354 1. Set the ''Remote process to launch'' 
     355 
     356You should see something similar to the image below. 
     357 
     358[[Image(debug_main.JPG)]] 
     359 
     360Now click on '''Apply''' button. The configuration name on the left tree now will get updated. 
     361 
     362==== Configure TRK Connection ==== 
     363 
     364Now select '''Connection''' tab. Choose the '''Serial Port''' to the COM port where your phone connection is mapped to, which you have found out from the step above (look at the  
     365 
     366Device Manager). In my case, it was COM3: 
     367 
     368[[Image(debug_connection.JPG)]] 
     369 
     370The ''Baud Rate'' setting should match the setting on the TRK application running on the phone. Since we have not changed this setting, just accept the default value (115200). 
     371 
     372Now click on '''Apply''' button.  
     373 
     374==== Configure SIS File ==== 
     375 
     376Now select the '''Installation''' tab. Browse the .sisx file from PJSIP's {{{build.symbian}}} directory: 
     377 
     378[[Image(debug_installation.JPG)]] 
     379 
     380Now click '''Apply''' button 
     381 
     382We are now ready to perform on-device debugging! Get yourself some tea, you deserve some break. 
     383 
     384 
     385=== Debugging Application === 
     386 
     387Still in the '''Debug''' dialog, press the '''Debug''' button. Hold your breath! 
     388 
     389Carbide now may rebuild the project (you may take a peek on what it's doing by looking at '''Console''' tab). Once it's done, Carbide will switch to ''Debug Perspective'' and the  
     390 
     391SIS file will be downloaded to the phone and this window will appear briefly: 
     392 
     393[[Image(debug_download.JPG)]] 
     394 
     395When this window dissappear, you should see the application runs on the phone: 
     396 
     397[[Image(symbian_ua.JPG)]] 
     398 
     399You may make calls, receive calls, do presence stuffs, etc. 
     400 
     401 
     402---- 
     403 
     404== Common Problems == 
     405 
     406=== Problem with Build/Clean === 
     407 
     408Sometimes Carbide does not build the project properly after we make some changes to the source. In this case, Project Clean should cause the project to be built properly. 
     409 
     410 
     411=== Program failed to debug after it has been downloaded to the phone === 
     412 
     413I experienced this once, and in my case, I suspect it was caused by some other program is currently using an Access Point (in my case, it was the periodic mail checking on the  
     414 
     415phone). 
     416 
     417 
     418=== IP address is not detected by symbian_ua === 
     419 
     420This causes symbian_ua to use 127.0.0.1 as its address. This is still an ongoing problem, but it may help if you start an Access Point on the phone (such as by opening the web  
     421 
     422browser) before starting the debugging. 
     423 
     424