This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

porting code for S110 to work with S310

Hi,

When porting code for S110 to work with S310, what modifications are required?

Thanks.

  • Hi

    Here is the porting guide, i.e. to port any S110 application to the S310 v1.0.0 softdevice. First copy the BLE example folder to directory \Nordic\nrf51_sdk_v5_2_0_39364\nrf51422\Board\nrf6310\s310. There are actually only two changes to the BLE project needed in order to make it compatible with the S310 softdevice:

    a) In Keil -> Options for Target, change the path from /include/S110 to /include/S310 image description

    b) Change RAM and ROM settings image description

    Note: The S310 v1.0.0 softdevice is based on S110 v6.0.0 and S210 v3.0.0 softdevices. For that reason, only port BLE examples from nRF51 SDK v5.2.0 to work with the S310 v1.0.0 softdevice, because the nRF51 SDK v5.2.0 is compatible with S110 v6.0.0.

    Update 8.12.2014 for S310 v2.0.0 The procedure for port BLE application from SDK 7.1.0 to the S310 v2.0.0 is similar as for the S310 v1.0.0.

    a) In Keil -> Options for Target, change the path from /include/S110/headers to /include/S310/headers image description

    b) Change RAM and ROM settings image description

  • Hi Stefan,

    Thanks for your quick reply. I did the same modifications. But it needed more modification in my case. Maybe it's better to describe what I did in my case. I'll write these in an answer instead of a comment here because of the word number limitation and incapability of pasting picture.

  • Here is what I did. The board I worked with was N5 Start Kit from Dynastream which had a nRF51422 inside. At first, I took the example code "ble_app_hrs" from nrf51_sdk_v6_0_0_43681\nrf51822\Board\pca10001\s110\ble_app_hrs. I also installed N5StarterKitSDK_1.00 which provided board abstraction codes for N5 Start Kit. I modified the project and code so that it worked well with IAR Embedded Workbench, N5 Start Kit and S110 v7.0.0 - I could see the Heart Rate Measurement value in Master Control Panel and change its value by buttons. Then, I supposed the code should worked well with S310 v1.0.0, I did the same modifications you showed above but in IAR EW. At first I got building error. image description

    The cause was these codes: // Enable BLE stack ble_enable_params_t ble_enable_params; memset(&ble_enable_params, 0, sizeof(ble_enable_params)); ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT; err_code = sd_ble_enable(&ble_enable_params); APP_ERROR_CHECK(err_code);

    Then I simply removed all these codes and built the code again. It worked.

    From this experience, it looks to me that porting code for S110 to work with S310 probably needs some code modification. I wonder if there is any other difference between S110 and S310 in the sense of application source code, maybe some differences which are not as explicit as this one.

  • One important thing i forgot to mention. The S310 stack is based on S210 v3.0.0 and S110 v6.0.0. So you need to use ble_app_hrs example from SDK 5.2.0 since that SDK version is compatible with S110 v6.0.0

  • I mean the S310 v1.0.0 is based on S210 v3.0.0 and S110 v6.0.0

Related