This repository was archived by the owner on Feb 14, 2021. It is now read-only.
Project built by Aymar Muhikira from the OBC-1.0 branch #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/EWARMand 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
#includecalls. 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/ppaWhen 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-eabiPress
ywhen 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 cmakeAfter installation is done, navigate to the $HOME directory and clone the ST-Link repository:
$ cd $HOME$ git clone https://github.com/texane/stlink.gitNow navigate to
/stlinkand install:$ cd stlink$ make releaseWait 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/ExeYou 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' commandMake 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 0x8000000If 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.