The version of FreeRTOS currently being used by AEMB is long outdated and has not been updated since two years ago. The version used is V7.1.1 while the latest version is already V8.0.1. Therefore, it is time to update it.

Working on a cloned git repository from AEMB FreeRTOS repository, the first thing to do is to fetch the latest revisions from the FreeRTOS upstream repository. Since the current version is V7.1.1 which contains up to revision 1750, the fetching process is limited to start from this revision onwards.

$ git svn fetch -r 1750:HEAD

Instead of fetching the revisions, git encounter an error.

Migrating from a git-svn v1 layout…
Data from a previous version of git-svn exists, but
.git/svn
(required for this version (1.9.1) of git-svn) does not exist.
Done migrating from a git-svn v1 layout
[svn-remote “svn”] unknown

The svn-remote was not declared in the .git/config file. So, the svn-remote for FreeRTOS upstream repository is to be added into the .git/config manually. This is done by adding the following lines into the .git/config file. Git will be able to fetch the revisions from SVN repositories based on the url set.

[svn-remote “svn”]
url = https://svn.code.sf.net/p/freertos/code
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
tags = tags/*:refs/remotes/tags/*

With this done, the fetching process is repeated. This process takes about 2 hours as there are more than 500 revisions to to be fetched.

After the fetching is completed, the latest remote branch needs to be merged into develop branch. The following commands can be used. The first command will show all the branches that are available, which will help to identify which branch is needed to be merged.

$ git branch -a

$ git checkout develop

$ git merge remotes/tags/V8.0.1

There appears to be a conflict with readme.txt. After fixing the conflict and committing the change, the merge is completed. This is shown in the gitk.

merge gitk


 

Since V7.2.0, the folders of FreeRTOS has been moved with the introduction of FreeRTOS+. There is two separate directories, one which stores FreeRTOS folders and files, another which does the same for FreeRTOS+. AEMB uses only FreeRTOS and the relevant files must be moved into the FreeRTOS folder. So, a new branch, cleanup is setup to do the changes for AEMB. This can be done by the following commands.

$ git checkout -b cleanup develop

Next, AEMB is moved. The following needs to be moved:

~/somny4/Demo/AEMB2   ~/somny4/Source/portable/AEMB2  ~/somny4/Source/README  ~/somny4/Source/README.md  ~/somny4/Source/Makefile

The moving is done using the following command lines:

$ mv ~/somny4/Demo/AEMB2 ~/somny4/FreeRTOS/Demo/AEMB2

$ mv ~/somny4/Source/portable/AEMB2 ~/somny4/FreeRTOS/Source/portable/AEMB2

$ mv ~/somny4/Source/README ~/somny4/FreeRTOS/Source/README

$ mv ~/somny4/Source/README.md ~/somny4/FreeRTOS/Source/README.md

$ mv ~/somny4/Source/Makefile ~/somny4/FreeRTOS/Source/Makefile

When the moving is done, the changes are committed. Now, there are some unused folders that are no longer required for FreeRTOS V8.0.1. These folders need to be removed since FreeRTOS no longer uses them.

~/somny4/Demo  ~/somny4/License  ~/somny4/Source

$ rm -rf ~/somny4/Demo

$ rm -rf ~/somny4/License

$ rm -rf ~/somny4/Source

The above commands will remove the folders. Also, these changes are committed.

We are done with the changes. So, the cleanup branch is to be merged back into develop branch. The develop branch will be updated with the new changes. The is done with the commands:

$ git checkout develop

$ git merge –no-ff cleanup

$git branch -d cleanup

git merge branch cleanup

Lastly, the changes and updates are pushed to github.

Next will be to update the AEMB code for V8.0.1.


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.