2. Migrating an SDK6 existing project into e2 studio

In this tutorial we are going migrate ble_all_in_one example located in SDK examples to e2 studio. Users can follow the same steps to migrate another SDK6 example of their choice.

  1. Copy the e2 studio folder from: proximity reporter project projects/target_apps/ble_examples/prox_reporter to projects/target_apps/ble_examples/ble_app_all_in_one project folder.

    ../_images/copy_e2_folder.png

    Figure 1 Copy |e2| studio folder

  2. Now open the .project file in e2 studio folder and edit the name from prox_reporter to ble_app_all_in_one (users can name the project as they want).

    ../_images/change_project_name.png

    Figure 2 Change project name

  3. Close the .project file and open e2 studio.

  4. Open an existing Workspace to import the project. If the workspace doesn’t exist, creates a new workspace with a new name. At the end of e² studio startup, you will see the Workspace Launcher Dialog box as shown in the following figure.

    ../_images/workspace_launcher.jpg

    Figure 3 Workspace Launcher dialog

  5. Click Launch.

  6. When the workspace is opened, you may see the Welcome Window. Click on the Hide arrow button to proceed past the Welcome Screen as seen in the following figure.

    ../_images/Workbench.jpg

    Figure 4 Workbench arrow button

  7. Click Import on the File menu or in the menu bar, as shown in the following figure.

    ../_images/import.jpg

    Figure 5 File drop-down menu

  8. In the Import dialog box, as shown in the following figure, choose the General option, then Dialog SDK Project, to import the project into the current workspace.

    ../_images/exiting_project.jpg

    Figure 6 Project Import dialog with “Dialog SDK Project” option selected

Hint

In the General option, Choosing Existing Project into Workspace also works

  1. Click Next

  2. To import the project, use Select root directory

    ../_images/dialog_exist.jpg

    Figure 7 Import Existing Project dialog

  3. Click Browse.

  4. Browse to the |e2| studio folder of ble_all_in_one.

    ../_images/select_e2_folder.png

    Figure 8 Import Existing Project dialog ble_app_all_in_one

  5. Select the file for import. In our example, it is projects/ target_apps/ ble_examples/ ble_app_all_in_one/ |e2| studio.

  6. Click Finish to import the project.

  7. Now, in user_app category, compare the src directory of ble_app_all_in_one with project that of imported project. Here, we need to link files of ble_all_in_one and remove references to proximity reporter project.

    ../_images/compare_files_folders.png

    Figure 9 Compare src directory with imported project

  8. Delete user_proxr.c file.

    ../_images/delete_prox_reporter.png

    Figure 10 Delete is user_proxr.c

  9. Right click on user_app and select New → File to add new files to this folder.

    ../_images/add_new_file.png

    Figure 11 Add New File

  10. Select Link to the file system and copy the below file location.

    • PROJECT_LOC\..\src\user_all_in_one.c

      ../_images/add_linked_file.png

      Figure 12 Add Linked File

  11. Similarly add user_custs_impl.c to user_app copying the below address.

    • PROJECT_LOC\..\src\user_custs1_impl.c

  12. As we observed when comparing the src directory and imported project that custom_profile folder was missing. Hence we need to add this folder to the project. Right click on ble_app_all_in_one and select New → Folder to add folder.

    ../_images/add_new_folder.png

    Figure 13 Add New Folder

  13. Name the folder user_custom_profile and select (Virtual Folder) option to create new virtual folder.

    ../_images/virtual_folder.png

    Figure 14 Add Virtual Folder

  14. To this new folder we will add two .c files. Similar to Step. 10.

    • ${PARENT-1-PROJECT_LOC}\src\custom_profile\user_custs_config.c

    • ${PARENT-1-PROJECT_LOC}\src\custom_profile\user_custs1_def.c

      ../_images/add_new_file_2.png

      Figure 15 Add New File

  15. After adding two files, make user_custom_profile folder a Source Folder. Right click on ble_app_all_in_one and select New → Source Folder to add folder.

    ../_images/add_source_folder.png

    Figure 16 Add New Source Folder

  16. Select the folder by clicking on Browse… besides Folder name. Then select user_custom_profile and press Ok.

    ../_images/select_source_folder.png

    Figure 17 Select Source Folder

  17. This newly added folder also needs to be included in path. Select ble_all_in_one project and Press ALT + Enter to open Properties dialog box.

    ../_images/project_properties.png

    Figure 18 Open Project Properties

  18. Go to C/C++ Build → Settings. There in Tool Settings tab Compiler → Includes. Select [All Configurations] in Configuration.

    ../_images/properties_tool_settings.png

    Figure 19 Properties Tool Settings

  19. Press the + Button. In Add directories path dialog add the below path:

    • "${ProjDirPath}/../src/custom_profile".

      ../_images/add_directory_path.png

      Figure 20 Add directory path

  20. Then Press Apply, this will prompt a new window. Here press “Rebuild Index” button to rebuild the project index paths.

    ../_images/rebuild_index.png

    Figure 21 Rebuild Index

  21. As ble_app_all_in_one uses custom profile and timer0, these source files need to be added to the project. Link these files as shown in Step 10.

    • To sdk_app link:

      1. ${PARENT-5-PROJECT_LOC}\sdk\app_modules\src\app_custs\app_customs_task.c

      2. ${PARENT-5-PROJECT_LOC}\sdk\app_modules\src\app_custs\app_customs.c

        ../_images/sdk_app.png

        Figure 22 sdk_app folder after adding files

    • To sdk_profiles

      1. ${PARENT-5-PROJECT_LOC}\sdk\ble_stack\profiles\custom\custs\src\custs1_task.c

      2. ${PARENT-5-PROJECT_LOC}\sdk\ble_stack\profiles\custom\custs\src\custs1.c

      3. ${PARENT-5-PROJECT_LOC}\sdk\ble_stack\profiles\custom\custom_common.c

      4. ${PARENT-5-PROJECT_LOC}\sdk\ble_stack\host\att\attm\attm_db_128.c

      ../_images/sdk_profiles.png

      Figure 23 sdk_profiles folder after adding files

    • To sdk_drivers

      1. ${PARENT-5-PROJECT_LOC}\sdk\platform\driver\timer\timer0.c

      ../_images/sdk_driver.png

      Figure 24 sdk_drivers folder after adding files

  22. The project ble_all_in_one is only DA14585, DA14586 and DA14535. Hence we need to delete configuration for DA14531 and DA14531-01.

  23. Select ble_all_in_one project and Press ALT + Enter to open Properties dialog box. There in Build Variables section click on Manage Configurations button, this will open a new dialog box. In this box select “DA14531” and click on the Delete button to delete that configuration. Similarly delete DA1531-01 too.

    ../_images/delete_configuration.png

    Figure 25 Delete Configuration

    Note

    The previous step is only necessary when a particular project doesn’t have configuration for all DA1458x and DA1453x devices.

  24. Now build the project for any build configuration you want. To debug the project refer to this e2 Studio SDK 6 Getting Started Guide’s Debug section.

3. Conclusion

The above-mentioned process is just a guideline. When migrating a project from Keil® to e2 studio, users need to ensure that all necessary files, folders, and include directory paths are properly linked according to their project requirements. It’s essential to thoroughly compare the e2 studio project setup with the original Keil® project to identify any missing or misconfigured files.

Additionally, users may encounter various compilation errors due to compatibility issues between Keil® and e2 studio. These errors might arise from differences in compiler behavior, project settings, or library configurations. Here are a few common areas to check and adjust:

  • Compiler Settings: Ensure that the compiler settings in e2 studio match those used in Keil® . This includes optimization levels, language standards, and target device settings.

  • Include Paths: Verify that all include paths are correctly set up in e2 studio. Missing or incorrect include paths can lead to unresolved references and other compilation errors.

  • Linker Scripts: Check that the linker scripts used in e2 studio are compatible with those from Keil®. Differences in memory mapping and section definitions can cause linking errors.

  • Library Versions: Ensure that the same versions of any libraries used in Keil® are available and correctly linked in e2 studio. Incompatibilities in library versions can lead to runtime issues.