Skip to content

Silicon Labs SDK Upgrades

Dan Walkes edited this page Mar 7, 2020 · 14 revisions

This page is intended for use by Student Assistants and Instructors to document the process of upgrades between Silicon Labs SDK and Bluetooth SDK versions at the start of each semester.

It was last updated for Simplicity Studio 4.1.13.0, Gecko SDK Suite version 2.7, and Bluetooth BLE SDK version 21.2.0

Upgrade Simplicity Studio

Start by upgrading Simplicity Studio components to the latest available versions using the "Help->Update Software" menu.

Setting Up Example Empty Project with Latest SDK

Next, we are going to use Simplicity Studio to create a new ecen5823-assignments project with default content for the latest SDK version. See the screenshots below for the example sequence.

Use the AppBuilder Project under File->New->Project

image

Select Bluetooth SDK Latest Version Available

image image

Select SOC - Empty Project

image

Set Project Name ecen5823-assignments

image

Use Project Setup for BRD4014A and part EFR32BG13P632F512GM48 With Latest GNU ARM Toolchain

image

Finishing Initial Project Setup

  1. Close the project in Simplicity Studio
  2. Remove the project from simplicity studio (we will replace with our existing project below - and using the same name will cause conflicts). Do not delete the contents on disk.
  3. Rename the directory (not the project in Simplicity Studio, just the corresponding directory on the filesystem) ecen5823-assignments-simplicity-studio-latest-empty to avoid conflicts with the following steps.

Setting Up Existing ecen5823-assignments repo

Next we will modify the default content of the ecen5823-assignments repository to use the latest available SDK content.

  1. Start by cloning the most recent SDK master branch for the ecen5823-assignments repository into your workspace directory and importing into Simplicity Studio using File->Import. Close the project.
  2. Check out the silicon-labs-latest branch (git checkout silicon-labs-latest). This branch is intended to always be identical in the ecen5823-assignments and ecen5823-assignments-complete-private repositories for ease of upgrades/merges.
  3. Delete all the current contents of the repo, using rm -rf * from the ecen5823-assignments repository directory
  4. Copy over the contents of the latest empty project setup using:
cp -r ../ecen5823-assignments-simplicity-studio-latest-empty/* .
cp -r ../ecen5823-assignments-simplicity-studio-latest-empty/.project .
cp -r ../ecen5823-assignments-simplicity-studio-latest-empty/.cproject .
  1. Checkout the files specific to ECEN5823 from the current master branch
git checkout master -- src questions LICENSE README.md
  1. Copy the emlib files from the latest silicon labs SDK installation directory. Set the path appropriately in copy-emlib-files.sh based on the latest SDK version and path to Silicon Labs installation directory, then run using git bash.
  2. At this point you can use git show and git ls-files -d to sanity check that you've included the appropriate files from the SiliconLabs SDK directories to match the files already in the master branch of the repository. git ls-files -d will show you a list of files you deleted with your rm -rf * step which weren't a part of running copy-emlib-files.sh or the copy from latest empty project. Add any needed additional files/paths to the copy-emlib-files.sh script to copy from the silicon labs latest SDK and re-run as necessary.
  3. In hal-config.h, add a line to the header #include list #include src/hal-config-ecen5823.h to pull in ecen5823 specific HAL content (specifically display support).
  4. Try a build. The first build will probably fail due to missing paths to header files for the files added by copy-emlib-files.sh. Add these paths in the "Project Properties->C/C++ Build->Settings->GNU ARM C Compiler->Includes->Include Paths" configuration, making sure to use relative paths based on workspace and project location. Here are the paths you need to add as of SDK version 2.7
"${workspace_loc:/${ProjName}/platform/middleware/glib/dmd}"
"${workspace_loc:/${ProjName}/platform/middleware/glib}"
"${workspace_loc:/${ProjName}/platform/middleware/glib/glib}"
  1. Fix any remaining build errors, by copying in necessary files from the SDK directories using copy-emlib-files.sh, adding include paths, or making any other changes based on the changes made between SDK versions.
  • Turn on any desired .cproject settings, including turning on all compile warnings with -Wall (see the Properties->C/C++ Build->Settings->GNU ARM C Compiler->Warnings page.
  1. Make a commit with the changes to support build on this SDK version and push to the ecen5823-assignments branch silicon-labs-latest.
  2. Make a new branch for the sdk merge using git checkout -b sdk-<version>-bluetooth-sdk-<version>.
  3. Merge master into this branch using git merge master, create a pull request for this branch targeting the master branch.
  4. Test on hardware.
  5. Complete pull request.
  6. Checkout the assignment9 branch, checkout to a previous-semester-assignment9 branch and push to the git repo. This will save the full commit history for a given semester in this branch.
  7. Checkout the assignment2 branch. Look at the history to find the commit corresponding to the previous merge of the sdk for assignment 1, and prepare a patch set for all changes added to assignment 1 in order to implement assignment 2 using git format-patch <commit_hash_corresponding_to_previous_sdk_merge_for_assignment1>
  8. Force the working assignment2 branch to match the rebased assignment1 branch with git reset --hard assignment1.
  9. Run git am -3 *.patch. This re-applies the patches which were used to implement assignment2 on the previous SDK on top of the assignment 1 implementation for the new SDK.
  • Fix any conflicts. Use git am --skip to skip applying patches which change project files (if needed, these changes should be made to the project file in a new commit, ideally in earlier branches).
  1. Delete patch files with rm *.patch
  2. Repeat the steps above for assignment3 to assignment9 branch, creating patches based on git format-patch <commit_hash_corresponding_to_previous_assignment> then forcing to rebased assignment with git reset --hard <previous_assignment_rebased_branch> then git am -3 *.patch.
  3. Force push each assignment branch using git push -f origin assignmentX for assignment branches 2 through 9

Upgrading Private Assignment Solution Repository

  1. Clone the ecen5823-assignments-complete-private repository
  2. Add the assignments base public remote using git remote add assignments-base-public git@github.com:CU-ECEN-5823/ecen5823-assignments.git
  3. Fetch from the assignments base public remote using git fetch assignments-base-public
  4. Checkout the silicon labs latest branch updated above using git checkout --track assignments-base-public/silicon-labs-latest
  5. Make a new branch for the sdk merge using git checkout -b sdk-<version>-bluetooth-sdk-<version>.
  6. Merge the assignments-complete-base branch into this branch using git merge assignments-complete-base
  7. Fix any merge issues. Use git checkout silicon-labs-latest -- <file> to use the file as-is from silicon labs
  8. Create a pull request for this branch targeting assignments-complete-base.
  9. Test on hardware.
  10. Complete pull request.
  11. Complete rebase of each branch as described above.