-
Notifications
You must be signed in to change notification settings - Fork 1
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
Start by upgrading Simplicity Studio components to the latest available versions using the "Help->Update Software" menu.
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.
- Close the project in Simplicity Studio
- 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.
- 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.
Next we will modify the default content of the ecen5823-assignments repository to use the latest available SDK content.
- 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.
- 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. - Delete all the current contents of the repo, using
rm -rf *
from the ecen5823-assignments repository directory - 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 .
- Checkout the files specific to ECEN5823 from the current master branch
git checkout master -- src questions LICENSE README.md
- 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. - At this point you can use
git show
andgit 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 yourrm -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 thecopy-emlib-files.sh
script to copy from the silicon labs latest SDK and re-run as necessary. - 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). - 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}"
- 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.
- Make a commit with the changes to support build on this SDK version and push to the ecen5823-assignments branch silicon-labs-latest.
- Make a new branch for the sdk merge using
git checkout -b sdk-<version>-bluetooth-sdk-<version>
. - Merge master into this branch using
git merge master
, create a pull request for this branch targeting themaster
branch. - Test on hardware.
- Complete pull request.
- 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.
- 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>
- Force the working assignment2 branch to match the rebased assignment1 branch with
git reset --hard assignment1
. - 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).
- Delete patch files with rm *.patch
- 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 withgit reset --hard <previous_assignment_rebased_branch>
thengit am -3 *.patch
. - Force push each assignment branch using
git push -f origin assignmentX
for assignment branches 2 through 9
- Clone the ecen5823-assignments-complete-private repository
- Add the assignments base public remote using
git remote add assignments-base-public git@github.com:CU-ECEN-5823/ecen5823-assignments.git
- Fetch from the assignments base public remote using
git fetch assignments-base-public
- Checkout the silicon labs latest branch updated above using
git checkout --track assignments-base-public/silicon-labs-latest
- Make a new branch for the sdk merge using
git checkout -b sdk-<version>-bluetooth-sdk-<version>
. - Merge the assignments-complete-base branch into this branch using
git merge assignments-complete-base
- Fix any merge issues. Use
git checkout silicon-labs-latest -- <file>
to use the file as-is from silicon labs - Create a pull request for this branch targeting assignments-complete-base.
- Test on hardware.
- Complete pull request.
- Complete rebase of each branch as described above.