-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from PeakSat/hotfix-eqm
fetch mram settings
- Loading branch information
Showing
54 changed files
with
3,559 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +0,0 @@ | ||
[submodule "lib/cobs-c"] | ||
path = lib/cobs-c | ||
url = [email protected]:cmcqueen/cobs-c.git | ||
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,75 @@ | ||
# OBC Software Repository | ||
# OBC Software EQM Repository | ||
|
||
In this repository is where all of the OBC Software is housed. This is the final version that will be used on the satellite. | ||
In this repository is where all of the OBC EQM Software is housed. This is the final version that will be used on the satellite. | ||
The software runs on the Microchip ATSAMV71Q21B Microcontroller Unit, which is a 32-bit ARM Cortex-M7 core. | ||
We use FreeRTOS to handle the tasking of the MCU. | ||
More information regarding OBC can be found [here](https://gitlab.com/groups/acubesat/obc/-/wikis/home). | ||
|
||
There is the `env-tests` branch that contains the test code, to be used in the Environmental Tests campaign. | ||
|
||
## Build | ||
The `eqm` repository can be built without any access to specialised hardware. We provide build | ||
instructions for Linux (or WSL) command-line, and the CLion IDE. | ||
|
||
The dependencies of this repository are managed through the [conan](https://conan.io/) package manager, with repositories | ||
from [ConanCenter](https://conan.io/center/) and [SpaceDot's packages](https://artifactory.spacedot.gr). | ||
|
||
For more detailed installation instructions, including how to integrate with a microcontroller, visit the | ||
[corresponding documentation page](https://acubesat.gitlab.io/obc/ecss-services/docs/md_docs_installation.html). | ||
|
||
### From the Command Line (CLI) | ||
|
||
1. Install a modern C++ compiler, CMake, and Conan. | ||
CMake >= 3.23 and Conan >= 2.0 are recommended. | ||
<details> | ||
<summary>Getting conan</summary> | ||
|
||
You can install [conan](https://conan.io/) following the instructions [from here](https://docs.conan.io/2/installation.html). | ||
</details> | ||
2. Clone the repository and enter the directory: | ||
```shell | ||
git clone [email protected]:acubesat/obc/environmental-campaign/obc-eqm-software.git | ||
cd obc-eqm-software | ||
``` | ||
3. (If you haven't already) create a conan profile for your system: | ||
```shell | ||
conan profile detect | ||
``` | ||
4. (If you haven't already) add the SpaceDot repository to conan: | ||
```shell | ||
conan remote add spacedot https://artifactory.spacedot.gr/artifactory/api/conan/conan | ||
``` | ||
5. Download all dependencies and build the project through conan: | ||
```shell | ||
conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile | ||
``` | ||
6. Download all submodules: | ||
```shell | ||
conan source . | ||
``` | ||
7. Add CMake flags: | ||
```shell | ||
cmake -B cmake-build-debug/build/Debug -DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc" -DCMAKE_BUILD_TYPE=Debug . | ||
``` | ||
8. Build the project: | ||
```shell | ||
cd cmake-build-debug/build/Debug | ||
make | ||
``` | ||
### From CLion | ||
|
||
CLion will automatically try to set up a CMake project for you. However, without the conan packages installed, this | ||
will quickly fail. Follow these steps to set up the conan project: | ||
|
||
1. Follow steps 1-6 from the CLI instructions above. | ||
2. Add the following to the CMake Options (File -> Settings -> Build, Execution, Deployment -> CMake -> CMake Options): | ||
``` | ||
-DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc" | ||
``` | ||
3. If your CMake project doesn't reload automatically, reload it manually (Tools -> CMake -> Reload CMake Project). | ||
We do not recommend using a Conan plugin for your IDE, as it may tamper with the default configuration for this repository. | ||
After cloning the repo, run the command `conan source .` to clone the needed repositories, which currently are: | ||
- [cross-platform-software](https://gitlab.com/acubesat/obc/cross-platform-software) | ||
- [atsam-component-drivers](https://gitlab.com/acubesat/obc/atsam-component-drivers) | ||
If cloning `COBS` throws a permission/access error, setup an SSH key in GitHub to fix it. | ||
|
||
If you're using CLion, you need to add in CMake options (File -> Settings -> Build, Execution, Deployment -> CMake -> | ||
CMake Options) this `-DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc"`. | ||
|
||
If you just cmake from cli, just add the same flags in your command. | ||
|
||
To be able to build, however, you need to install the required `conan` packages. See the `Conan` section for more info. | ||
|
||
### Conan | ||
This repository uses [conan 2.0](https://conan.io/) to manage dependencies. | ||
|
||
#### AcubeSAT Conan Packages | ||
Some of the Conan packages ([logger](https://gitlab.com/acubesat/obc/logger) and [ecss-services](https://gitlab.com/acubesat/obc/ecss-services)) are hosted on a private repository, so you | ||
need to either: | ||
- have access to the [repository](https://artifactory.spacedot.gr) (if you're already on GitLab, it's the same | ||
credentials, and you should login at least once) and add the | ||
remote to your conan remotes. To do that run the following two commands | ||
`conan remote add conan https://artifactory.spacedot.gr/artifactory/api/conan/conan` and | ||
`conan remote login conan $YOUR_USERNAME`, which will prompt you to add your password. | ||
- or, clone the repo on your own, and package it locally use `conan create . --build=missing` in the root of the repo. This way, you don't need to add the remote repository, as conan will add it in local cache. | ||
- or, clone the repo on your own and add it as a submodule in the `lib` folder, and make the necessary CMakeLists. | ||
txt changes to include it in the build. | ||
|
||
To install the necessary packages, you need to follow these steps: | ||
- Make sure you performed one of the `AcubeSAT Conan Packages` sections teps | ||
- Run `conan profile detect --force`: Generates default profile detecting GCC. However, for this project, you need to set up | ||
the correct architecture. Find where `conan` sets up profiles (probably `~/.conan2/profiles`) and run `cp conan-arm-profile ~/.conan2/profiles` (or another directory if conan2 stores the profiles elsewhere) in this project's folder. | ||
- Then run `conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile`. If you're using CLion and don't see `cmake-build-debug`, you have to `Reload CMake project` to have it generated. | ||
After you've run `conan install...` you can `Reload CMake project` and build as per usual. | ||
- Make sure you followed the steps under the `Build` section | ||
- If the *Imported target "common" included non-existent path* appears, just delete the `cmake-build-debug` folder and redo the `conan install...` command | ||
<details> | ||
<summary>Getting conan</summary> | ||
|
@@ -52,7 +78,6 @@ You can install [conan](https://conan.io/) following the instructions from | |
[here](https://docs.conan.io/2/installation.html).: | ||
</details> | ||
|
||
## Implemented Software | ||
Prototypes of ECSS Services | ||
|
@@ -69,7 +94,57 @@ Peripherals: | |
- UART with DMA | ||
- Parameter updating of ST[20] | ||
|
||
## Note | ||
## Using Minicom to monitor the U(S)ART of ATSAM | ||
|
||
#### Downloading Minicom | ||
|
||
`minicom` is found in almost all package managers for Linux and macOS. For Linux you can use: | ||
|
||
For Pop/Ubuntu/Debian derivatives | ||
```shell | ||
sudo apt install minicom | ||
``` | ||
|
||
For Fedora | ||
```shell | ||
sudo dnf install minicom | ||
``` | ||
|
||
For Arch | ||
```shell | ||
sudo pacman -S minicom | ||
``` | ||
|
||
#### Running minicom | ||
|
||
`minicom` is a program that displays the serial input of a port on your computer. To run it, you must specify such a port. | ||
|
||
On Linux systems, the serial ports for connected embedded devices are `/dev/ttyACMX`, where X is a number. The first device you connect will start at 0, and each new device increases the number by 1. Note that removing a device "frees" the port, so if you have two devices connnected and you remove the first, `/dev/ttyACM0` will be disconnected while `/dev/ttyACM1` will be connected to the remaining target device. When using `UART-to-USB` devices such as an `FTDI`, the naming scheme changes and the devices will be at `/dev/ttyUSBX`, however the above scheme remains the same. | ||
|
||
You can use the command `ls /dev/ttyACM*` to view all connected devices on the `/dev/ttyACMX` spectrum. | ||
If a device is connected to port `/dev/ttyACM0`, you can use: | ||
```shell | ||
minicom -D /dev/ttyACM0 | ||
``` | ||
to get its ouput. | ||
|
||
#### Using minicom | ||
|
||
All actions inside the program require pressing the `Meta` key first. If you want to exit the program, you need to press `Meta`, then `x`. On Linux the `Meta` key is `CTRL+A`, while on macOS it is `Escape`. You can use `Meta`, then `z` to view a list of shortcuts. | ||
|
||
#### Line Feeds | ||
|
||
Our embedded devices send only a `\n` delimiter on the end of each log message. Thus, when you open the `minicom` instance, you will see that each line starts at the end of the previous line. After a couple of log messages, the new lines will start at the right edge of the screen and the messages will be invisible. To control this, you can press `Meta`, then `u` to toggle interpreting `\n` as `\r\n`. Each new message will now start at the beginning of the next line. | ||
|
||
#### Saving output to file | ||
|
||
In case you need to save the output of a session to a file, use the option `-C filename.txt` when opening the program. For example: | ||
```shell | ||
minicom -D /dev/ttyACM0 -C output.txt | ||
``` | ||
will save the logs to the file `output.txt` in your current directory. | ||
|
||
## Watchdog | ||
|
||
The internal watchdog has been disabled for debugging reasons. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
set CHIPNAME samv71 | ||
|
||
source [find interface/stlink.cfg] | ||
source [find target/atsamv.cfg] | ||
|
||
source [find target/atsamv.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,16 @@ | |
|
||
|
||
class EQMSoftwareRecipe(ConanFile): | ||
name = "obc-adcs-eqm-sw" | ||
name = "obc-eqm-sw" | ||
version = "1.0" | ||
revision_mode = "scm" | ||
|
||
# Optional metadata | ||
license = "MIT" | ||
author = "SpaceDot - AcubeSAT, [email protected]" | ||
url = "https://gitlab.com/acubesat/obc/environmental-campaign/obc-eqm-software/" | ||
description = "EQM Software for OBC-ADCS campaign test" | ||
topics = ("satellite", "acubesat", "obc", "obc-software") | ||
url = "https://github.com/PeakSat/OBC-EQM-Software" | ||
description = "EQM Software for OBCcampaign test" | ||
topics = ("satellite", "peaksat", "obc", "obc-software") | ||
|
||
# Binary configuration | ||
settings = "os", "compiler", "build_type", "arch" | ||
|
@@ -34,12 +34,10 @@ def config_options(self): | |
|
||
def source(self): | ||
git = Git(self) | ||
git.clone(url="[email protected]:acubesat/obc/cross-platform-software.git", target=join(str(self.source_folder), "lib/cross-platform-software")) | ||
self.run("cd lib/cross-platform-software && git submodule update --init --recursive") | ||
self.run("cd lib/cross-platform-software && git checkout campaign-obc") | ||
git.clone(url="[email protected]:cmcqueen/cobs-c.git", target=join(str(self.source_folder), "lib/cobs-c")) | ||
git = Git(self) | ||
git.clone(url="[email protected]:acubesat/obc/atsam-component-drivers.git", target=join(str(self.source_folder), "lib/atsam-component-drivers")) | ||
self.run("cd lib/atsam-component-drivers && git checkout NAND-implementation") | ||
self.run("cd lib/atsam-component-drivers && git checkout NAND-partial-implementation") | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
Oops, something went wrong.