Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

Conversation

@AymarMuhikira
Copy link
Member

@AymarMuhikira AymarMuhikira commented Jul 16, 2019

Steps to build the project from branch OBC 1.0 …
Installations:

-Clone the branch OBC 1.0 of the repository on your local system.
-Install whichever version of SEGGER Embedded Studio is compatible with your machine.
-Download the GNU Embedded Toolchain for Arm. It is important to know the directory on your system where this toolchain is stored.

Building the Project:

-To build the project, from SEGGER Embedded Studio, select File>Import Project>Import IAR EWARM Project...
-In the copy of the project on your computer, navigate to
msg-obc-software/obc/upsat-obc-software-master/cubeMX/disco/EWARM
and select Project.eww
-Select the Internal Toolchain from the Build Configuration, and specify the IAR Installation Directory to be where the GNU Embedded Toolchain for Arm was stored after the download (select the entire GNU Tools ARM Embedded folder)
-Before building the project, there will be files that are imported twice in the project, delete one of the two copies by using Right click on the Project>Clean then delete
-Once all files are only referenced once, build the project. Path errors are bound to appear in the #include calls. You need to change the path to the file included to the one on your computer.
-Once these path errors are solved, disco.elf may give undefined symbol errors for some functions and data structures. To solve these, create a folder in the project and add the files where the functions and data structures are defined.
-Once these issues have been solved, the project should build successfully.

Flashing the Project:
On Linux (Debian):
-Open a command line terminal window and and install the ARM GNU Embedded Toolchain. First add the repository:
$ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
When prompted, press the Enter/Return key. Next, update your package lists and install the Toolchain:
$ sudo apt-get update
$ sudo apt-get install gcc-arm-none-eabi
Press y when prompted to continue with the installation.
-Now we need to install ST-Link. We start off by installing libusb:
$ sudo apt-get install git build-essential libusb-1.0.0-dev cmake
After installation is done, navigate to the $HOME directory and clone the ST-Link repository:
$ cd $HOME
$ git clone https://github.com/texane/stlink.git
Now navigate to /stlink and install:
$ cd stlink
$ make release
Wait until the dependencies are done installing, and then enter the following commands:
$ cd build/Release && make install DESTDIR=_install
//ST-Link is built and installed
$ echo "export PATH=\$PATH:$HOME/stlink/build/Release/_install/usr/local/bin" >> $HOME/.bashrc
$ source $HOME/.bashrc
-Now navigate to the directory of the location where the output of the Segger compilation is found. it should be in
.../obc/upsat-obc-software-master/cubeMX/disco/EWARM/disco/Exe
You should be able to find a file called disco.elf if compilation went successfully. We will now turn this file into a binary using the ARM GNU Embedded Toolchain, so that we can then flash the binary to our microchip (in our case, THE STM32F405RG) using ST-Link:
$ arm-none-eabi-size -tA disco.elf
//This verifies the file first
$ arm-none-eabi-objcopy -0 binary disco.elf disco.bin
//If you want to see that the binary file has been created, use the 'ls' command
Make sure you have plugged your microchip into a ST-Link device (such as the ST-LINK/v2-Isol) and into your computer via USB before continuing any further. Assure yourself that everything is fine by verifying that both the microchip and the ST-Link device have a LED light on, both of which should be red.
$ st-flash write disco.bin 0x8000000
If all went well, the ST-link utility should end with a message such as:
yyyy-mm-ddThh:mm:ss INFO common.c: Flash written and verified! jolly good!

Creating a personal branch:

-To commit the built project and any other changes that will be made in the future, it is better to not use the master branch but rather a personal branch. The naming convention is that the branch should be named OBC 1.0x Currently, there are two branches: OBC 1.01 and OBC 1.02, so new branches should continue from there.

AymarMuhikira and others added 2 commits July 13, 2019 16:54
**Installations:**

-Clone the branch OBC 1.0 of the repository on your local system.
-Install whichever version of SEGGER Embedded Studio is compatible with your machine.
-Download the GNU Embedded Toolchain for Arm (link: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). It is important to know the directory on your system where this toolchain is stored.

**Building the Project:**

-To build the project, from SEGGER Embedded Studio, select *File>Import Project>Import IAR EWARM Project...*
-In the copy of the project on your computer, navigate to *msg-obc-software>obc>upsat-obc-software-master>cubeMX>disco>EWARM* and select *Project.eww*
-Select the *Internal Toolchain* from the Build Configuration, and specify the IAR Installation Directory to be where the GNU Embedded Toolchain for Arm was stored after the download (select the entire GNU Tools ARM Embedded folder)
-Before building the project, there will be files that are imported twice in the project, delete one of the two copies by using *Right click on the Project>Clean* then delete
-Once all files are only referenced once, build the project. Path errors are bound to appear in the #include calls. You need to change the path to the file included to the one on your computer.
-Once these path errors are solved, disco.elf may give undefined symbol errors for some functions and data structures. To solve these, create a folder in the project and add the files where the functions and data structures are defined.
-Once these issues have been solved, the project should build successfully.

**Creating a personal branch:**

-To commit the built project and any other changes that will be made in the future, it is better to not use the master branch but rather a personal branch. The naming convention is that the branch should be named OBC 1.0x Currently, there are two branches: OBC 1.01 and OBC 1.02, so new branches should continue from there.
@AymarMuhikira AymarMuhikira self-assigned this Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants