| 148 | |
| 149 | ---- |
| 150 | |
| 151 | |
| 152 | == Preparing the .sis File == |
| 153 | |
| 154 | The .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 | |
| 159 | First 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 | |
| 161 | befor 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 | |
| 163 | Assign the .pkg file to be used by the project by selecting Project Properties: |
| 164 | |
| 165 | [[Image(project_properties_menu.JPG)]] |
| 166 | |
| 167 | Then 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 | |
| 172 | We can leave the SIS creation and Signing settings empty. |
| 173 | |
| 174 | The dialog window now should look like this: |
| 175 | |
| 176 | [[Image(project_properties_menu.JPG)]] |
| 177 | |
| 178 | Press ''OK'' button to save the project configuration. |
| 179 | |
| 180 | Now right click '''bld.inf''' and click '''Refresh''': |
| 181 | |
| 182 | [[Image(project_refresh.JPG)]] |
| 183 | |
| 184 | Wait 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 | |
| 191 | As 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 | |
| 193 | Edit 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 | |
| 200 | Check 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 | |
| 204 | we want the Debug version of the application. |
| 205 | |
| 206 | Once 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 | |
| 211 | Once 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 | |
| 213 | Right click ''pjproject'' and select '''Build Target Only''': |
| 214 | |
| 215 | [[Image(build.JPG)]] |
| 216 | |
| 217 | The 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 | {{{ |
| 222 | Signing |
| 223 | |
| 224 | ***SIS Creation Complete |
| 225 | |
| 226 | Total Time: 12 sec |
| 227 | }}} |
| 228 | |
| 229 | |
| 230 | Check 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 | |
| 240 | Connect the USB cable to the phone, and on the phone, select '''PC Suite''': |
| 241 | |
| 242 | [[Image(phone_usb.JPG)]] |
| 243 | |
| 244 | If 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 | |
| 246 | PC 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 | |
| 253 | Install 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 | |
| 255 | directory. 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 | |
| 259 | When asked if we want to install, click '''Yes''': |
| 260 | |
| 261 | [[Image(trk_install.JPG)]] |
| 262 | |
| 263 | On the PC, this window should be displayed. |
| 264 | |
| 265 | [[Image(trk_wait.JPG)]] |
| 266 | |
| 267 | Leave 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 | |
| 271 | Click Yes. |
| 272 | |
| 273 | Now the phone will display '''Details''' information: |
| 274 | |
| 275 | [[Image(trk_p_details.JPG)]] |
| 276 | |
| 277 | Click Continue. |
| 278 | |
| 279 | Your phone may now display the target memory location: |
| 280 | |
| 281 | [[Image(trk_p_mem.JPG)]] |
| 282 | |
| 283 | Select the memory and press '''Select''' menu. |
| 284 | |
| 285 | Now the phone will display license agreement: |
| 286 | |
| 287 | [[Image(trk_p_lic.JPG)]] |
| 288 | |
| 289 | Click '''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 | |
| 293 | Once it's done, '''Installation Complete''' window will appear briefly: |
| 294 | |
| 295 | [[Image(trk_p_complete.JPG)]] |
| 296 | |
| 297 | TRK 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 | |
| 319 | Leave TRK running on the phone for the duration of this tutorial. |
| 320 | |
| 321 | |
| 322 | === Finding the COM Port Mapping for the Phone Connection === |
| 323 | |
| 324 | Find out which COM port is the phone connection mapped to, in Device Manager: |
| 325 | |
| 326 | [[Image(dev_mgr_com.JPG)]] |
| 327 | |
| 328 | In 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 | |
| 333 | Back to Carbide. |
| 334 | |
| 335 | Next we will need to create a new on-device debugging configuration. |
| 336 | |
| 337 | Select '''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 | |
| 347 | Right-click '''Symbian OS App TRK''', and click '''New'''. |
| 348 | |
| 349 | New 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 | |
| 352 | to debug, we will create different configuration). |
| 353 | 1. Set the ''Executable'' |
| 354 | 1. Set the ''Remote process to launch'' |
| 355 | |
| 356 | You should see something similar to the image below. |
| 357 | |
| 358 | [[Image(debug_main.JPG)]] |
| 359 | |
| 360 | Now click on '''Apply''' button. The configuration name on the left tree now will get updated. |
| 361 | |
| 362 | ==== Configure TRK Connection ==== |
| 363 | |
| 364 | Now 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 | |
| 366 | Device Manager). In my case, it was COM3: |
| 367 | |
| 368 | [[Image(debug_connection.JPG)]] |
| 369 | |
| 370 | The ''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 | |
| 372 | Now click on '''Apply''' button. |
| 373 | |
| 374 | ==== Configure SIS File ==== |
| 375 | |
| 376 | Now select the '''Installation''' tab. Browse the .sisx file from PJSIP's {{{build.symbian}}} directory: |
| 377 | |
| 378 | [[Image(debug_installation.JPG)]] |
| 379 | |
| 380 | Now click '''Apply''' button |
| 381 | |
| 382 | We are now ready to perform on-device debugging! Get yourself some tea, you deserve some break. |
| 383 | |
| 384 | |
| 385 | === Debugging Application === |
| 386 | |
| 387 | Still in the '''Debug''' dialog, press the '''Debug''' button. Hold your breath! |
| 388 | |
| 389 | Carbide 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 | |
| 391 | SIS file will be downloaded to the phone and this window will appear briefly: |
| 392 | |
| 393 | [[Image(debug_download.JPG)]] |
| 394 | |
| 395 | When this window dissappear, you should see the application runs on the phone: |
| 396 | |
| 397 | [[Image(symbian_ua.JPG)]] |
| 398 | |
| 399 | You may make calls, receive calls, do presence stuffs, etc. |
| 400 | |
| 401 | |
| 402 | ---- |
| 403 | |
| 404 | == Common Problems == |
| 405 | |
| 406 | === Problem with Build/Clean === |
| 407 | |
| 408 | Sometimes 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 | |
| 413 | I 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 | |
| 415 | phone). |
| 416 | |
| 417 | |
| 418 | === IP address is not detected by symbian_ua === |
| 419 | |
| 420 | This 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 | |
| 422 | browser) before starting the debugging. |
| 423 | |
| 424 | |